From: Richard Levitte Date: Tue, 30 Mar 2004 16:58:44 +0000 (+0000) Subject: Recent changes from 0.9.7-stable X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8797be2dce84be0808c5cf520e67f48ccea6462c;p=oweals%2Fopenssl.git Recent changes from 0.9.7-stable Since we have changed from using Makefile instead of Makefile.ssl, we need to complete the work by changing all references. make update --- diff --git a/FAQ b/FAQ index 0b40039ef8..84b12afb11 100644 --- a/FAQ +++ b/FAQ @@ -460,7 +460,7 @@ get the best result from OpenSSL. A bit more complicated solution is the following: ----- snip:start ----- - make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile.ssl | \ + make DIRS=crypto SDIRS=sha "`grep '^CFLAG=' Makefile | \ sed -e 's/ -O[0-9] / -O0 /'`" rm `ls crypto/*.o crypto/sha/*.o | grep -v 'sha_dgst\.o'` make diff --git a/INSTALL b/INSTALL index 1c3f3c3fe9..503474f2e4 100644 --- a/INSTALL +++ b/INSTALL @@ -123,7 +123,7 @@ generic configurations "cc" or "gcc" should usually work on 32 bit systems. - Configure creates the file Makefile.ssl from Makefile.org and + Configure creates the file Makefile from Makefile.org and defines various macros in crypto/opensslconf.h (generated from crypto/opensslconf.h.in). @@ -159,7 +159,7 @@ the failure that isn't a problem in OpenSSL itself (like a missing or malfunctioning bc). If it is a problem with OpenSSL itself, try removing any compiler optimization flags from the CFLAG line - in Makefile.ssl and run "make clean; make". Please send a bug + in Makefile and run "make clean; make". Please send a bug report to , including the output of "make report" in order to be added to the request tracker at http://www.openssl.org/support/rt2.html. diff --git a/PROBLEMS b/PROBLEMS index 85e96a5ebe..d6731b1b13 100644 --- a/PROBLEMS +++ b/PROBLEMS @@ -12,8 +12,8 @@ along the whole library path before it bothers looking for .a libraries. This means that -L switches won't matter unless OpenSSL is built with shared library support. -The workaround may be to change the following lines in apps/Makefile.ssl and -test/Makefile.ssl: +The workaround may be to change the following lines in apps/Makefile and +test/Makefile: LIBCRYPTO=-L.. -lcrypto LIBSSL=-L.. -lssl diff --git a/apps/Makefile b/apps/Makefile index 1a2f1fd2a5..166fe64603 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -636,24 +636,25 @@ openssl.o: ../include/openssl/des.h ../include/openssl/des_old.h openssl.o: ../include/openssl/dh.h ../include/openssl/dsa.h openssl.o: ../include/openssl/e_os2.h ../include/openssl/engine.h openssl.o: ../include/openssl/err.h ../include/openssl/evp.h -openssl.o: ../include/openssl/idea.h ../include/openssl/kssl.h -openssl.o: ../include/openssl/lhash.h ../include/openssl/md2.h -openssl.o: ../include/openssl/md4.h ../include/openssl/md5.h -openssl.o: ../include/openssl/mdc2.h ../include/openssl/obj_mac.h -openssl.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h -openssl.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h -openssl.o: ../include/openssl/pem.h ../include/openssl/pem2.h -openssl.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h -openssl.o: ../include/openssl/rc2.h ../include/openssl/rc4.h -openssl.o: ../include/openssl/rc5.h ../include/openssl/ripemd.h -openssl.o: ../include/openssl/rsa.h ../include/openssl/safestack.h -openssl.o: ../include/openssl/sha.h ../include/openssl/ssl.h -openssl.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h -openssl.o: ../include/openssl/ssl3.h ../include/openssl/stack.h -openssl.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h -openssl.o: ../include/openssl/txt_db.h ../include/openssl/ui.h -openssl.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h -openssl.o: ../include/openssl/x509_vfy.h apps.h openssl.c progs.h s_apps.h +openssl.o: ../include/openssl/fips.h ../include/openssl/idea.h +openssl.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +openssl.o: ../include/openssl/md2.h ../include/openssl/md4.h +openssl.o: ../include/openssl/md5.h ../include/openssl/mdc2.h +openssl.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +openssl.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +openssl.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +openssl.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +openssl.o: ../include/openssl/rand.h ../include/openssl/rc2.h +openssl.o: ../include/openssl/rc4.h ../include/openssl/rc5.h +openssl.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h +openssl.o: ../include/openssl/safestack.h ../include/openssl/sha.h +openssl.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +openssl.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +openssl.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +openssl.o: ../include/openssl/tls1.h ../include/openssl/txt_db.h +openssl.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h +openssl.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h apps.h +openssl.o: openssl.c progs.h s_apps.h passwd.o: ../e_os.h ../include/openssl/aes.h ../include/openssl/asn1.h passwd.o: ../include/openssl/bio.h ../include/openssl/blowfish.h passwd.o: ../include/openssl/bn.h ../include/openssl/buffer.h diff --git a/apps/apps.c b/apps/apps.c index ec5f5c1c90..0f15e27cd0 100644 --- a/apps/apps.c +++ b/apps/apps.c @@ -330,41 +330,19 @@ void program_name(char *in, char *out, int size) #endif #endif -#ifdef OPENSSL_SYS_WIN32 -int WIN32_rename(char *from, char *to) - { -#ifndef OPENSSL_SYS_WINCE - /* Windows rename gives an error if 'to' exists, so delete it - * first and ignore file not found errror - */ - if((remove(to) != 0) && (errno != ENOENT)) - return -1; -#undef rename - return rename(from, to); -#else - /* convert strings to UNICODE */ +#ifdef OPENSSL_SYS_VMS +int VMS_strcasecmp(const char *str1, const char *str2) { - BOOL result = FALSE; - WCHAR* wfrom; - WCHAR* wto; - int i; - wfrom = malloc((strlen(from)+1)*2); - wto = malloc((strlen(to)+1)*2); - if (wfrom != NULL && wto != NULL) + while (*str1 && *str2) { - for (i=0; i<(int)strlen(from)+1; i++) - wfrom[i] = (short)from[i]; - for (i=0; i<(int)strlen(to)+1; i++) - wto[i] = (short)to[i]; - result = MoveFile(wfrom, wto); + int res = toupper(*str1) - toupper(*str2); + if (res) return res < 0 ? -1 : 1; } - if (wfrom != NULL) - free(wfrom); - if (wto != NULL) - free(wto); - return result; - } -#endif + if (*str1) + return 1; + if (*str2) + return -1; + return 0; } #endif @@ -1950,3 +1928,42 @@ void free_index(CA_DB *db) OPENSSL_free(db); } } + +/* This code MUST COME AFTER anything that uses rename() */ +#ifdef OPENSSL_SYS_WIN32 +int WIN32_rename(char *from, char *to) + { +#ifndef OPENSSL_SYS_WINCE + /* Windows rename gives an error if 'to' exists, so delete it + * first and ignore file not found errror + */ + if((remove(to) != 0) && (errno != ENOENT)) + return -1; +#undef rename + return rename(from, to); +#else + /* convert strings to UNICODE */ + { + BOOL result = FALSE; + WCHAR* wfrom; + WCHAR* wto; + int i; + wfrom = malloc((strlen(from)+1)*2); + wto = malloc((strlen(to)+1)*2); + if (wfrom != NULL && wto != NULL) + { + for (i=0; i<(int)strlen(from)+1; i++) + wfrom[i] = (short)from[i]; + for (i=0; i<(int)strlen(to)+1; i++) + wto[i] = (short)to[i]; + result = MoveFile(wfrom, wto); + } + if (wfrom != NULL) + free(wfrom); + if (wto != NULL) + free(wto); + return result; + } +#endif + } +#endif diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 554474733f..4fe38ae198 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -214,13 +214,14 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) b->ptr=(char *)ptr; b->init=1; { - int fd = fileno((FILE*)ptr); #if defined(OPENSSL_SYS_WINDOWS) + int fd = fileno((FILE*)ptr); if (num & BIO_FP_TEXT) _setmode(fd,_O_TEXT); else _setmode(fd,_O_BINARY); #elif defined(OPENSSL_SYS_MSDOS) + int fd = fileno((FILE*)ptr); /* Set correct text/binary mode */ if (num & BIO_FP_TEXT) _setmode(fd,_O_TEXT); @@ -236,6 +237,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) _setmode(fd,_O_BINARY); } #elif defined(OPENSSL_SYS_OS2) + int fd = fileno((FILE*)ptr); if (num & BIO_FP_TEXT) setmode(fd, O_TEXT); else diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c index 3c8c540387..28cd3339da 100644 --- a/crypto/bn/bntest.c +++ b/crypto/bn/bntest.c @@ -232,7 +232,7 @@ int main(int argc, char *argv[]) EXIT(0); err: BIO_puts(out,"1\n"); /* make sure the Perl script fed by bc notices - * the failure, see test_bn in test/Makefile.ssl*/ + * the failure, see test_bn in test/Makefile */ BIO_flush(out); ERR_load_crypto_strings(); ERR_print_errors_fp(stderr); diff --git a/crypto/des/FILES0 b/crypto/des/FILES0 index 4c7ea2de7a..1c2e1f75b9 100644 --- a/crypto/des/FILES0 +++ b/crypto/des/FILES0 @@ -8,7 +8,7 @@ README - What this package is. VERSION - Which version this is and what was changed. KERBEROS - Kerberos version 4 notes. Makefile.PL - An old makefile to build with perl5, not current. -Makefile.ssl - The SSLeay makefile +Makefile - The SSLeay makefile Makefile.uni - The normal unix makefile. GNUmakefile - The makefile for use with glibc. makefile.bc - A Borland C makefile diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index f5d0843d13..c7fba496a8 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -166,6 +166,7 @@ int RAND_write_file(const char *file) } #if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) + { /* For some reason Win32 can't write to files created this way */ /* chmod(..., 0600) is too late to protect the file, @@ -173,6 +174,7 @@ int RAND_write_file(const char *file) int fd = open(file, O_CREAT, 0600); if (fd != -1) out = fdopen(fd, "wb"); + } #endif if (out == NULL) out = fopen(file,"wb"); diff --git a/doc/crypto/RSA_public_encrypt.pod b/doc/crypto/RSA_public_encrypt.pod index d53e19d2b7..ab0fe3b2cd 100644 --- a/doc/crypto/RSA_public_encrypt.pod +++ b/doc/crypto/RSA_public_encrypt.pod @@ -47,9 +47,10 @@ Encrypting user data directly with RSA is insecure. =back B must be less than RSA_size(B) - 11 for the PKCS #1 v1.5 -based padding modes, and less than RSA_size(B) - 41 for -RSA_PKCS1_OAEP_PADDING. The random number generator must be seeded -prior to calling RSA_public_encrypt(). +based padding modes, less than RSA_size(B) - 41 for +RSA_PKCS1_OAEP_PADDING and exactly RSA_size(B) for RSA_NO_PADDING. +The random number generator must be seeded prior to calling +RSA_public_encrypt(). RSA_private_decrypt() decrypts the B bytes at B using the private key B and stores the plaintext in B. B must point diff --git a/fips/rand/Makefile b/fips/rand/Makefile index dfb7a10de8..af359788b6 100644 --- a/fips/rand/Makefile +++ b/fips/rand/Makefile @@ -90,10 +90,11 @@ fips_rand.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h fips_rand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h fips_rand.o: ../../include/openssl/ui.h ../../include/openssl/ui_compat.h fips_rand.o: fips_rand.c -fips_randtest.o: ../../e_os.h ../../include/openssl/crypto.h -fips_randtest.o: ../../include/openssl/des.h ../../include/openssl/des_old.h -fips_randtest.o: ../../include/openssl/e_os2.h -fips_randtest.o: ../../include/openssl/fips_rand.h +fips_randtest.o: ../../e_os.h ../../include/openssl/bio.h +fips_randtest.o: ../../include/openssl/crypto.h ../../include/openssl/des.h +fips_randtest.o: ../../include/openssl/des_old.h ../../include/openssl/e_os2.h +fips_randtest.o: ../../include/openssl/err.h ../../include/openssl/fips_rand.h +fips_randtest.o: ../../include/openssl/lhash.h fips_randtest.o: ../../include/openssl/opensslconf.h fips_randtest.o: ../../include/openssl/opensslv.h fips_randtest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h diff --git a/shlib/hpux10-cc.sh b/shlib/hpux10-cc.sh index 81eb9d4cab..fcadda827d 100644 --- a/shlib/hpux10-cc.sh +++ b/shlib/hpux10-cc.sh @@ -74,9 +74,9 @@ make clean # Hack the Makefiles to pick up the dynamic libraries during linking # -sed 's/^PEX_LIBS=.*$/PEX_LIBS=-L\/usr\/local\/ssl\/lib/' Makefile.ssl >xxx; mv xxx Makefile.ssl -sed 's/-L\.\.//' apps/Makefile.ssl >xxx; mv xxx apps/Makefile.ssl -sed 's/-L\.\.//' test/Makefile.ssl >xxx; mv xxx test/Makefile.ssl +sed 's/^PEX_LIBS=.*$/PEX_LIBS=-L\/usr\/local\/ssl\/lib/' Makefile >xxx; mv xxx Makefile.ssl +sed 's/-L\.\.//' apps/Makefile >xxx; mv xxx apps/Makefile +sed 's/-L\.\.//' test/Makefile >xxx; mv xxx test/Makefile # Build the static libs and the executables in one make. make # Install everything diff --git a/test/Makefile b/test/Makefile index 672b4f95b2..593e37ea44 100644 --- a/test/Makefile +++ b/test/Makefile @@ -741,9 +741,10 @@ fips_dsatest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h fips_dsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h fips_dsatest.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h fips_dsatest.o: fips_dsatest.c -fips_randtest.o: ../e_os.h ../include/openssl/crypto.h ../include/openssl/des.h -fips_randtest.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h -fips_randtest.o: ../include/openssl/fips_rand.h +fips_randtest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h +fips_randtest.o: ../include/openssl/des.h ../include/openssl/des_old.h +fips_randtest.o: ../include/openssl/e_os2.h ../include/openssl/err.h +fips_randtest.o: ../include/openssl/fips_rand.h ../include/openssl/lhash.h fips_randtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h fips_randtest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h fips_randtest.o: ../include/openssl/safestack.h ../include/openssl/stack.h diff --git a/test/bctest b/test/bctest index bdb3218f7a..e81fc0733a 100755 --- a/test/bctest +++ b/test/bctest @@ -1,6 +1,6 @@ #!/bin/sh -# This script is used by test/Makefile.ssl to check whether a sane 'bc' +# This script is used by test/Makefile to check whether a sane 'bc' # is installed. # ('make test_bn' should not try to run 'bc' if it does not exist or if # it is a broken 'bc' version that is known to cause trouble.) diff --git a/test/testenc b/test/testenc index 0656c7f525..70505f0222 100644 --- a/test/testenc +++ b/test/testenc @@ -1,6 +1,6 @@ #!/bin/sh -testsrc=Makefile.ssl +testsrc=Makefile test=./p cmd=../apps/openssl diff --git a/util/cygwin.sh b/util/cygwin.sh index 930f766b4f..f93b2a0db6 100755 --- a/util/cygwin.sh +++ b/util/cygwin.sh @@ -21,11 +21,11 @@ function cleanup() function get_openssl_version() { - eval `grep '^VERSION=' Makefile.ssl` + eval `grep '^VERSION=' Makefile` if [ -z "${VERSION}" ] then - echo "Error: Couldn't retrieve OpenSSL version from Makefile.ssl." - echo " Check value of variable VERSION in Makefile.ssl." + echo "Error: Couldn't retrieve OpenSSL version from Makefile." + echo " Check value of variable VERSION in Makefile." exit 1 fi } diff --git a/util/domd b/util/domd index 49310bbdd1..5610521f0b 100755 --- a/util/domd +++ b/util/domd @@ -11,7 +11,7 @@ if [ "$1" = "-MD" ]; then fi if [ "$MAKEDEPEND" = "" ]; then MAKEDEPEND=makedepend; fi -cp Makefile.ssl Makefile.save +cp Makefile Makefile.save # fake the presence of Kerberos touch $TOP/krb5.h if [ "$MAKEDEPEND" = "gcc" ]; then @@ -20,15 +20,15 @@ if [ "$MAKEDEPEND" = "gcc" ]; then if [ "$1" != "--" ]; then args="$args $1"; fi shift done - sed -e '/^# DO NOT DELETE.*/,$d' < Makefile.ssl > Makefile.tmp + sed -e '/^# DO NOT DELETE.*/,$d' < Makefile > Makefile.tmp echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp gcc -D OPENSSL_DOING_MAKEDEPEND -M $args >> Makefile.tmp ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new rm -f Makefile.tmp else - ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND -f Makefile.ssl $@ - ${PERL} $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new + ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND -f Makefile $@ + ${PERL} $TOP/util/clean-depend.pl < Makefile > Makefile.new fi -mv Makefile.new Makefile.ssl +mv Makefile.new Makefile # unfake the presence of Kerberos rm $TOP/krb5.h diff --git a/util/extract-names.pl b/util/extract-names.pl index 744a8e2324..35bd6ed843 100644 --- a/util/extract-names.pl +++ b/util/extract-names.pl @@ -9,9 +9,11 @@ while() { } elsif ($name) { if (/ - /) { s/ - .*//; - s/,[ \t]+/,/g; - s/^[ \t]+//g; - s/[ \t]+$//g; + s/,\s+/,/g; + s/\s+,/,/g; + s/^\s+//g; + s/\s+$//g; + s/\s/_/g; push @words, split ','; } } diff --git a/util/fixNT.sh b/util/fixNT.sh index ce4f19299b..ab9e766b86 100755 --- a/util/fixNT.sh +++ b/util/fixNT.sh @@ -3,12 +3,12 @@ # clean up the mess that NT makes of my source tree # -if [ -f makefile.ssl -a ! -f Makefile.ssl ]; then - /bin/mv makefile.ssl Makefile.ssl +if [ -f makefile -a ! -f Makefile ]; then + /bin/mv makefile Makefile fi chmod +x Configure util/* echo cleaning /bin/rm -f `find . -name '*.$$$' -print` 2>/dev/null >/dev/null echo 'removing those damn ^M' perl -pi -e 's/\015//' `find . -type 'f' -print |grep -v '.obj$' |grep -v '.der$' |grep -v '.gz'` -make -f Makefile.ssl links +make -f Makefile links diff --git a/util/mk1mf.pl b/util/mk1mf.pl index 44c07550c6..c1813a2c4a 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -10,7 +10,7 @@ $OPTIONS=""; $ssl_version=""; $banner="\t\@echo Building OpenSSL"; -open(IN,") { $ssl_version=$1 if (/^VERSION=(.*)$/); $OPTIONS=$1 if (/^OPTIONS=(.*)$/); @@ -18,7 +18,7 @@ while() { } close(IN); -die "Makefile.ssl is not the toplevel Makefile!\n" if $ssl_version eq ""; +die "Makefile is not the toplevel Makefile!\n" if $ssl_version eq ""; $infile="MINFO"; @@ -640,7 +640,7 @@ if ($platform eq "linux-elf") { print <<"EOF"; # Generate perlasm output files %.cpp: - (cd \$(\@D)/..; PERL=perl make -f Makefile.ssl asm/\$(\@F)) + (cd \$(\@D)/..; PERL=perl make -f Makefile asm/\$(\@F)) EOF } print "###################################################################\n"; diff --git a/util/mkdef.pl b/util/mkdef.pl index 01a1bfda19..372d40cc53 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -94,7 +94,7 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "FP_API", "STDIO", "SOCK", "KRB5", "ENGINE", "HW" ); my $options=""; -open(IN,") { $options=$1 if (/^OPTIONS=(.*)$/); } @@ -1119,7 +1119,7 @@ sub print_test_file sub get_version { local *MF; my $v = '?'; - open MF, 'Makefile.ssl' or return $v; + open MF, 'Makefile' or return $v; while () { $v = $1, last if /^VERSION=(.*?)\s*$/; } diff --git a/util/mkfiles.pl b/util/mkfiles.pl index 888ee32beb..2ab548e68c 100755 --- a/util/mkfiles.pl +++ b/util/mkfiles.pl @@ -64,7 +64,7 @@ my @dirs = ( ); foreach (@dirs) { - &files_dir ($_, "Makefile.ssl"); + &files_dir ($_, "Makefile"); } exit(0); diff --git a/util/pod2mantest b/util/pod2mantest index 412ca8d6d8..384e683df4 100755 --- a/util/pod2mantest +++ b/util/pod2mantest @@ -1,6 +1,6 @@ #!/bin/sh -# This script is used by test/Makefile.ssl to check whether a sane 'pod2man' +# This script is used by test/Makefile to check whether a sane 'pod2man' # is installed. # ('make install' should not try to run 'pod2man' if it does not exist or if # it is a broken 'pod2man' version that is known to cause trouble. if we find diff --git a/util/selftest.pl b/util/selftest.pl index 276b81183d..e9d5aa8938 100644 --- a/util/selftest.pl +++ b/util/selftest.pl @@ -34,9 +34,9 @@ foreach $_ (split("\n",$c)) { $platform0=$1 if (/Configuring for (.*)$/); } -system "sh config" if (! -f "Makefile.ssl"); +system "sh config" if (! -f "Makefile"); -if (open(IN,") { $version=$1 if (/^VERSION=(.*)$/); $platform=$1 if (/^PLATFORM=(.*)$/);