Compare commits
25 Commits
OpenSSL_0_
...
OpenSSL_0_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
033d858cc2 | ||
|
|
31fab3e8da | ||
|
|
4da88a8d92 | ||
|
|
8e228dc56a | ||
|
|
436a376bb0 | ||
|
|
2e36cc41ef | ||
|
|
410aa5227b | ||
|
|
054009a638 | ||
|
|
71f080935a | ||
|
|
e95f626827 | ||
|
|
472bde404f | ||
|
|
1850a49bd0 | ||
|
|
bec9e0da7a | ||
|
|
5ece777974 | ||
|
|
58c7977cfa | ||
|
|
b14d0e0590 | ||
|
|
f3c751067a | ||
|
|
f9073fce9b | ||
|
|
288d2fb959 | ||
|
|
6720e9472f | ||
|
|
9890b00082 | ||
|
|
58dc480ffd | ||
|
|
d2eec3a610 | ||
|
|
557068c087 | ||
|
|
767d6bfb87 |
@@ -1,3 +1,6 @@
|
||||
Makefile.ssl
|
||||
MINFO
|
||||
makefile.one
|
||||
tmp
|
||||
out
|
||||
outinc
|
||||
|
||||
33
CHANGES
33
CHANGES
@@ -3,12 +3,33 @@
|
||||
_______________
|
||||
|
||||
|
||||
Changes between 0.9.2b and 0.9.3 [XX May 1999]
|
||||
[I suggest using the same format for the
|
||||
date as in opensslv.h. 0.9.1c used
|
||||
hyphens in the date, so I wrote
|
||||
[23-Dec-1998] down below; but in later
|
||||
versions, these hyphens are gone.]
|
||||
Changes between 0.9.3 and 0.9.3a [29 May 1999]
|
||||
|
||||
*) New configuration variant "sco5-gcc".
|
||||
|
||||
*) Updated some demos.
|
||||
[Sean O Riordain, Wade Scholine]
|
||||
|
||||
*) Add missing BIO_free at exit of pkcs12 application.
|
||||
[Wu Zhigang]
|
||||
|
||||
*) Fix memory leak in conf.c.
|
||||
[Steve Henson]
|
||||
|
||||
*) Updates for Win32 to assembler version of MD5.
|
||||
[Steve Henson]
|
||||
|
||||
*) Set #! path to perl in apps/der_chop to where we found it
|
||||
instead of using a fixed path.
|
||||
[Bodo Moeller]
|
||||
|
||||
*) SHA library changes for irix64-mips4-cc.
|
||||
[Andy Polyakov]
|
||||
|
||||
*) Improvements for VMS support.
|
||||
[Richard Levitte]
|
||||
|
||||
Changes between 0.9.2b and 0.9.3 [24 May 1999]
|
||||
|
||||
*) Bignum library bug fix. IRIX 6 passes "make test" now!
|
||||
This also avoids the problems with SC4.2 and unpatched SC5.
|
||||
|
||||
48
Configure
48
Configure
@@ -135,8 +135,8 @@ my %table=(
|
||||
"irix-mips3-gcc","gcc:-mips3 -O2 -DTERMIOS -DB_ENDIAN:(unknown)::MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR SIXTY_FOUR_BIT:::",
|
||||
"irix-mips3-cc", "cc:-n32 -mips3 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN:(unknown)::DES_PTR DES_RISC2 DES_UNROLL BF_PTR SIXTY_FOUR_BIT:::",
|
||||
"debug-irix-cc", "cc:-w2 -g -DCRYPTO_MDEBUG -DTERMIOS -DB_ENDIAN:(unknown):::::",
|
||||
# This is the n64 mode build. (Untested!)
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS:(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT:::",
|
||||
# This is the n64 mode build.
|
||||
"irix64-mips4-cc", "cc:-64 -mips4 -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN:(unknown)::DES_RISC2 DES_UNROLL SIXTY_FOUR_BIT_LONG:::",
|
||||
|
||||
# HPUX 9.X config.
|
||||
# Don't use the bundled cc. It is broken. Use HP ANSI C if possible, or gcc.
|
||||
@@ -221,6 +221,7 @@ my %table=(
|
||||
# SCO 5 - Ben Laurie <ben@algroup.co.uk> says the -O breaks the
|
||||
# SCO cc.
|
||||
"sco5-cc", "cc::(unknown):-lsocket:$x86_gcc_des ${x86_gcc_opts}:::", # des options?
|
||||
"sco5-gcc", "gcc:-O3 -fomit-frame-pointer:(unknown):-lsocket:BN_LLONG $x86_gcc_des ${x86_gcc_opts}:::", # the SCO assembler doesn't seem to like our assembler files ...
|
||||
|
||||
# Sinix/ReliantUNIX RM400
|
||||
# NOTE: The CDS++ Compiler up to V2.0Bsomething has the IRIX_CC_BUG optimizer problem. Better use -g */
|
||||
@@ -366,6 +367,14 @@ foreach (@ARGV)
|
||||
$options .= $_ unless $_ eq $target;
|
||||
}
|
||||
|
||||
if ($target eq "TABLE") {
|
||||
foreach $target (sort keys %table) {
|
||||
print_table_entry($target);
|
||||
}
|
||||
print "\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
&usage if (!defined($table{$target}));
|
||||
|
||||
my $IsWindows=scalar grep /^$target$/,@WinTargets;
|
||||
@@ -650,6 +659,12 @@ if($IsWindows) {
|
||||
# Run "make depend" manually if you want to be able to delete
|
||||
# the source code files of ciphers you left out.
|
||||
&dofile("tools/c_rehash",$openssldir,'^DIR=', 'DIR=%s',);
|
||||
if ( $perl =~ m@^/@) {
|
||||
&dofile("apps/der_chop",$perl,'^#!/', '#!%s');
|
||||
} else {
|
||||
# No path for Perl known ...
|
||||
&dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s');
|
||||
}
|
||||
}
|
||||
|
||||
my $pwd;
|
||||
@@ -750,3 +765,32 @@ sub dofile
|
||||
rename($f,"$ff.bak") || die "unable to rename $f\n" if -e $f;
|
||||
rename("$ff.new",$f) || die "unable to rename $ff.new\n";
|
||||
}
|
||||
|
||||
sub print_table_entry
|
||||
{
|
||||
my $target = shift;
|
||||
|
||||
(my $cc,my $cflags,my $thread_cflag,my $lflags,my $bn_ops,
|
||||
my $bn_obj,my $des_obj,my $bf_obj,
|
||||
$md5_obj,$sha1_obj,my $cast_obj,my $rc4_obj,$rmd160_obj,my $rc5_obj)=
|
||||
split(/\s*:\s*/,$table{$target} . ":" x 20 , -1);
|
||||
|
||||
print <<EOF
|
||||
|
||||
*** $target
|
||||
\$cc = $cc
|
||||
\$cflags = $cflags
|
||||
\$thread_cflag = $thread_cflag
|
||||
\$lflags = $lflags
|
||||
\$bn_ops = $bn_ops
|
||||
\$bn_obj = $bn_obj
|
||||
\$des_obj = $des_obj
|
||||
\$bf_obj = $bf_obj
|
||||
\$md5_obj = $md5_obj
|
||||
\$sha1_obj = $sha1_obj
|
||||
\$cast_obj = $cast_obj
|
||||
\$rc4_obj = $rc4_obj
|
||||
\$rmd160_obj = $rmd160_obj
|
||||
\$rc5_obj = $rc5_obj
|
||||
EOF
|
||||
}
|
||||
|
||||
5
INSTALL
5
INSTALL
@@ -119,6 +119,11 @@
|
||||
Include the output of "./config -t" and the OpenSSL version
|
||||
number in your message.
|
||||
|
||||
[If you encounter assembler error messages, try the "no-asm"
|
||||
configuration option as an immediate fix. Note that on Solaris x86
|
||||
(not on Sparcs!) you may have to install the GNU assembler to use
|
||||
OpenSSL assembler code -- /usr/ccs/bin/as won't do.]
|
||||
|
||||
3. After a successful build, the libraries should be tested. Run:
|
||||
|
||||
$ make test
|
||||
|
||||
27
INSTALL.VMS
27
INSTALL.VMS
@@ -83,6 +83,10 @@ Note 2: if you want to compile the crypto library only, please make sure
|
||||
you have at least done a @MAKEVMS DATE and a @MAKEVMS SOFTLINKS.
|
||||
A lot of things will break if you don't.
|
||||
|
||||
Note 3: Alpha users will get a number of informational messages when
|
||||
compiling the [.asm]vms.mar file in the BN (bignum) part of
|
||||
the crypto library. These can be safely ignored.
|
||||
|
||||
Test:
|
||||
=====
|
||||
|
||||
@@ -106,6 +110,9 @@ Installation is easy, just do the following:
|
||||
subdirectories, libraries, header files, programs and startup command
|
||||
procedures.
|
||||
|
||||
N.B.: INSTALL.COM builds a new directory structure, different from
|
||||
the directory tree where you have now build OpenSSL.
|
||||
|
||||
In the [.VMS] subdirectory of the installation, you will find the
|
||||
following command procedures:
|
||||
|
||||
@@ -216,3 +223,23 @@ for further info.
|
||||
--
|
||||
Richard Levitte <richard@levitte.org>
|
||||
1999-03-09
|
||||
|
||||
|
||||
TODO:
|
||||
=====
|
||||
|
||||
There are a few things that need to be worked out in the VMS version of
|
||||
OpenSSL, still:
|
||||
|
||||
- Description files. ("Makefile's" :-))
|
||||
- Script code to link an already compiled build tree.
|
||||
- A VMSINSTALlable version (way in the future, unless someone else hacks).
|
||||
- shareable images (DLL for you Windows folks).
|
||||
|
||||
There may be other things that I have missed and that may be desirable.
|
||||
Please send mail to <openssl-users@openssl.org> or to me directly if you
|
||||
have any ideas.
|
||||
|
||||
--
|
||||
Richard Levitte <richard@levitte.org>
|
||||
1999-05-24
|
||||
|
||||
2
README
2
README
@@ -1,5 +1,5 @@
|
||||
|
||||
OpenSSL 0.9.2b 22-Mar-1999
|
||||
OpenSSL 0.9.3 24 May 1999
|
||||
|
||||
Copyright (c) 1998-1999 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
OpenSSL 0.9.2c for VMS, README
|
||||
written by Richard Levitte
|
||||
<richard@levitte.org>
|
||||
|
||||
|
||||
For a more general overview of SSLeay, read README.
|
||||
If you just want to compile and install, read INSTALL.VMS
|
||||
|
||||
|
||||
A few notes:
|
||||
|
||||
Things NOT done:
|
||||
================
|
||||
|
||||
There are a bunch of directories that aren't touched on VMS so far.
|
||||
If anyone wants to add those capabilities, go right ahead.
|
||||
|
||||
The directories not touched but that might be of interest in the
|
||||
future are:
|
||||
|
||||
[.DEMOS]
|
||||
[.TOOLS]
|
||||
[.UTIL]
|
||||
|
||||
|
||||
Things added by me:
|
||||
===================
|
||||
|
||||
[.VMS] a directory with VMS command procedures. Right now,
|
||||
there are a two of them, of which one is not finished.
|
||||
|
||||
|
||||
Things removed:
|
||||
===============
|
||||
|
||||
In some other patch kits, there were things very OSU-httpd specific
|
||||
things. I haven't included those, because they seem to belong more
|
||||
with the OSU source.
|
||||
|
||||
I am, however, assembling those things in a separate package.
|
||||
|
||||
|
||||
TODO:
|
||||
=====
|
||||
|
||||
- Description files.
|
||||
- Bug fixes (of course).
|
||||
- A VMSINSTALlable version (way in the future, unless someone else hacks).
|
||||
- shareable images (DLL for you Windows folks).
|
||||
- other... Please send me ideas.
|
||||
|
||||
|
||||
Report bugs and such:
|
||||
=====================
|
||||
|
||||
I maintain a few mailinglists for bug reports and such on software that
|
||||
I develop/port/enhance/destroy. Please look at http://www.free.lp.se/
|
||||
for further info.
|
||||
|
||||
|
||||
--
|
||||
Richard Levitte <richard@levitte.org>
|
||||
1999-03-09
|
||||
@@ -24,6 +24,7 @@ $ DSA :== $SSLEXE:OPENSSL DSA
|
||||
$ DSAPARAM :== $SSLEXE:OPENSSL DSAPARAM
|
||||
$ X509 :== $SSLEXE:OPENSSL X509
|
||||
$ GENRSA :== $SSLEXE:OPENSSL GENRSA
|
||||
$ GENDSA :== $SSLEXE:OPENSSL GENDSA
|
||||
$ S_SERVER :== $SSLEXE:OPENSSL S_SERVER
|
||||
$ S_CLIENT :== $SSLEXE:OPENSSL S_CLIENT
|
||||
$ SPEED :== $SSLEXE:OPENSSL SPEED
|
||||
@@ -33,3 +34,5 @@ $ PKCS7 :== $SSLEXE:OPENSSL PKCS7
|
||||
$ CRL2PKCS7:== $SSLEXE:OPENSSL CRL2P7
|
||||
$ SESS_ID :== $SSLEXE:OPENSSL SESS_ID
|
||||
$ CIPHERS :== $SSLEXE:OPENSSL CIPHERS
|
||||
$ NSEQ :== $SSLEXE:OPENSSL NSEQ
|
||||
$ PKCS12 :== $SSLEXE:OPENSSL PKCS12
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
openssl
|
||||
Makefile.save
|
||||
der_chop
|
||||
der_chop.bak
|
||||
|
||||
@@ -452,6 +452,7 @@ if (export_cert) {
|
||||
PKCS12_free(p12);
|
||||
ret = 0;
|
||||
end:
|
||||
BIO_free(out);
|
||||
EXIT(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
static char *x509_usage[]={
|
||||
"usage: x509 args\n",
|
||||
" -inform arg - input format - default PEM (one of DER, NET or PEM)\n",
|
||||
" -outform arg - output format - default PEM (one of DER, NET or PEM\n",
|
||||
" -outform arg - output format - default PEM (one of DER, NET or PEM)\n",
|
||||
" -keyform arg - private key format - default PEM\n",
|
||||
" -CAform arg - CA format - default PEM\n",
|
||||
" -CAkeyform arg - CA key format - default PEM\n",
|
||||
|
||||
@@ -106,7 +106,7 @@ install:
|
||||
@for i in $(SDIRS) ;\
|
||||
do \
|
||||
(cd $$i; echo "making install in crypto/$$i..."; \
|
||||
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
|
||||
$(MAKE) CC='$(CC)' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' install ); \
|
||||
done;
|
||||
|
||||
lint:
|
||||
|
||||
@@ -100,7 +100,7 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
rm -f asm/bx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s
|
||||
rm -f asm/co86unix.cpp asm/bn86unix.cpp *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -93,7 +93,8 @@ BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
|
||||
bn_check_num(num);
|
||||
if (num <= 0) return(c1);
|
||||
|
||||
for (;;)
|
||||
/* for (;;) */
|
||||
while (1) /* circumvent egcs-1.1.2 bug */
|
||||
{
|
||||
mul(rp[0],ap[0],w,c1);
|
||||
if (--num == 0) break;
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
int test_add(BIO *bp);
|
||||
int test_sub(BIO *bp);
|
||||
int test_lshift1(BIO *bp);
|
||||
int test_lshift(BIO *bp,BN_CTX *ctx);
|
||||
int test_lshift(BIO *bp,BN_CTX *ctx,BIGNUM *a_);
|
||||
int test_rshift1(BIO *bp);
|
||||
int test_rshift(BIO *bp,BN_CTX *ctx);
|
||||
int test_div(BIO *bp,BN_CTX *ctx);
|
||||
@@ -95,6 +95,9 @@ static int results=0;
|
||||
#include "bss_file.c"
|
||||
#endif
|
||||
|
||||
static unsigned char lst1[]="\xC6\x4F\x43\x04\x2A\xEA\xCA\x6E\x58\x36\x80\x5B\xE8\xC9"
|
||||
"\x9B\x04\x5D\x48\x36\xC2\xFD\x16\xC9\x64\xF0";
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
BN_CTX *ctx;
|
||||
@@ -152,8 +155,13 @@ int main(int argc, char *argv[])
|
||||
if (!test_lshift1(out)) goto err;
|
||||
fflush(stdout);
|
||||
|
||||
fprintf(stderr,"test BN_lshift (fixed)\n");
|
||||
if (!test_lshift(out,ctx,BN_bin2bn(lst1,sizeof(lst1)-1,NULL)))
|
||||
goto err;
|
||||
fflush(stdout);
|
||||
|
||||
fprintf(stderr,"test BN_lshift\n");
|
||||
if (!test_lshift(out,ctx)) goto err;
|
||||
if (!test_lshift(out,ctx,NULL)) goto err;
|
||||
fflush(stdout);
|
||||
|
||||
fprintf(stderr,"test BN_rshift1\n");
|
||||
@@ -815,19 +823,24 @@ int test_exp(BIO *bp, BN_CTX *ctx)
|
||||
return(1);
|
||||
}
|
||||
|
||||
int test_lshift(BIO *bp,BN_CTX *ctx)
|
||||
int test_lshift(BIO *bp,BN_CTX *ctx,BIGNUM *a_)
|
||||
{
|
||||
BIGNUM *a,*b,*c,*d;
|
||||
int i;
|
||||
|
||||
a=BN_new();
|
||||
b=BN_new();
|
||||
c=BN_new();
|
||||
d=BN_new();
|
||||
BN_one(c);
|
||||
|
||||
BN_rand(a,200,0,0); /**/
|
||||
a->neg=rand_neg();
|
||||
if(a_)
|
||||
a=a_;
|
||||
else
|
||||
{
|
||||
a=BN_new();
|
||||
BN_rand(a,200,0,0); /**/
|
||||
a->neg=rand_neg();
|
||||
}
|
||||
for (i=0; i<70; i++)
|
||||
{
|
||||
BN_lshift(b,a,i+1);
|
||||
@@ -849,6 +862,15 @@ int test_lshift(BIO *bp,BN_CTX *ctx)
|
||||
if(!BN_is_zero(d))
|
||||
{
|
||||
BIO_puts(bp,"Left shift test failed!\n");
|
||||
BIO_puts(bp,"a=");
|
||||
BN_print(bp,a);
|
||||
BIO_puts(bp,"\nb=");
|
||||
BN_print(bp,b);
|
||||
BIO_puts(bp,"\nc=");
|
||||
BN_print(bp,c);
|
||||
BIO_puts(bp,"\nd=");
|
||||
BN_print(bp,d);
|
||||
BIO_puts(bp,"\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
rm -f asm/cx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -358,7 +358,7 @@ char *CONF_get_string(LHASH *conf, char *section, char *name)
|
||||
if (p != NULL) return(p);
|
||||
}
|
||||
}
|
||||
vv.section=BUF_strdup("default");
|
||||
vv.section="default";
|
||||
vv.name=name;
|
||||
v=(CONF_VALUE *)lh_retrieve(conf,(char *)&vv);
|
||||
if (v != NULL)
|
||||
|
||||
@@ -132,7 +132,7 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
rm -f asm/dx86unix.cpp asm/yx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
#include "des_locl.h"
|
||||
#include "cryptlib.h"
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -109,10 +109,10 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
rm -f asm/mx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
md5_dgst.o: ../../include/openssl/md5.h ../../include/openssl/opensslv.h
|
||||
md5_dgst.o: ../md32_common.h md5_locl.h
|
||||
md5_dgst.o: ../../include/openssl/md5.h ../../include/openssl/opensslconf.h
|
||||
md5_dgst.o: ../../include/openssl/opensslv.h ../md32_common.h md5_locl.h
|
||||
md5_one.o: ../../include/openssl/md5.h
|
||||
|
||||
@@ -8,15 +8,16 @@
|
||||
.386
|
||||
.model FLAT
|
||||
_TEXT SEGMENT
|
||||
PUBLIC _md5_block_x86
|
||||
PUBLIC _md5_block_asm_host_order
|
||||
|
||||
_md5_block_x86 PROC NEAR
|
||||
_md5_block_asm_host_order PROC NEAR
|
||||
push esi
|
||||
push edi
|
||||
mov edi, DWORD PTR 12[esp]
|
||||
mov esi, DWORD PTR 16[esp]
|
||||
mov ecx, DWORD PTR 20[esp]
|
||||
push ebp
|
||||
shl ecx, 6
|
||||
push ebx
|
||||
add ecx, esi
|
||||
sub ecx, 64
|
||||
@@ -34,161 +35,161 @@ L000start:
|
||||
xor edi, edx
|
||||
and edi, ebx
|
||||
lea eax, DWORD PTR 3614090360[ebp*1+eax]
|
||||
mov ebp, DWORD PTR 4[esi]
|
||||
xor edi, edx
|
||||
add eax, edi
|
||||
mov edi, ebx
|
||||
rol eax, 7
|
||||
mov ebp, DWORD PTR 4[esi]
|
||||
add eax, ebx
|
||||
; R0 1
|
||||
xor edi, ecx
|
||||
and edi, eax
|
||||
lea edx, DWORD PTR 3905402710[ebp*1+edx]
|
||||
mov ebp, DWORD PTR 8[esi]
|
||||
xor edi, ecx
|
||||
add edx, edi
|
||||
mov edi, eax
|
||||
rol edx, 12
|
||||
mov ebp, DWORD PTR 8[esi]
|
||||
add edx, eax
|
||||
; R0 2
|
||||
xor edi, ebx
|
||||
and edi, edx
|
||||
lea ecx, DWORD PTR 606105819[ebp*1+ecx]
|
||||
mov ebp, DWORD PTR 12[esi]
|
||||
xor edi, ebx
|
||||
add ecx, edi
|
||||
mov edi, edx
|
||||
rol ecx, 17
|
||||
mov ebp, DWORD PTR 12[esi]
|
||||
add ecx, edx
|
||||
; R0 3
|
||||
xor edi, eax
|
||||
and edi, ecx
|
||||
lea ebx, DWORD PTR 3250441966[ebp*1+ebx]
|
||||
mov ebp, DWORD PTR 16[esi]
|
||||
xor edi, eax
|
||||
add ebx, edi
|
||||
mov edi, ecx
|
||||
rol ebx, 22
|
||||
mov ebp, DWORD PTR 16[esi]
|
||||
add ebx, ecx
|
||||
; R0 4
|
||||
xor edi, edx
|
||||
and edi, ebx
|
||||
lea eax, DWORD PTR 4118548399[ebp*1+eax]
|
||||
mov ebp, DWORD PTR 20[esi]
|
||||
xor edi, edx
|
||||
add eax, edi
|
||||
mov edi, ebx
|
||||
rol eax, 7
|
||||
mov ebp, DWORD PTR 20[esi]
|
||||
add eax, ebx
|
||||
; R0 5
|
||||
xor edi, ecx
|
||||
and edi, eax
|
||||
lea edx, DWORD PTR 1200080426[ebp*1+edx]
|
||||
mov ebp, DWORD PTR 24[esi]
|
||||
xor edi, ecx
|
||||
add edx, edi
|
||||
mov edi, eax
|
||||
rol edx, 12
|
||||
mov ebp, DWORD PTR 24[esi]
|
||||
add edx, eax
|
||||
; R0 6
|
||||
xor edi, ebx
|
||||
and edi, edx
|
||||
lea ecx, DWORD PTR 2821735955[ebp*1+ecx]
|
||||
mov ebp, DWORD PTR 28[esi]
|
||||
xor edi, ebx
|
||||
add ecx, edi
|
||||
mov edi, edx
|
||||
rol ecx, 17
|
||||
mov ebp, DWORD PTR 28[esi]
|
||||
add ecx, edx
|
||||
; R0 7
|
||||
xor edi, eax
|
||||
and edi, ecx
|
||||
lea ebx, DWORD PTR 4249261313[ebp*1+ebx]
|
||||
mov ebp, DWORD PTR 32[esi]
|
||||
xor edi, eax
|
||||
add ebx, edi
|
||||
mov edi, ecx
|
||||
rol ebx, 22
|
||||
mov ebp, DWORD PTR 32[esi]
|
||||
add ebx, ecx
|
||||
; R0 8
|
||||
xor edi, edx
|
||||
and edi, ebx
|
||||
lea eax, DWORD PTR 1770035416[ebp*1+eax]
|
||||
mov ebp, DWORD PTR 36[esi]
|
||||
xor edi, edx
|
||||
add eax, edi
|
||||
mov edi, ebx
|
||||
rol eax, 7
|
||||
mov ebp, DWORD PTR 36[esi]
|
||||
add eax, ebx
|
||||
; R0 9
|
||||
xor edi, ecx
|
||||
and edi, eax
|
||||
lea edx, DWORD PTR 2336552879[ebp*1+edx]
|
||||
mov ebp, DWORD PTR 40[esi]
|
||||
xor edi, ecx
|
||||
add edx, edi
|
||||
mov edi, eax
|
||||
rol edx, 12
|
||||
mov ebp, DWORD PTR 40[esi]
|
||||
add edx, eax
|
||||
; R0 10
|
||||
xor edi, ebx
|
||||
and edi, edx
|
||||
lea ecx, DWORD PTR 4294925233[ebp*1+ecx]
|
||||
mov ebp, DWORD PTR 44[esi]
|
||||
xor edi, ebx
|
||||
add ecx, edi
|
||||
mov edi, edx
|
||||
rol ecx, 17
|
||||
mov ebp, DWORD PTR 44[esi]
|
||||
add ecx, edx
|
||||
; R0 11
|
||||
xor edi, eax
|
||||
and edi, ecx
|
||||
lea ebx, DWORD PTR 2304563134[ebp*1+ebx]
|
||||
mov ebp, DWORD PTR 48[esi]
|
||||
xor edi, eax
|
||||
add ebx, edi
|
||||
mov edi, ecx
|
||||
rol ebx, 22
|
||||
mov ebp, DWORD PTR 48[esi]
|
||||
add ebx, ecx
|
||||
; R0 12
|
||||
xor edi, edx
|
||||
and edi, ebx
|
||||
lea eax, DWORD PTR 1804603682[ebp*1+eax]
|
||||
mov ebp, DWORD PTR 52[esi]
|
||||
xor edi, edx
|
||||
add eax, edi
|
||||
mov edi, ebx
|
||||
rol eax, 7
|
||||
mov ebp, DWORD PTR 52[esi]
|
||||
add eax, ebx
|
||||
; R0 13
|
||||
xor edi, ecx
|
||||
and edi, eax
|
||||
lea edx, DWORD PTR 4254626195[ebp*1+edx]
|
||||
mov ebp, DWORD PTR 56[esi]
|
||||
xor edi, ecx
|
||||
add edx, edi
|
||||
mov edi, eax
|
||||
rol edx, 12
|
||||
mov ebp, DWORD PTR 56[esi]
|
||||
add edx, eax
|
||||
; R0 14
|
||||
xor edi, ebx
|
||||
and edi, edx
|
||||
lea ecx, DWORD PTR 2792965006[ebp*1+ecx]
|
||||
mov ebp, DWORD PTR 60[esi]
|
||||
xor edi, ebx
|
||||
add ecx, edi
|
||||
mov edi, edx
|
||||
rol ecx, 17
|
||||
mov ebp, DWORD PTR 60[esi]
|
||||
add ecx, edx
|
||||
; R0 15
|
||||
xor edi, eax
|
||||
and edi, ecx
|
||||
lea ebx, DWORD PTR 1236535329[ebp*1+ebx]
|
||||
mov ebp, DWORD PTR 4[esi]
|
||||
xor edi, eax
|
||||
add ebx, edi
|
||||
mov edi, ecx
|
||||
rol ebx, 22
|
||||
mov ebp, DWORD PTR 4[esi]
|
||||
add ebx, ecx
|
||||
;
|
||||
; R1 section
|
||||
@@ -359,8 +360,8 @@ L000start:
|
||||
xor edi, ebx
|
||||
lea eax, DWORD PTR 4294588738[ebp*1+eax]
|
||||
add eax, edi
|
||||
mov ebp, DWORD PTR 32[esi]
|
||||
rol eax, 4
|
||||
mov ebp, DWORD PTR 32[esi]
|
||||
mov edi, ebx
|
||||
; R2 33
|
||||
lea edx, DWORD PTR 2272392833[ebp*1+edx]
|
||||
@@ -377,8 +378,8 @@ L000start:
|
||||
xor edi, edx
|
||||
lea ecx, DWORD PTR 1839030562[ebp*1+ecx]
|
||||
add ecx, edi
|
||||
mov ebp, DWORD PTR 56[esi]
|
||||
rol ecx, 16
|
||||
mov ebp, DWORD PTR 56[esi]
|
||||
mov edi, edx
|
||||
; R2 35
|
||||
lea ebx, DWORD PTR 4259657740[ebp*1+ebx]
|
||||
@@ -395,8 +396,8 @@ L000start:
|
||||
xor edi, ebx
|
||||
lea eax, DWORD PTR 2763975236[ebp*1+eax]
|
||||
add eax, edi
|
||||
mov ebp, DWORD PTR 16[esi]
|
||||
rol eax, 4
|
||||
mov ebp, DWORD PTR 16[esi]
|
||||
mov edi, ebx
|
||||
; R2 37
|
||||
lea edx, DWORD PTR 1272893353[ebp*1+edx]
|
||||
@@ -413,8 +414,8 @@ L000start:
|
||||
xor edi, edx
|
||||
lea ecx, DWORD PTR 4139469664[ebp*1+ecx]
|
||||
add ecx, edi
|
||||
mov ebp, DWORD PTR 40[esi]
|
||||
rol ecx, 16
|
||||
mov ebp, DWORD PTR 40[esi]
|
||||
mov edi, edx
|
||||
; R2 39
|
||||
lea ebx, DWORD PTR 3200236656[ebp*1+ebx]
|
||||
@@ -431,8 +432,8 @@ L000start:
|
||||
xor edi, ebx
|
||||
lea eax, DWORD PTR 681279174[ebp*1+eax]
|
||||
add eax, edi
|
||||
mov ebp, DWORD PTR [esi]
|
||||
rol eax, 4
|
||||
mov ebp, DWORD PTR [esi]
|
||||
mov edi, ebx
|
||||
; R2 41
|
||||
lea edx, DWORD PTR 3936430074[ebp*1+edx]
|
||||
@@ -449,8 +450,8 @@ L000start:
|
||||
xor edi, edx
|
||||
lea ecx, DWORD PTR 3572445317[ebp*1+ecx]
|
||||
add ecx, edi
|
||||
mov ebp, DWORD PTR 24[esi]
|
||||
rol ecx, 16
|
||||
mov ebp, DWORD PTR 24[esi]
|
||||
mov edi, edx
|
||||
; R2 43
|
||||
lea ebx, DWORD PTR 76029189[ebp*1+ebx]
|
||||
@@ -467,8 +468,8 @@ L000start:
|
||||
xor edi, ebx
|
||||
lea eax, DWORD PTR 3654602809[ebp*1+eax]
|
||||
add eax, edi
|
||||
mov ebp, DWORD PTR 48[esi]
|
||||
rol eax, 4
|
||||
mov ebp, DWORD PTR 48[esi]
|
||||
mov edi, ebx
|
||||
; R2 45
|
||||
lea edx, DWORD PTR 3873151461[ebp*1+edx]
|
||||
@@ -485,8 +486,8 @@ L000start:
|
||||
xor edi, edx
|
||||
lea ecx, DWORD PTR 530742520[ebp*1+ecx]
|
||||
add ecx, edi
|
||||
mov ebp, DWORD PTR 8[esi]
|
||||
rol ecx, 16
|
||||
mov ebp, DWORD PTR 8[esi]
|
||||
mov edi, edx
|
||||
; R2 47
|
||||
lea ebx, DWORD PTR 3299628645[ebp*1+ebx]
|
||||
@@ -681,6 +682,6 @@ L000start:
|
||||
pop edi
|
||||
pop esi
|
||||
ret
|
||||
_md5_block_x86 ENDP
|
||||
_md5_block_asm_host_order ENDP
|
||||
_TEXT ENDS
|
||||
END
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/md5.h>
|
||||
|
||||
#ifndef MD5_LONG_LOG2
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
* 1.2.3z 0x1020311a
|
||||
* (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
|
||||
*/
|
||||
#define OPENSSL_VERSION_NUMBER 0x00903100L
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.3 23 May 1999"
|
||||
#define OPENSSL_VERSION_NUMBER 0x00903101L
|
||||
#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.3a 29 May 1999"
|
||||
#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
|
||||
|
||||
#endif /* HEADER_OPENSSLV_H */
|
||||
|
||||
@@ -102,7 +102,7 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
|
||||
rm -f asm/rx86unix.cpp *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
rm -f asm/r586unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
rm -f asm/rm86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
|
||||
@@ -97,13 +97,15 @@ dclean:
|
||||
mv -f Makefile.new $(MAKEFILE)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
|
||||
rm -f asm/sx86unix.cpp *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
sha1_one.o: ../../include/openssl/sha.h
|
||||
sha1dgst.o: ../../include/openssl/opensslconf.h
|
||||
sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
|
||||
sha1dgst.o: sha_locl.h
|
||||
sha_dgst.o: ../../include/openssl/opensslconf.h
|
||||
sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
|
||||
sha_dgst.o: sha_locl.h
|
||||
sha_one.o: ../../include/openssl/sha.h
|
||||
|
||||
@@ -216,7 +216,7 @@ void SHA1_Update(SHA_CTX *c, const register unsigned char *data,
|
||||
data+=SHA_CBLOCK;
|
||||
sha1_block(c,p=c->data,1);
|
||||
len-=SHA_CBLOCK;
|
||||
#else /* little-endian */
|
||||
#elif defined(L_ENDIAN)
|
||||
#define BE_COPY(dst,src,i) { \
|
||||
l = ((SHA_LONG *)src)[i]; \
|
||||
Endian_Reverse32(l); \
|
||||
@@ -280,7 +280,7 @@ void SHA1_Transform(SHA_CTX *c, unsigned char *b)
|
||||
memcpy(p,b,SHA_CBLOCK);
|
||||
sha1_block(c,p,1);
|
||||
return;
|
||||
#else
|
||||
#elif defined(L_ENDIAN)
|
||||
if (((unsigned long)b%sizeof(SHA_LONG)) == 0)
|
||||
{
|
||||
SHA_LONG *q;
|
||||
|
||||
@@ -211,7 +211,7 @@ void SHA_Update(SHA_CTX *c, const register unsigned char *data,
|
||||
data+=SHA_CBLOCK;
|
||||
sha_block(c,p=c->data,1);
|
||||
len-=SHA_CBLOCK;
|
||||
#else /* little-endian */
|
||||
#elif defined(L_ENDIAN)
|
||||
#define BE_COPY(dst,src,i) { \
|
||||
l = ((SHA_LONG *)src)[i]; \
|
||||
Endian_Reverse32(l); \
|
||||
@@ -275,7 +275,7 @@ void SHA_Transform(SHA_CTX *c, unsigned char *b)
|
||||
memcpy(p,b,SHA_CBLOCK);
|
||||
sha_block(c,p,1);
|
||||
return;
|
||||
#else
|
||||
#elif defined(L_ENDIAN)
|
||||
if (((unsigned long)b%sizeof(SHA_LONG)) == 0)
|
||||
{
|
||||
SHA_LONG *q;
|
||||
|
||||
@@ -59,6 +59,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
#ifdef undef
|
||||
/* one or the other needs to be defined */
|
||||
#ifndef SHA_1 /* FIPE 180-1 */
|
||||
|
||||
16
demos/bio/Makefile
Normal file
16
demos/bio/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
CC=cc
|
||||
CFLAGS= -g -I../../include
|
||||
LIBS= -L../.. ../../libssl.a ../../libcrypto.a
|
||||
EXAMPLES=saccept sconnect
|
||||
|
||||
all: $(EXAMPLES)
|
||||
|
||||
saccept: saccept.o
|
||||
$(CC) -o saccept saccept.o $(LIBS)
|
||||
|
||||
sconnect: sconnect.o
|
||||
$(CC) -o sconnect sconnect.o $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(EXAMPLES) *.o
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
|
||||
24
demos/eay/Makefile
Normal file
24
demos/eay/Makefile
Normal file
@@ -0,0 +1,24 @@
|
||||
CC=cc
|
||||
CFLAGS= -g -I../../include
|
||||
#LIBS= -L../.. -lcrypto -lssl
|
||||
LIBS= -L../.. ../../libssl.a ../../libcrypto.a
|
||||
|
||||
# the file conn.c requires a file "proxy.h" which I couldn't find...
|
||||
#EXAMPLES=base64 conn loadrsa
|
||||
EXAMPLES=base64 loadrsa
|
||||
|
||||
all: $(EXAMPLES)
|
||||
|
||||
base64: base64.o
|
||||
$(CC) -o base64 base64.o $(LIBS)
|
||||
#
|
||||
# sorry... can't find "proxy.h"
|
||||
#conn: conn.o
|
||||
# $(CC) -o conn conn.o $(LIBS)
|
||||
|
||||
loadrsa: loadrsa.o
|
||||
$(CC) -o loadrsa loadrsa.o $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(EXAMPLES) *.o
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/bio.h>
|
||||
#include "proxy.h"
|
||||
/* #include "proxy.h" */
|
||||
|
||||
extern int errno;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
CC=cc
|
||||
CFLAGS= -g -I../../include
|
||||
CFLAGS= -g -I../../include -Wall
|
||||
LIBS= -L../.. -lcrypto
|
||||
EXAMPLES=example1 example2 example3 example4
|
||||
|
||||
@@ -20,3 +20,40 @@ example4: example4.o
|
||||
clean:
|
||||
rm -f $(EXAMPLES) *.o
|
||||
|
||||
test: all
|
||||
@echo
|
||||
@echo Example 1 Demonstrates the sealing and opening APIs
|
||||
@echo Doing the encrypt side...
|
||||
./example1 <README >t.t
|
||||
@echo Doing the decrypt side...
|
||||
./example1 -d <t.t >t.2
|
||||
diff t.2 README
|
||||
rm -f t.t t.2
|
||||
@echo example1 is OK
|
||||
|
||||
@echo
|
||||
@echo Example2 Demonstrates rsa encryption and decryption
|
||||
@echo and it should just print \"This the clear text\"
|
||||
./example2
|
||||
|
||||
@echo
|
||||
@echo Example3 Demonstrates the use of symmetric block ciphers
|
||||
@echo in this case it uses EVP_des_ede3_cbc
|
||||
@echo i.e. triple DES in Cipher Block Chaining mode
|
||||
@echo Doing the encrypt side...
|
||||
./example3 ThisIsThePassword <README >t.t
|
||||
@echo Doing the decrypt side...
|
||||
./example3 -d ThisIsThePassword <t.t >t.2
|
||||
diff t.2 README
|
||||
rm -f t.t t.2
|
||||
@echo example3 is OK
|
||||
|
||||
@echo
|
||||
@echo Example4 Demonstrates base64 encoding and decoding
|
||||
@echo Doing the encrypt side...
|
||||
./example4 <README >t.t
|
||||
@echo Doing the decrypt side...
|
||||
./example4 -d <t.t >t.2
|
||||
diff t.2 README
|
||||
rm -f t.t t.2
|
||||
@echo example4 is OK
|
||||
|
||||
@@ -33,7 +33,6 @@ int main()
|
||||
EVP_PKEY *pubKey;
|
||||
EVP_PKEY *privKey;
|
||||
int len;
|
||||
FILE *fp;
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
|
||||
@@ -72,6 +71,5 @@ int main()
|
||||
EVP_PKEY_free(pubKey);
|
||||
free(buf);
|
||||
free(buf2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <evp.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#define STDIN 0
|
||||
#define STDOUT 1
|
||||
@@ -47,9 +48,9 @@ void do_cipher(char *pw, int operation)
|
||||
{
|
||||
char buf[BUFLEN];
|
||||
char ebuf[BUFLEN + 8];
|
||||
unsigned int ebuflen, rc;
|
||||
unsigned int ebuflen; /* rc; */
|
||||
unsigned char iv[EVP_MAX_IV_LENGTH], key[EVP_MAX_KEY_LENGTH];
|
||||
unsigned int ekeylen, net_ekeylen;
|
||||
/* unsigned int ekeylen, net_ekeylen; */
|
||||
EVP_CIPHER_CTX ectx;
|
||||
|
||||
memcpy(iv, INIT_VECTOR, sizeof(iv));
|
||||
@@ -82,5 +83,3 @@ void do_cipher(char *pw, int operation)
|
||||
|
||||
write(STDOUT, ebuf, ebuflen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <evp.h>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#define STDIN 0
|
||||
#define STDOUT 1
|
||||
@@ -44,7 +45,7 @@ void do_encode()
|
||||
{
|
||||
char buf[BUFLEN];
|
||||
char ebuf[BUFLEN+24];
|
||||
unsigned int ebuflen, rc;
|
||||
unsigned int ebuflen;
|
||||
EVP_ENCODE_CTX ectx;
|
||||
|
||||
EVP_EncodeInit(&ectx);
|
||||
@@ -78,7 +79,7 @@ void do_decode()
|
||||
{
|
||||
char buf[BUFLEN];
|
||||
char ebuf[BUFLEN+24];
|
||||
unsigned int ebuflen, rc;
|
||||
unsigned int ebuflen;
|
||||
EVP_ENCODE_CTX ectx;
|
||||
|
||||
EVP_DecodeInit(&ectx);
|
||||
|
||||
20
demos/prime/Makefile
Normal file
20
demos/prime/Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
CC=cc
|
||||
CFLAGS= -g -I../../include -Wall
|
||||
LIBS= -L../.. -lcrypto
|
||||
EXAMPLES=prime
|
||||
|
||||
all: $(EXAMPLES)
|
||||
|
||||
prime: prime.o
|
||||
$(CC) -o prime prime.o $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(EXAMPLES) *.o
|
||||
|
||||
test: all
|
||||
@echo Test creating a 128-bit prime
|
||||
./prime 128
|
||||
@echo Test creating a 256-bit prime
|
||||
./prime 256
|
||||
@echo Test creating a 512-bit prime
|
||||
./prime 512
|
||||
@@ -57,6 +57,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <openssl/bn.h>
|
||||
|
||||
void callback(type,num)
|
||||
@@ -87,8 +88,8 @@ char *argv[];
|
||||
}
|
||||
|
||||
fprintf(stderr,"generate a strong prime\n");
|
||||
rand=BN_generate_prime(num,1,NULL,NULL,callback);
|
||||
/* change the second parameter to 1 for a strong prime */
|
||||
rand=BN_generate_prime(NULL,num,1,NULL,NULL,callback,NULL);
|
||||
/* change the third parameter to 1 for a strong prime */
|
||||
fprintf(stderr,"\n");
|
||||
|
||||
BN_print_fp(stdout,rand);
|
||||
|
||||
15
demos/sign/Makefile
Normal file
15
demos/sign/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
CC=cc
|
||||
CFLAGS= -g -I../../include -Wall
|
||||
LIBS= -L../.. -lcrypto
|
||||
EXAMPLES=sign
|
||||
|
||||
all: $(EXAMPLES)
|
||||
|
||||
sign: sign.o
|
||||
$(CC) -o sign sign.o $(LIBS)
|
||||
|
||||
clean:
|
||||
rm -f $(EXAMPLES) *.o
|
||||
|
||||
test: all
|
||||
./sign
|
||||
@@ -70,7 +70,7 @@
|
||||
#include <openssl/pem.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
void main ()
|
||||
int main ()
|
||||
{
|
||||
int err;
|
||||
int sig_len;
|
||||
@@ -134,4 +134,5 @@ void main ()
|
||||
if (err != 1) { ERR_print_errors_fp (stderr); exit (1); }
|
||||
EVP_PKEY_free (pkey);
|
||||
printf ("Signature Verified Ok.\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
/* cli.cpp - Minimal ssleay client for Unix
|
||||
30.9.1996, Sampo Kellomaki <sampo@iki.fi> */
|
||||
|
||||
/* mangled to work with SSLeay-0.9.0b and OpenSSL 0.9.2b
|
||||
Simplified to be even more minimal
|
||||
12/98 - 4/99 Wade Scholine <wades@mail.cybg.com> */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
#include <errno.h>
|
||||
@@ -17,6 +21,7 @@
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
|
||||
#define CHK_NULL(x) if ((x)==NULL) exit (1)
|
||||
#define CHK_ERR(err,s) if ((err)==-1) { perror(s); exit(1); }
|
||||
#define CHK_SSL(err) if ((err)==-1) { ERR_print_errors_fp(stderr); exit(2); }
|
||||
@@ -31,9 +36,14 @@ void main ()
|
||||
X509* server_cert;
|
||||
char* str;
|
||||
char buf [4096];
|
||||
SSL_METHOD *meth;
|
||||
|
||||
SSLeay_add_ssl_algorithms();
|
||||
meth = SSLv2_client_method();
|
||||
SSL_load_error_strings();
|
||||
ctx = SSL_CTX_new (); CHK_NULL(ctx);
|
||||
ctx = SSL_CTX_new (meth); CHK_NULL(ctx);
|
||||
|
||||
CHK_SSL(err);
|
||||
|
||||
/* ----------------------------------------------- */
|
||||
/* Create a socket and connect to server using normal socket calls. */
|
||||
@@ -67,12 +77,12 @@ void main ()
|
||||
server_cert = SSL_get_peer_certificate (ssl); CHK_NULL(server_cert);
|
||||
printf ("Server certificate:\n");
|
||||
|
||||
str = X509_NAME_oneline (X509_get_subject_name (server_cert));
|
||||
str = X509_NAME_oneline (X509_get_subject_name (server_cert),0,0);
|
||||
CHK_NULL(str);
|
||||
printf ("\t subject: %s\n", str);
|
||||
Free (str);
|
||||
|
||||
str = X509_NAME_oneline (X509_get_issuer_name (server_cert));
|
||||
str = X509_NAME_oneline (X509_get_issuer_name (server_cert),0,0);
|
||||
CHK_NULL(str);
|
||||
printf ("\t issuer: %s\n", str);
|
||||
Free (str);
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
/* serv.cpp - Minimal ssleay server for Unix
|
||||
30.9.1996, Sampo Kellomaki <sampo@iki.fi> */
|
||||
|
||||
|
||||
/* mangled to work with SSLeay-0.9.0b and OpenSSL 0.9.2b
|
||||
Simplified to be even more minimal
|
||||
12/98 - 4/99 Wade Scholine <wades@mail.cybg.com> */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <memory.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
@@ -17,9 +24,13 @@
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
#define HOME "/usr/users/sampo/sibs/tim/"
|
||||
#define CERTF HOME "plain-cert.pem"
|
||||
#define KEYF HOME "plain-key.pem"
|
||||
|
||||
/* define HOME to be dir for key and cert files... */
|
||||
#define HOME "./"
|
||||
/* Make these what you want for cert & key files */
|
||||
#define CERTF HOME "foo-cert.pem"
|
||||
#define KEYF HOME "foo-cert.pem"
|
||||
|
||||
|
||||
#define CHK_NULL(x) if ((x)==NULL) exit (1)
|
||||
#define CHK_ERR(err,s) if ((err)==-1) { perror(s); exit(1); }
|
||||
@@ -32,24 +43,39 @@ void main ()
|
||||
int sd;
|
||||
struct sockaddr_in sa_serv;
|
||||
struct sockaddr_in sa_cli;
|
||||
int client_len;
|
||||
size_t client_len;
|
||||
SSL_CTX* ctx;
|
||||
SSL* ssl;
|
||||
X509* client_cert;
|
||||
char* str;
|
||||
char buf [4096];
|
||||
|
||||
SSL_METHOD *meth;
|
||||
|
||||
/* SSL preliminaries. We keep the certificate and key with the context. */
|
||||
|
||||
SSL_load_error_strings();
|
||||
ctx = SSL_CTX_new (); CHK_NULL(ctx);
|
||||
|
||||
err = SSL_CTX_use_RSAPrivateKey_file (ctx, KEYF, SSL_FILETYPE_PEM);
|
||||
CHK_SSL(err);
|
||||
|
||||
err = SSL_CTX_use_certificate_file (ctx, CERTF, SSL_FILETYPE_PEM);
|
||||
CHK_SSL(err);
|
||||
SSLeay_add_ssl_algorithms();
|
||||
meth = SSLv23_server_method();
|
||||
ctx = SSL_CTX_new (meth);
|
||||
if (!ctx) {
|
||||
ERR_print_errors_fp(stderr);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
if (SSL_CTX_use_certificate_file(ctx, CERTF, SSL_FILETYPE_PEM) <= 0) {
|
||||
ERR_print_errors_fp(stderr);
|
||||
exit(3);
|
||||
}
|
||||
if (SSL_CTX_use_PrivateKey_file(ctx, KEYF, SSL_FILETYPE_PEM) <= 0) {
|
||||
ERR_print_errors_fp(stderr);
|
||||
exit(4);
|
||||
}
|
||||
|
||||
if (!SSL_CTX_check_private_key(ctx)) {
|
||||
fprintf(stderr,"Private key does not match the certificate public key\n");
|
||||
exit(5);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------- */
|
||||
/* Prepare TCP socket for receiving connections */
|
||||
|
||||
@@ -92,12 +118,12 @@ void main ()
|
||||
if (client_cert != NULL) {
|
||||
printf ("Client certificate:\n");
|
||||
|
||||
str = X509_NAME_oneline (X509_get_subject_name (client_cert));
|
||||
str = X509_NAME_oneline (X509_get_subject_name (client_cert), 0, 0);
|
||||
CHK_NULL(str);
|
||||
printf ("\t subject: %s\n", str);
|
||||
Free (str);
|
||||
|
||||
str = X509_NAME_oneline (X509_get_issuer_name (client_cert));
|
||||
str = X509_NAME_oneline (X509_get_issuer_name (client_cert), 0, 0);
|
||||
CHK_NULL(str);
|
||||
printf ("\t issuer: %s\n", str);
|
||||
Free (str);
|
||||
|
||||
@@ -47,6 +47,7 @@ $! VAXC For VAX C.
|
||||
$! DECC For DEC C.
|
||||
$! GNUC For GNU C.
|
||||
$! LINK To only link the programs from existing object files.
|
||||
$! (not yet implemented)
|
||||
$!
|
||||
$! If you don't speficy a compiler, it will try to determine which
|
||||
$! "C" compiler to use.
|
||||
@@ -669,7 +670,7 @@ $ ELSE
|
||||
$!
|
||||
$! Check To See If The User Entered A Valid Paramter.
|
||||
$!
|
||||
$ IF (P4.EQS."VAXC").OR.(P4.EQS."DECC").OR.(P4.EQS."GNUC").OR.(P4.EQS."LINK")
|
||||
$ IF (P4.EQS."VAXC").OR.(P4.EQS."DECC").OR.(P4.EQS."GNUC")!.OR.(P4.EQS."LINK")
|
||||
$ THEN
|
||||
$!
|
||||
$! Check To See If The User Wanted To Just LINK.
|
||||
|
||||
Reference in New Issue
Block a user