From: Richard Levitte Date: Thu, 5 Dec 2002 01:18:41 +0000 (+0000) Subject: Recent changes from 0.9.6-stable X-Git-Tag: OpenSSL-engine-0_9_6h~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=696335ab46d63c85387edd50aa742fc9dd7f491b;p=oweals%2Fopenssl.git Recent changes from 0.9.6-stable --- diff --git a/PROBLEMS b/PROBLEMS index 7e6af8ad4d..5cb7f87de6 100644 --- a/PROBLEMS +++ b/PROBLEMS @@ -40,3 +40,19 @@ scripts use the same name for output and input files, which means different will interfere with each other and lead to test failure. The solution is simple for now: don't run parallell make when testing. + + +* Bugs in gcc 3.0 triggered + +According to a problem report, there are bugs in gcc 3.0 that are +triggered by some of the code in OpenSSL, more specifically in +PEM_get_EVP_CIPHER_INFO(). The triggering code is the following: + + header+=11; + if (*header != '4') return(0); header++; + if (*header != ',') return(0); header++; + +What happens is that gcc might optimize a little too agressively, and +you end up with an extra incrementation when *header != '4'. + +We recommend that you upgrade gcc to as high a 3.x version as you can. diff --git a/apps/ca.c b/apps/ca.c index b315f3f346..11b5d4ac78 100644 --- a/apps/ca.c +++ b/apps/ca.c @@ -633,12 +633,14 @@ bad: that to access(). However, time's too short to do that just now. */ +#ifndef VXWORKS if (access(outdir,R_OK|W_OK|X_OK) != 0) { BIO_printf(bio_err,"I am unable to access the %s directory\n",outdir); perror(outdir); goto err; } +#endif if (stat(outdir,&sb) != 0) { diff --git a/apps/s_server.c b/apps/s_server.c index f81a206245..955e11dac4 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -1284,7 +1284,7 @@ static int www_body(char *hostname, int s, unsigned char *context) else { BIO_printf(bio_s_out,"read R BLOCK\n"); -#ifndef MSDOS +#if !defined(MSDOS) && !defined(VXWORKS) sleep(1); #endif continue; diff --git a/apps/s_time.c b/apps/s_time.c index c8719a6a22..895741d4cd 100644 --- a/apps/s_time.c +++ b/apps/s_time.c @@ -116,6 +116,11 @@ #include #endif +#ifdef VXWORKS +#include +#undef SIGALRM +#endif + /* The following if from times(3) man page. It may need to be changed */ #ifndef HZ diff --git a/crypto/des/read2pwd.c b/crypto/des/read2pwd.c index 25d3c63131..115132deec 100644 --- a/crypto/des/read2pwd.c +++ b/crypto/des/read2pwd.c @@ -57,6 +57,7 @@ */ #include "des_locl.h" +#include int des_read_password(des_cblock *key, const char *prompt, int verify) { diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c index fc5b96ee87..10e1dc174d 100644 --- a/crypto/des/str2key.c +++ b/crypto/des/str2key.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include #include "des_locl.h" void des_string_to_key(const char *str, des_cblock *key) diff --git a/crypto/md2/md2_dgst.c b/crypto/md2/md2_dgst.c index 458a3fad7f..fc25280469 100644 --- a/crypto/md2/md2_dgst.c +++ b/crypto/md2/md2_dgst.c @@ -61,6 +61,7 @@ #include #include #include +#include const char *MD2_version="MD2" OPENSSL_VERSION_PTEXT; diff --git a/crypto/md4/md4_one.c b/crypto/md4/md4_one.c index 53efd430ec..00565507e4 100644 --- a/crypto/md4/md4_one.c +++ b/crypto/md4/md4_one.c @@ -59,6 +59,7 @@ #include #include #include +#include #ifdef CHARSET_EBCDIC #include diff --git a/crypto/md5/md5_one.c b/crypto/md5/md5_one.c index c67eb795ca..c5dd2d81db 100644 --- a/crypto/md5/md5_one.c +++ b/crypto/md5/md5_one.c @@ -59,6 +59,7 @@ #include #include #include +#include #ifdef CHARSET_EBCDIC #include diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c index e17060fe90..ce16936785 100644 --- a/crypto/rand/rand_egd.c +++ b/crypto/rand/rand_egd.c @@ -59,7 +59,7 @@ /* Query the EGD . */ -#if defined(WIN32) || defined(MSDOS) || defined(VMS) || defined(__VMS) +#if defined(WIN32) || defined(MSDOS) || defined(VMS) || defined(__VMS) || defined(VXWORKS) int RAND_egd(const char *path) { return(-1); diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index 92befcd798..3e148ad4d2 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -732,8 +732,10 @@ int RAND_poll(void) /* put in some default random data, we need more than just this */ l=curr_pid; RAND_add(&l,sizeof(l),0); +#ifndef VXWORKS l=getuid(); RAND_add(&l,sizeof(l),0); +#endif l=time(NULL); RAND_add(&l,sizeof(l),0); diff --git a/crypto/ripemd/rmd_one.c b/crypto/ripemd/rmd_one.c index a783282282..f8b580c33a 100644 --- a/crypto/ripemd/rmd_one.c +++ b/crypto/ripemd/rmd_one.c @@ -59,6 +59,7 @@ #include #include #include +#include unsigned char *RIPEMD160(const unsigned char *d, unsigned long n, unsigned char *md) diff --git a/crypto/sha/sha1_one.c b/crypto/sha/sha1_one.c index e32847ef6c..acf3e92ff2 100644 --- a/crypto/sha/sha1_one.c +++ b/crypto/sha/sha1_one.c @@ -59,6 +59,7 @@ #include #include #include +#include #ifndef NO_SHA1 unsigned char *SHA1(const unsigned char *d, unsigned long n, unsigned char *md) diff --git a/crypto/sha/sha_one.c b/crypto/sha/sha_one.c index 65e15befb7..ece37146c2 100644 --- a/crypto/sha/sha_one.c +++ b/crypto/sha/sha_one.c @@ -59,6 +59,7 @@ #include #include #include +#include #ifndef NO_SHA0 unsigned char *SHA(const unsigned char *d, unsigned long n, unsigned char *md) diff --git a/crypto/threads/mttest.c b/crypto/threads/mttest.c index 100165948c..3d1b212b1c 100644 --- a/crypto/threads/mttest.c +++ b/crypto/threads/mttest.c @@ -77,6 +77,10 @@ #ifdef PTHREADS #include #endif +#ifdef VXWORKS +#include +#include +#endif #include #include #include @@ -105,10 +109,12 @@ void irix_locking_callback(int mode,int type,char *file,int line); void solaris_locking_callback(int mode,int type,char *file,int line); void win32_locking_callback(int mode,int type,char *file,int line); void pthreads_locking_callback(int mode,int type,char *file,int line); +void vxworks_locking_callback(int mode,int type,char *file,int line); unsigned long irix_thread_id(void ); unsigned long solaris_thread_id(void ); unsigned long pthreads_thread_id(void ); +unsigned long vxworks_thread_id(void ); BIO *bio_err=NULL; BIO *bio_stdout=NULL; @@ -1097,4 +1103,119 @@ unsigned long pthreads_thread_id(void) #endif /* PTHREADS */ +#ifdef VXWORKS + +#define DEFAULT_TASK_NAME NULL +#define DEFAULT_TASK_PRIORITY 100 +#define DEFAULT_TASK_OPTIONS 0 +#define DEFAULT_TASK_STACK_BYTES 32768 + +static SEM_ID *lock_cs; +static long *lock_count; + +extern int sysClkRateGet(); + +void thread_setup(void) + { + int i; + + lock_cs=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(SEM_ID)); + lock_count=OPENSSL_malloc(CRYPTO_num_locks() * sizeof(long)); + for (i=0; ireferences,c_ctx->references); + } + +unsigned long vxworks_thread_id(void) + { + return((unsigned long)taskIdSelf()); + } +#endif /* VXWORKS */ diff --git a/crypto/tmdiff.c b/crypto/tmdiff.c index 830092210f..fc38e139a7 100644 --- a/crypto/tmdiff.c +++ b/crypto/tmdiff.c @@ -105,6 +105,11 @@ #include #endif +#ifdef VXWORKS +#include +#include +#endif + /* The following if from times(3) man page. It may need to be changed */ #ifndef HZ # ifndef CLK_TCK diff --git a/crypto/uid.c b/crypto/uid.c index b5b61b76d4..4bd283592c 100644 --- a/crypto/uid.c +++ b/crypto/uid.c @@ -64,7 +64,7 @@ int OPENSSL_issetugid(void) return issetugid(); } -#elif defined(WIN32) +#elif defined(WIN32) || defined(VXWORKS) int OPENSSL_issetugid(void) { diff --git a/doc/ssl/SSL_CTX_set_verify.pod b/doc/ssl/SSL_CTX_set_verify.pod index 5bb21ca535..d15b2a3a1a 100644 --- a/doc/ssl/SSL_CTX_set_verify.pod +++ b/doc/ssl/SSL_CTX_set_verify.pod @@ -235,7 +235,7 @@ L). * At this point, err contains the last verification error. We can use * it for something special */ - if (!preverify_ok && (err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT) + if (!preverify_ok && (err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT)) { X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, 256); printf("issuer= %s\n", buf); diff --git a/test/Makefile.ssl b/test/Makefile.ssl index 0a84b09bf5..307d1dd4c0 100644 --- a/test/Makefile.ssl +++ b/test/Makefile.ssl @@ -334,7 +334,8 @@ dummytest: dummytest.o $(DLIBCRYPTO) # DO NOT DELETE THIS LINE -- make depend depends on it. -bftest.o: ../include/openssl/blowfish.h +bftest.o: ../e_os.h ../include/openssl/blowfish.h ../include/openssl/e_os2.h +bftest.o: ../include/openssl/opensslconf.h bntest.o: ../include/openssl/asn1.h ../include/openssl/bio.h bntest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h bntest.o: ../include/openssl/buffer.h ../include/openssl/cast.h @@ -354,22 +355,24 @@ bntest.o: ../include/openssl/rsa.h ../include/openssl/safestack.h bntest.o: ../include/openssl/sha.h ../include/openssl/stack.h bntest.o: ../include/openssl/symhacks.h ../include/openssl/x509.h bntest.o: ../include/openssl/x509_vfy.h -casttest.o: ../include/openssl/cast.h +casttest.o: ../e_os.h ../include/openssl/cast.h ../include/openssl/e_os2.h +casttest.o: ../include/openssl/opensslconf.h destest.o: ../include/openssl/des.h ../include/openssl/e_os2.h destest.o: ../include/openssl/opensslconf.h -dhtest.o: ../include/openssl/bio.h ../include/openssl/bn.h +dhtest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h dhtest.o: ../include/openssl/crypto.h ../include/openssl/dh.h -dhtest.o: ../include/openssl/err.h ../include/openssl/lhash.h -dhtest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h -dhtest.o: ../include/openssl/rand.h ../include/openssl/safestack.h -dhtest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -dsatest.o: ../include/openssl/bio.h ../include/openssl/bn.h +dhtest.o: ../include/openssl/e_os2.h ../include/openssl/err.h +dhtest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h +dhtest.o: ../include/openssl/opensslv.h ../include/openssl/rand.h +dhtest.o: ../include/openssl/safestack.h ../include/openssl/stack.h +dhtest.o: ../include/openssl/symhacks.h +dsatest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h dsatest.o: ../include/openssl/crypto.h ../include/openssl/dh.h -dsatest.o: ../include/openssl/dsa.h ../include/openssl/err.h -dsatest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h -dsatest.o: ../include/openssl/opensslv.h ../include/openssl/rand.h -dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h -dsatest.o: ../include/openssl/symhacks.h +dsatest.o: ../include/openssl/dsa.h ../include/openssl/e_os2.h +dsatest.o: ../include/openssl/err.h ../include/openssl/lhash.h +dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +dsatest.o: ../include/openssl/rand.h ../include/openssl/safestack.h +dsatest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h enginetest.o: ../include/openssl/asn1.h ../include/openssl/bio.h enginetest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h enginetest.o: ../include/openssl/buffer.h ../include/openssl/cast.h @@ -387,13 +390,13 @@ enginetest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h enginetest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h enginetest.o: ../include/openssl/safestack.h ../include/openssl/sha.h enginetest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -exptest.o: ../include/openssl/bio.h ../include/openssl/bn.h -exptest.o: ../include/openssl/crypto.h ../include/openssl/err.h -exptest.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h -exptest.o: ../include/openssl/opensslv.h ../include/openssl/rand.h -exptest.o: ../include/openssl/safestack.h ../include/openssl/stack.h -exptest.o: ../include/openssl/symhacks.h -hmactest.o: ../include/openssl/asn1.h ../include/openssl/bio.h +exptest.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/bn.h +exptest.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h +exptest.o: ../include/openssl/err.h ../include/openssl/lhash.h +exptest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +exptest.o: ../include/openssl/rand.h ../include/openssl/safestack.h +exptest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +hmactest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h hmactest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h hmactest.o: ../include/openssl/cast.h ../include/openssl/crypto.h hmactest.o: ../include/openssl/des.h ../include/openssl/dh.h @@ -408,17 +411,26 @@ hmactest.o: ../include/openssl/rc4.h ../include/openssl/rc5.h hmactest.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h hmactest.o: ../include/openssl/safestack.h ../include/openssl/sha.h hmactest.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -ideatest.o: ../include/openssl/idea.h ../include/openssl/opensslconf.h -md2test.o: ../include/openssl/md2.h ../include/openssl/opensslconf.h -md4test.o: ../include/openssl/md4.h -md5test.o: ../include/openssl/md5.h -mdc2test.o: ../include/openssl/des.h ../include/openssl/e_os2.h +ideatest.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/idea.h +ideatest.o: ../include/openssl/opensslconf.h +md2test.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/md2.h +md2test.o: ../include/openssl/opensslconf.h +md4test.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/md4.h +md4test.o: ../include/openssl/opensslconf.h +md5test.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/md5.h +md5test.o: ../include/openssl/opensslconf.h +mdc2test.o: ../e_os.h ../include/openssl/des.h ../include/openssl/e_os2.h mdc2test.o: ../include/openssl/mdc2.h ../include/openssl/opensslconf.h -randtest.o: ../include/openssl/rand.h +randtest.o: ../e_os.h ../include/openssl/e_os2.h +randtest.o: ../include/openssl/opensslconf.h ../include/openssl/rand.h +rc2test.o: ../e_os.h ../include/openssl/e_os2.h rc2test.o: ../include/openssl/opensslconf.h ../include/openssl/rc2.h +rc4test.o: ../e_os.h ../include/openssl/e_os2.h rc4test.o: ../include/openssl/opensslconf.h ../include/openssl/rc4.h -rc5test.o: ../include/openssl/rc5.h -rmdtest.o: ../include/openssl/ripemd.h +rc5test.o: ../e_os.h ../include/openssl/e_os2.h +rc5test.o: ../include/openssl/opensslconf.h ../include/openssl/rc5.h +rmdtest.o: ../e_os.h ../include/openssl/e_os2.h +rmdtest.o: ../include/openssl/opensslconf.h ../include/openssl/ripemd.h rsa_test.o: ../include/openssl/bio.h ../include/openssl/bn.h rsa_test.o: ../include/openssl/crypto.h ../include/openssl/e_os.h rsa_test.o: ../include/openssl/e_os2.h ../include/openssl/err.h @@ -426,8 +438,10 @@ rsa_test.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h rsa_test.o: ../include/openssl/opensslv.h ../include/openssl/rand.h rsa_test.o: ../include/openssl/rsa.h ../include/openssl/safestack.h rsa_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h -sha1test.o: ../include/openssl/sha.h -shatest.o: ../include/openssl/sha.h +sha1test.o: ../e_os.h ../include/openssl/e_os2.h +sha1test.o: ../include/openssl/opensslconf.h ../include/openssl/sha.h +shatest.o: ../e_os.h ../include/openssl/e_os2.h +shatest.o: ../include/openssl/opensslconf.h ../include/openssl/sha.h ssltest.o: ../include/openssl/asn1.h ../include/openssl/bio.h ssltest.o: ../include/openssl/blowfish.h ../include/openssl/bn.h ssltest.o: ../include/openssl/buffer.h ../include/openssl/cast.h