From 9c8fd367c4a9af4ec9f8b4075d8126ceddce1cd9 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 15 Nov 2002 11:19:28 +0000 Subject: [PATCH] (almost) recent changes from 0.9.6-stable. --- CHANGES | 4 +++ Configure | 34 ++++++++++++++----- FAQ | 14 ++++++++ MacOS/GetHTTPS.src/MacSocket.cpp | 4 +-- MacOS/GetHTTPS.src/MacSocket.h | 2 +- Makefile.org | 4 +++ TABLE | 56 +++++++++++++++++++++++++++++--- config | 5 +++ crypto/conf/conf_def.c | 7 ++-- crypto/evp/c_allc.c | 4 --- crypto/evp/c_alld.c | 4 --- crypto/rand/rand_win.c | 18 ++++++++-- crypto/rand/randfile.c | 3 +- doc/ssl/ssl.pod | 2 +- ms/testenc.bat | 4 +-- ms/testpem.bat | 2 +- ms/testss.bat | 2 +- test/Makefile.ssl | 9 ++++- test/dummytest.c | 2 +- util/cygwin.sh | 2 ++ util/libeay.num | 6 ++-- 21 files changed, 148 insertions(+), 40 deletions(-) diff --git a/CHANGES b/CHANGES index 0adfcaa970..cabad0f066 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,10 @@ Changes between 0.9.6g and 0.9.6h [xx XXX xxxx] + *) Change the default configuration reader to deal with last line not + being properly terminated. + [Richard Levitte] + *) Change X509_NAME_cmp() so it applies the special rules on handling DN values that are of type PrintableString, as well as RDNs of type emailAddress where the value has the type ia5String. diff --git a/Configure b/Configure index 246ab0acca..bcb61e1ed5 100755 --- a/Configure +++ b/Configure @@ -132,7 +132,7 @@ my %table=( "debug-bodo", "gcc:-DL_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -DBIO_PAIR_DEBUG -g -m486 -pedantic -Wshadow -Wall::-D_REENTRANT::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "debug-ulf", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", "debug-steve", "gcc:-DL_ENDIAN -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG_ALL -DPEDANTIC -g -O2 -m486 -pedantic -Wall -Werror -Wshadow -pipe::-D_REENTRANT::${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}", -"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn", +"debug-levitte-linux-elf","gcc:-DUSE_ALLOCATING_PRINT -DRL_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DNO_ASM -DL_ENDIAN -DTERMIO -D_POSIX_SOURCE -ggdb -g3 -m486 -pedantic -ansi -Wall -Wshadow -Wid-clash-31 -pipe::-D_REENTRANT:-ldl:::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", "dist", "cc:-O::(unknown):::::", # Basic configs that should work on any (32 and less bit) box @@ -405,7 +405,7 @@ my %table=( "aix-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR:::", "aix-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR:::", "aix43-cc", "cc:-O -DAIX -DB_ENDIAN -qmaxmem=16384::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:", -"aix43-gcc", "gcc:-O3 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:", +"aix43-gcc", "gcc:-O1 -DAIX -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR::::::::::dlfcn:", # # Cray T90 and similar (SDSC) @@ -487,7 +487,7 @@ my %table=( # Cygwin "Cygwin-pre1.3", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -m486 -Wall::(unknown)::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32", -"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -m486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32:cygwin-shared:::.dll", +"Cygwin", "gcc:-DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O2 -march=486 -Wall::::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}::::::::::win32:cygwin-shared:::.dll", # Ultrix from Bernhard Simon "ultrix-cc","cc:-std1 -O -Olimit 1000 -DL_ENDIAN::(unknown)::::::", @@ -505,12 +505,18 @@ my %table=( "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown)::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", "darwin-ppc-cc","cc:-O3 -D_DARWIN -DB_ENDIAN -fno-common::-D_REENTRANT::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::::::::::darwin-shared:-fPIC::.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +##### A/UX +"aux3-gcc","gcc:-O2 -DTERMIO::(unknown):-lbsd:RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:::", + ##### Sony NEWS-OS 4.x "newsos4-gcc","gcc:-O -DB_ENDIAN -DNEWS4::(unknown):-lmld -liberty:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::::", ##### VxWorks for various targets "vxworks-ppc405","ccppc:-g -msoft-float -mlongcall -DVXWORKS -DCPU=PPC405 -I\$(WIND_BASE)/target/h:::-r:::::", +##### Compaq Non-Stop Kernel (Tandem) +"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown)::THIRTY_TWO_BIT:::", + ); my @WinTargets=qw(VC-NT VC-WIN32 VC-WIN16 VC-W31-16 VC-W31-32 VC-MSDOS BC-32 @@ -587,6 +593,7 @@ my $libs; my $target; my $options; my $symlink; +my $make_depend=0; my @argvcopy=@ARGV; my $argvstring=""; @@ -1210,11 +1217,13 @@ if($IsWindows) { EOF close(OUT); } else { - (system "make -f Makefile.ssl PERL=\'$perl\' links") == 0 or exit $? - if $symlink; - ### (system 'make depend') == 0 or exit $? if $depflags ne ""; - # Run "make depend" manually if you want to be able to delete - # the source code files of ciphers you left out. + my $make_command = "make -f Makefile.ssl PERL=\'$perl\'"; + my $make_targets = ""; + $make_targets .= " links" if $symlink; + $make_targets .= " depend" if $depflags ne "" && $make_depend; + $make_targets .= " gentests" if $symlink; + (system $make_command.$make_targets) == 0 or exit $? + if $make_targets ne ""; if ( $perl =~ m@^/@) { &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); &dofile("apps/der_chop",$perl,'^#!/', '#!%s'); @@ -1224,6 +1233,15 @@ EOF &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";'); &dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s'); &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s'); + } + if ($depflags ne "" && !$make_depend) { + print <value; bufnum=0; + again=0; for (;;) { - again=0; if (!BUF_MEM_grow(buff,bufnum+BUFSIZE)) { CONFerr(CONF_F_CONF_LOAD_BIO,ERR_R_BUF_LIB); @@ -237,7 +237,8 @@ static int def_load(CONF *conf, BIO *in, long *line) BIO_gets(in, p, BUFSIZE-1); p[BUFSIZE-1]='\0'; ii=i=strlen(p); - if (i == 0) break; + if (i == 0 && !again) break; + again=0; while (i > 0) { if ((p[i-1] != '\r') && (p[i-1] != '\n')) @@ -247,7 +248,7 @@ static int def_load(CONF *conf, BIO *in, long *line) } /* we removed some trailing stuff so there is a new * line on the end. */ - if (i == ii) + if (ii && i == ii) again=1; /* long line */ else { diff --git a/crypto/evp/c_allc.c b/crypto/evp/c_allc.c index 0820557fdb..f24d3756c9 100644 --- a/crypto/evp/c_allc.c +++ b/crypto/evp/c_allc.c @@ -64,10 +64,6 @@ void OpenSSL_add_all_ciphers(void) { - static int done=0; - - if (done) return; - done=1; #ifndef NO_DES EVP_add_cipher(EVP_des_cfb()); EVP_add_cipher(EVP_des_ede_cfb()); diff --git a/crypto/evp/c_alld.c b/crypto/evp/c_alld.c index 41695df106..bbf059eb85 100644 --- a/crypto/evp/c_alld.c +++ b/crypto/evp/c_alld.c @@ -64,10 +64,6 @@ void OpenSSL_add_all_digests(void) { - static int done=0; - - if (done) return; - done=1; #ifndef NO_MD2 EVP_add_digest(EVP_md2()); #endif diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index 2b4b1446ed..92befcd798 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -254,6 +254,10 @@ int RAND_poll(void) * at random times on Windows 2000. Reported by Jeffrey Altman. * Only use it on NT. */ + /* Wolfgang Marczy reports that + * the RegQueryValueEx call below can hang on NT4.0 (SP6). + * So we don't use this at all for now. */ +#if 0 if ( osverinfo.dwPlatformId == VER_PLATFORM_WIN32_NT && osverinfo.dwMajorVersion < 5) { @@ -283,13 +287,23 @@ int RAND_poll(void) { /* For entropy count assume only least significant * byte of each DWORD is random. - */ + */ RAND_add(&length, sizeof(length), 0); RAND_add(buf, length, length / 4.0); + + /* Close the Registry Key to allow Windows to cleanup/close + * the open handle + * Note: The 'HKEY_PERFORMANCE_DATA' key is implicitly opened + * when the RegQueryValueEx above is done. However, if + * it is not explicitly closed, it can cause disk + * partition manipulation problems. + */ + RegCloseKey(HKEY_PERFORMANCE_DATA); } if (buf) free(buf); } +#endif if (advapi) { @@ -461,7 +475,7 @@ int RAND_poll(void) hlist.th32ProcessID, hlist.th32HeapID)) { - int entrycnt = 50; + int entrycnt = 80; do RAND_add(&hentry, hentry.dwSize, 5); diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index c2ae28c3a2..c94f7bba52 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -61,6 +61,8 @@ #include #include +#include "openssl/e_os.h" + #ifdef VMS #include #endif @@ -73,7 +75,6 @@ # include #endif -#include "openssl/e_os.h" #include #include diff --git a/doc/ssl/ssl.pod b/doc/ssl/ssl.pod index 2dcee0385a..8c4970491c 100644 --- a/doc/ssl/ssl.pod +++ b/doc/ssl/ssl.pod @@ -347,7 +347,7 @@ appropriate size (using ???) and return it. long B(SSL *ssl, RSA *(*cb)(SSL *ssl, int export, int keylength)); -The same as L<"SSL_CTX_set_tmp_rsa_callback">, except it operates on an SSL +The same as B, except it operates on an SSL session instead of a context. =item void B(SSL_CTX *ctx, int mode, int (*cb);(void)) diff --git a/ms/testenc.bat b/ms/testenc.bat index e8917eeee2..4b99bd5895 100755 --- a/ms/testenc.bat +++ b/ms/testenc.bat @@ -1,6 +1,6 @@ - +@echo off echo start testenc -echo=off + path=..\ms;%path% set ssleay=%1% set input=..\ms\testenc.bat diff --git a/ms/testpem.bat b/ms/testpem.bat index 81e566b69b..005f13b67e 100755 --- a/ms/testpem.bat +++ b/ms/testpem.bat @@ -1,4 +1,4 @@ -echo=off +@echo off set ssleay=%1% set tmp1=pem.out set cmp=fc.exe diff --git a/ms/testss.bat b/ms/testss.bat index 36863a5017..f7e58e2756 100755 --- a/ms/testss.bat +++ b/ms/testss.bat @@ -1,4 +1,4 @@ -echo=on +@echo off rem set ssleay=..\out\ssleay set ssleay=%1 diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 5c694dcebb..0a84b09bf5 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -86,7 +86,7 @@ top: all: exe -exe: $(EXE) +exe: $(EXE) dummytest files: $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO @@ -94,6 +94,10 @@ files: links: @@$(TOP)/util/point.sh Makefile.ssl Makefile +generate: $(SRC) +$(SRC): + @$(TOP)/util/point.sh dummytest.c $@ + errors: install: @@ -325,6 +329,9 @@ $(SSLTEST): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO) $(ENGINETEST): $(ENGINETEST).o $(DLIBCRYPTO) $(CC) -o $(ENGINETEST) $(CFLAGS) $(ENGINETEST).o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) +dummytest: dummytest.o $(DLIBCRYPTO) + $(CC) -o dummytest $(CFLAGS) dummytest.o $(PEX_LIBS) $(LIBCRYPTO) $(EX_LIBS) + # DO NOT DELETE THIS LINE -- make depend depends on it. bftest.o: ../include/openssl/blowfish.h diff --git a/test/dummytest.c b/test/dummytest.c index 5b4467e042..277d824e82 100644 --- a/test/dummytest.c +++ b/test/dummytest.c @@ -12,7 +12,7 @@ int main(int argc, char *argv[]) p = strrchr(argv[0], '/'); if (!p) p = strrchr(argv[0], '\\'); -#ifdef OPENSSL_SYS_VMS +#ifdef VMS if (!p) p = strrchr(argv[0], ']'); if (p) q = strrchr(p, '>'); if (q) p = q; diff --git a/util/cygwin.sh b/util/cygwin.sh index b607399b02..930f766b4f 100755 --- a/util/cygwin.sh +++ b/util/cygwin.sh @@ -96,6 +96,8 @@ fi get_openssl_version +make depend || exit 1 + make || exit 1 base_install diff --git a/util/libeay.num b/util/libeay.num index 24b6319fd5..5455b20bf4 100755 --- a/util/libeay.num +++ b/util/libeay.num @@ -301,8 +301,8 @@ EVP_des_ede_cfb 308 EXIST::FUNCTION:DES EVP_des_ede_ofb 309 EXIST::FUNCTION:DES EVP_des_ofb 310 EXIST::FUNCTION:DES EVP_desx_cbc 311 EXIST::FUNCTION:DES -EVP_dss 312 EXIST::FUNCTION:SHA,DSA -EVP_dss1 313 EXIST::FUNCTION:SHA,DSA +EVP_dss 312 EXIST::FUNCTION:DSA,SHA +EVP_dss1 313 EXIST::FUNCTION:DSA,SHA EVP_enc_null 314 EXIST::FUNCTION: EVP_get_cipherbyname 315 EXIST::FUNCTION: EVP_get_digestbyname 316 EXIST::FUNCTION: @@ -1212,7 +1212,7 @@ name_cmp 1239 EXIST::FUNCTION: str_dup 1240 NOEXIST::FUNCTION: i2s_ASN1_ENUMERATED 1241 EXIST::FUNCTION: i2s_ASN1_ENUMERATED_TABLE 1242 EXIST::FUNCTION: -BIO_s_log 1243 EXIST:!WIN16,!WIN32,!macintosh:FUNCTION: +BIO_s_log 1243 EXIST:!WIN32,!macintosh,!WIN16:FUNCTION: BIO_f_reliable 1244 EXIST::FUNCTION: PKCS7_dataFinal 1245 EXIST::FUNCTION: PKCS7_dataDecode 1246 EXIST::FUNCTION: -- 2.25.1