summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/asn1/a_utctm.c3
-rw-r--r--src/lib/libcrypto/des/fcrypt.c8
-rw-r--r--src/lib/libcrypto/des/read_pwd.c2
-rw-r--r--src/lib/libcrypto/dsa/dsa_key.c4
-rw-r--r--src/lib/libcrypto/dsa/dsa_ossl.c56
-rw-r--r--src/lib/libcrypto/engine/Makefile.ssl2
-rw-r--r--src/lib/libcrypto/engine/eng_all.c5
-rw-r--r--src/lib/libcrypto/engine/engine.h2
-rw-r--r--src/lib/libcrypto/evp/evp_test.c4
-rw-r--r--src/lib/libcrypto/objects/Makefile.ssl1
-rw-r--r--src/lib/libcrypto/objects/obj_dat.pl3
-rw-r--r--src/lib/libcrypto/rand/randfile.c14
-rw-r--r--src/lib/libcrypto/util/domd4
-rw-r--r--src/lib/libssl/crypto/Makefile12
-rw-r--r--src/lib/libssl/s3_srvr.c4
-rw-r--r--src/lib/libssl/src/Configure3
-rw-r--r--src/lib/libssl/src/Makefile.org10
-rw-r--r--src/lib/libssl/src/apps/speed.c2
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_utctm.c3
-rw-r--r--src/lib/libssl/src/crypto/des/fcrypt.c8
-rw-r--r--src/lib/libssl/src/crypto/des/read_pwd.c2
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_key.c4
-rw-r--r--src/lib/libssl/src/crypto/dsa/dsa_ossl.c56
-rw-r--r--src/lib/libssl/src/crypto/engine/Makefile.ssl2
-rw-r--r--src/lib/libssl/src/crypto/engine/eng_all.c5
-rw-r--r--src/lib/libssl/src/crypto/engine/engine.h2
-rw-r--r--src/lib/libssl/src/crypto/evp/evp_test.c4
-rw-r--r--src/lib/libssl/src/crypto/objects/Makefile.ssl1
-rw-r--r--src/lib/libssl/src/crypto/objects/obj_dat.pl3
-rw-r--r--src/lib/libssl/src/crypto/rand/randfile.c14
-rw-r--r--src/lib/libssl/src/demos/easy_tls/Makefile2
-rw-r--r--src/lib/libssl/src/demos/easy_tls/cacerts.pem2
-rw-r--r--src/lib/libssl/src/demos/easy_tls/cert.pem2
-rw-r--r--src/lib/libssl/src/demos/easy_tls/easy-tls.c9
-rw-r--r--src/lib/libssl/src/demos/easy_tls/easy-tls.h2
-rw-r--r--src/lib/libssl/src/demos/easy_tls/test.c2
-rw-r--r--src/lib/libssl/src/demos/easy_tls/test.h2
-rw-r--r--src/lib/libssl/src/doc/crypto/des_modes.pod4
-rw-r--r--src/lib/libssl/src/e_os.h2
-rw-r--r--src/lib/libssl/src/ssl/s3_srvr.c4
-rw-r--r--src/lib/libssl/src/ssl/ssl_locl.h2
-rw-r--r--src/lib/libssl/src/test/Makefile.ssl15
-rw-r--r--src/lib/libssl/src/util/domd4
-rw-r--r--src/lib/libssl/ssl_locl.h2
-rw-r--r--src/lib/libssl/test/Makefile.ssl15
45 files changed, 119 insertions, 193 deletions
diff --git a/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c
index dbb4a42c9d..ed2d827db2 100644
--- a/src/lib/libcrypto/asn1/a_utctm.c
+++ b/src/lib/libcrypto/asn1/a_utctm.c
@@ -222,7 +222,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
222int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) 222int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
223 { 223 {
224 struct tm *tm; 224 struct tm *tm;
225 struct tm data;
226 int offset; 225 int offset;
227 int year; 226 int year;
228 227
@@ -239,7 +238,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
239 238
240 t -= offset*60; /* FIXME: may overflow in extreme cases */ 239 t -= offset*60; /* FIXME: may overflow in extreme cases */
241 240
242 tm = OPENSSL_gmtime(&t, &data); 241 { struct tm data; tm = OPENSSL_gmtime(&t, &data); }
243 242
244#define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 243#define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
245 year = g2(s->data); 244 year = g2(s->data);
diff --git a/src/lib/libcrypto/des/fcrypt.c b/src/lib/libcrypto/des/fcrypt.c
index 387d97f28d..2758c32656 100644
--- a/src/lib/libcrypto/des/fcrypt.c
+++ b/src/lib/libcrypto/des/fcrypt.c
@@ -1,5 +1,13 @@
1/* NOCW */ 1/* NOCW */
2#include <stdio.h> 2#include <stdio.h>
3#ifdef _OSD_POSIX
4#ifndef CHARSET_EBCDIC
5#define CHARSET_EBCDIC 1
6#endif
7#endif
8#ifdef CHARSET_EBCDIC
9#include <openssl/ebcdic.h>
10#endif
3 11
4/* This version of crypt has been developed from my MIT compatible 12/* This version of crypt has been developed from my MIT compatible
5 * DES library. 13 * DES library.
diff --git a/src/lib/libcrypto/des/read_pwd.c b/src/lib/libcrypto/des/read_pwd.c
index 54e0e2e6b6..00000190f8 100644
--- a/src/lib/libcrypto/des/read_pwd.c
+++ b/src/lib/libcrypto/des/read_pwd.c
@@ -211,7 +211,7 @@ static int noecho_fgets(char *buf, int size, FILE *tty);
211#endif 211#endif
212static jmp_buf save; 212static jmp_buf save;
213 213
214int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt, 214int des_read_pw_string(char *buf, int length, const char *prompt,
215 int verify) 215 int verify)
216 { 216 {
217 char buff[BUFSIZ]; 217 char buff[BUFSIZ];
diff --git a/src/lib/libcrypto/dsa/dsa_key.c b/src/lib/libcrypto/dsa/dsa_key.c
index bf718c1c6d..ef87c3e637 100644
--- a/src/lib/libcrypto/dsa/dsa_key.c
+++ b/src/lib/libcrypto/dsa/dsa_key.c
@@ -64,8 +64,6 @@
64#include <openssl/dsa.h> 64#include <openssl/dsa.h>
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66 66
67extern int __BN_rand_range(BIGNUM *r, BIGNUM *range);
68
69int DSA_generate_key(DSA *dsa) 67int DSA_generate_key(DSA *dsa)
70 { 68 {
71 int ok=0; 69 int ok=0;
@@ -82,7 +80,7 @@ int DSA_generate_key(DSA *dsa)
82 priv_key=dsa->priv_key; 80 priv_key=dsa->priv_key;
83 81
84 do 82 do
85 if (!__BN_rand_range(priv_key,dsa->q)) goto err; 83 if (!BN_rand_range(priv_key,dsa->q)) goto err;
86 while (BN_is_zero(priv_key)); 84 while (BN_is_zero(priv_key));
87 85
88 if (dsa->pub_key == NULL) 86 if (dsa->pub_key == NULL)
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c
index 07addc94d9..37dd5fc994 100644
--- a/src/lib/libcrypto/dsa/dsa_ossl.c
+++ b/src/lib/libcrypto/dsa/dsa_ossl.c
@@ -66,8 +66,6 @@
66#include <openssl/asn1.h> 66#include <openssl/asn1.h>
67#include <openssl/engine.h> 67#include <openssl/engine.h>
68 68
69int __BN_rand_range(BIGNUM *r, BIGNUM *range);
70
71static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); 69static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
72static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); 70static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
73static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, 71static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
@@ -193,7 +191,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
193 191
194 /* Get random k */ 192 /* Get random k */
195 do 193 do
196 if (!__BN_rand_range(&k, dsa->q)) goto err; 194 if (!BN_rand_range(&k, dsa->q)) goto err;
197 while (BN_is_zero(&k)); 195 while (BN_is_zero(&k));
198 196
199 if ((dsa->method_mont_p == NULL) && (dsa->flags & DSA_FLAG_CACHE_MONT_P)) 197 if ((dsa->method_mont_p == NULL) && (dsa->flags & DSA_FLAG_CACHE_MONT_P))
@@ -344,55 +342,3 @@ static int dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
344{ 342{
345 return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx); 343 return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
346} 344}
347
348
349/* random number r: 0 <= r < range */
350int __BN_rand_range(BIGNUM *r, BIGNUM *range)
351 {
352 int n;
353
354 if (range->neg || BN_is_zero(range))
355 {
356 /* BNerr(BN_F_BN_RAND_RANGE, BN_R_INVALID_RANGE); */
357 return 0;
358 }
359
360 n = BN_num_bits(range); /* n > 0 */
361
362 if (n == 1)
363 {
364 if (!BN_zero(r)) return 0;
365 }
366 else if (BN_is_bit_set(range, n - 2))
367 {
368 do
369 {
370 /* range = 11..._2, so each iteration succeeds with probability >= .75 */
371 if (!BN_rand(r, n, -1, 0)) return 0;
372 }
373 while (BN_cmp(r, range) >= 0);
374 }
375 else
376 {
377 /* range = 10..._2,
378 * so 3*range (= 11..._2) is exactly one bit longer than range */
379 do
380 {
381 if (!BN_rand(r, n + 1, -1, 0)) return 0;
382 /* If r < 3*range, use r := r MOD range
383 * (which is either r, r - range, or r - 2*range).
384 * Otherwise, iterate once more.
385 * Since 3*range = 11..._2, each iteration succeeds with
386 * probability >= .75. */
387 if (BN_cmp(r ,range) >= 0)
388 {
389 if (!BN_sub(r, r, range)) return 0;
390 if (BN_cmp(r, range) >= 0)
391 if (!BN_sub(r, r, range)) return 0;
392 }
393 }
394 while (BN_cmp(r, range) >= 0);
395 }
396
397 return 1;
398 }
diff --git a/src/lib/libcrypto/engine/Makefile.ssl b/src/lib/libcrypto/engine/Makefile.ssl
index 8ee3b7d2dd..5172028f93 100644
--- a/src/lib/libcrypto/engine/Makefile.ssl
+++ b/src/lib/libcrypto/engine/Makefile.ssl
@@ -74,7 +74,7 @@ tags:
74 74
75errors: 75errors:
76 $(PERL) $(TOP)/util/mkerr.pl -conf hw.ec \ 76 $(PERL) $(TOP)/util/mkerr.pl -conf hw.ec \
77 -nostatic -staticloader -write hw_*.c 77 -nostatic -staticloader -write hw_*.c; \
78 78
79tests: 79tests:
80 80
diff --git a/src/lib/libcrypto/engine/eng_all.c b/src/lib/libcrypto/engine/eng_all.c
index a35b3db9e8..bc50465422 100644
--- a/src/lib/libcrypto/engine/eng_all.c
+++ b/src/lib/libcrypto/engine/eng_all.c
@@ -96,6 +96,9 @@ void ENGINE_load_builtin_engines(void)
96#ifndef OPENSSL_NO_HW_SUREWARE 96#ifndef OPENSSL_NO_HW_SUREWARE
97 ENGINE_load_sureware(); 97 ENGINE_load_sureware();
98#endif 98#endif
99#ifndef OPENSSL_NO_HW_4758_CCA
100 ENGINE_load_4758cca();
101#endif
99#ifdef OPENSSL_OPENBSD_DEV_CRYPTO 102#ifdef OPENSSL_OPENBSD_DEV_CRYPTO
100 ENGINE_load_openbsd_dev_crypto(); 103 ENGINE_load_openbsd_dev_crypto();
101#endif 104#endif
@@ -114,5 +117,3 @@ void ENGINE_setup_openbsd(void) {
114 openbsd_default_loaded=1; 117 openbsd_default_loaded=1;
115} 118}
116#endif 119#endif
117
118
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h
index 97f5de9e12..fd17ff616d 100644
--- a/src/lib/libcrypto/engine/engine.h
+++ b/src/lib/libcrypto/engine/engine.h
@@ -312,7 +312,7 @@ void ENGINE_load_builtin_engines(void);
312#ifdef __OpenBSD__ 312#ifdef __OpenBSD__
313void ENGINE_load_cryptodev(void); 313void ENGINE_load_cryptodev(void);
314#endif 314#endif
315 315
316/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation 316/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
317 * "registry" handling. */ 317 * "registry" handling. */
318unsigned int ENGINE_get_table_flags(void); 318unsigned int ENGINE_get_table_flags(void);
diff --git a/src/lib/libcrypto/evp/evp_test.c b/src/lib/libcrypto/evp/evp_test.c
index 90294ef686..1bfffb34cf 100644
--- a/src/lib/libcrypto/evp/evp_test.c
+++ b/src/lib/libcrypto/evp/evp_test.c
@@ -118,7 +118,7 @@ static char *sstrsep(char **string, const char *delim)
118 } 118 }
119 119
120static unsigned char *ustrsep(char **p,const char *sep) 120static unsigned char *ustrsep(char **p,const char *sep)
121 { return (unsigned char *)sstrsep(p,sep); } 121 { return (unsigned char *)sstrsep((char **)p,sep); }
122 122
123static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn, 123static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
124 const unsigned char *iv,int in, 124 const unsigned char *iv,int in,
@@ -358,7 +358,7 @@ int main(int argc,char **argv)
358 p[-1] = '\0'; 358 p[-1] = '\0';
359 encdec = -1; 359 encdec = -1;
360 } else { 360 } else {
361 encdec = atoi(sstrsep(&p,"\n")); 361 encdec = atoi(strsep(&p,"\n"));
362 } 362 }
363 363
364 364
diff --git a/src/lib/libcrypto/objects/Makefile.ssl b/src/lib/libcrypto/objects/Makefile.ssl
index 1e990107d3..a9f01ffc0d 100644
--- a/src/lib/libcrypto/objects/Makefile.ssl
+++ b/src/lib/libcrypto/objects/Makefile.ssl
@@ -15,6 +15,7 @@ MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) 15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl 16MAKEFILE= Makefile.ssl
17AR= ar r 17AR= ar r
18PERL= perl
18 19
19CFLAGS= $(INCLUDES) $(CFLAG) 20CFLAGS= $(INCLUDES) $(CFLAG)
20 21
diff --git a/src/lib/libcrypto/objects/obj_dat.pl b/src/lib/libcrypto/objects/obj_dat.pl
index 85ab209809..d0371661f9 100644
--- a/src/lib/libcrypto/objects/obj_dat.pl
+++ b/src/lib/libcrypto/objects/obj_dat.pl
@@ -1,4 +1,7 @@
1#!/usr/local/bin/perl 1#!/usr/local/bin/perl
2
3# fixes bug in floating point emulation on sparc64 when
4# this script produces off-by-one output on sparc64
2use integer; 5use integer;
3 6
4sub obj_cmp 7sub obj_cmp
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c
index 4b221e08f5..1c3e68ef31 100644
--- a/src/lib/libcrypto/rand/randfile.c
+++ b/src/lib/libcrypto/rand/randfile.c
@@ -99,12 +99,11 @@ int RAND_load_file(const char *file, long bytes)
99 if (file == NULL) return(0); 99 if (file == NULL) return(0);
100 100
101 i=stat(file,&sb); 101 i=stat(file,&sb);
102 if (i < 0) { 102 /* If the state fails, put some crap in anyway */
103 /* If the state fails, put some crap in anyway */ 103 RAND_add(&sb,sizeof(sb),0);
104 RAND_add(&sb,sizeof(sb),0); 104 if (i < 0) return(0);
105 return(0);
106 }
107 if (bytes == 0) return(ret); 105 if (bytes == 0) return(ret);
106
108 in=fopen(file,"rb"); 107 in=fopen(file,"rb");
109 if (in == NULL) goto err; 108 if (in == NULL) goto err;
110 if (sb.st_mode & (S_IFBLK | S_IFCHR)) { 109 if (sb.st_mode & (S_IFBLK | S_IFCHR)) {
@@ -218,12 +217,12 @@ err:
218 217
219const char *RAND_file_name(char *buf, size_t size) 218const char *RAND_file_name(char *buf, size_t size)
220 { 219 {
221 char *s = NULL; 220 char *s=NULL;
222 int ok = 0; 221 int ok = 0;
223 struct stat sb; 222 struct stat sb;
224 223
225 if (issetugid() == 0) 224 if (issetugid() == 0)
226 s = getenv("RANDFILE"); 225 s=getenv("RANDFILE");
227 if (s != NULL && *s && strlen(s) + 1 < size) 226 if (s != NULL && *s && strlen(s) + 1 < size)
228 { 227 {
229 strlcpy(buf,s,size); 228 strlcpy(buf,s,size);
@@ -272,4 +271,3 @@ const char *RAND_file_name(char *buf, size_t size)
272#endif 271#endif
273 return(buf); 272 return(buf);
274 } 273 }
275
diff --git a/src/lib/libcrypto/util/domd b/src/lib/libcrypto/util/domd
index 8cbe383c16..aa99cb0523 100644
--- a/src/lib/libcrypto/util/domd
+++ b/src/lib/libcrypto/util/domd
@@ -18,11 +18,11 @@ if [ "$MAKEDEPEND" = "gcc" ]; then
18 sed -e '/^# DO NOT DELETE.*/,$d' < Makefile.ssl > Makefile.tmp 18 sed -e '/^# DO NOT DELETE.*/,$d' < Makefile.ssl > Makefile.tmp
19 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp 19 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
20 gcc -D OPENSSL_DOING_MAKEDEPEND -M $@ >> Makefile.tmp 20 gcc -D OPENSSL_DOING_MAKEDEPEND -M $@ >> Makefile.tmp
21 ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new 21 perl $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
22 rm -f Makefile.tmp 22 rm -f Makefile.tmp
23else 23else
24 ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND -f Makefile.ssl $@ 24 ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND -f Makefile.ssl $@
25 ${PERL} $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new 25 perl $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new
26fi 26fi
27mv Makefile.new Makefile.ssl 27mv Makefile.new Makefile.ssl
28# unfake the presence of Kerberos 28# unfake the presence of Kerberos
diff --git a/src/lib/libssl/crypto/Makefile b/src/lib/libssl/crypto/Makefile
index 15c310f2ee..490ce259c6 100644
--- a/src/lib/libssl/crypto/Makefile
+++ b/src/lib/libssl/crypto/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.25 2002/09/03 18:59:55 markus Exp $ 1# $OpenBSD: Makefile,v 1.26 2002/09/05 22:12:11 markus Exp $
2 2
3LIB= crypto 3LIB= crypto
4 4
@@ -29,7 +29,7 @@ CFLAGS+= -DOPENSSL_NO_RC5 -DOPENSSL_NO_KRB5 -DSO_DLFCN -DHAVE_DLFCN_H
29CFLAGS+= -DNO_WINDOWS_BRAINDEATH 29CFLAGS+= -DNO_WINDOWS_BRAINDEATH
30CFLAGS+= -DOPENSSL_NO_HW_CSWIFT -DOPENSSL_NO_HW_NCIPHER -DOPENSSL_NO_HW_ATALLA 30CFLAGS+= -DOPENSSL_NO_HW_CSWIFT -DOPENSSL_NO_HW_NCIPHER -DOPENSSL_NO_HW_ATALLA
31CFLAGS+= -DOPENSSL_NO_HW_NURON -DOPENSSL_NO_HW_UBSEC -DOPENSSL_NO_HW_AEP 31CFLAGS+= -DOPENSSL_NO_HW_NURON -DOPENSSL_NO_HW_UBSEC -DOPENSSL_NO_HW_AEP
32CFLAGS+= -DOPENSSL_NO_HW_SUREWARE 32CFLAGS+= -DOPENSSL_NO_HW_SUREWARE -DOPENSSL_NO_HW_4758_CCA
33CFLAGS+= -I${.CURDIR}/../${SSLEAYDIST} 33CFLAGS+= -I${.CURDIR}/../${SSLEAYDIST}
34CFLAGS+= -I${LCRYPTO_SRC} 34CFLAGS+= -I${LCRYPTO_SRC}
35SRCS+= o_time.c 35SRCS+= o_time.c
@@ -282,11 +282,13 @@ includes: obj_mac.h
282CFLAGS+= -I${.OBJDIR} 282CFLAGS+= -I${.OBJDIR}
283 283
284GENERATED=obj_mac.h obj_dat.h 284GENERATED=obj_mac.h obj_dat.h
285CLEANFILES=${GENERATED} 285CLEANFILES=${GENERATED} obj_mac.num.tmp
286SSL_OBJECTS=${SSL_SRC}/crypto/objects 286SSL_OBJECTS=${SSL_SRC}/crypto/objects
287 287
288obj_mac.h: ${SSL_OBJECTS}/objects.h 288obj_mac.h: ${SSL_OBJECTS}/objects.h ${SSL_OBJECTS}/obj_mac.num ${SSL_OBJECTS}/objects.txt
289 /usr/bin/perl ${SSL_OBJECTS}/objects.pl ${SSL_OBJECTS}/objects.txt ${SSL_OBJECTS}/obj_mac.num obj_mac.h 289 cat ${SSL_OBJECTS}/obj_mac.num > obj_mac.num.tmp
290 /usr/bin/perl ${SSL_OBJECTS}/objects.pl ${SSL_OBJECTS}/objects.txt obj_mac.num.tmp obj_mac.h
291
290obj_dat.h: obj_mac.h 292obj_dat.h: obj_mac.h
291 /usr/bin/perl ${SSL_OBJECTS}/obj_dat.pl obj_mac.h obj_dat.h 293 /usr/bin/perl ${SSL_OBJECTS}/obj_dat.pl obj_mac.h obj_dat.h
292 294
diff --git a/src/lib/libssl/s3_srvr.c b/src/lib/libssl/s3_srvr.c
index dfffed7165..cef8d4f81e 100644
--- a/src/lib/libssl/s3_srvr.c
+++ b/src/lib/libssl/s3_srvr.c
@@ -114,8 +114,6 @@
114 114
115 115
116#include <stdio.h> 116#include <stdio.h>
117#include "ssl_locl.h"
118#include "kssl_lcl.h"
119#include <openssl/buffer.h> 117#include <openssl/buffer.h>
120#include <openssl/rand.h> 118#include <openssl/rand.h>
121#include <openssl/objects.h> 119#include <openssl/objects.h>
@@ -123,8 +121,10 @@
123#include <openssl/x509.h> 121#include <openssl/x509.h>
124#ifndef OPENSSL_NO_KRB5 122#ifndef OPENSSL_NO_KRB5
125#include <openssl/krb5_asn.h> 123#include <openssl/krb5_asn.h>
124#include "kssl_lcl.h"
126#endif 125#endif
127#include <openssl/md5.h> 126#include <openssl/md5.h>
127#include "ssl_locl.h"
128 128
129static SSL_METHOD *ssl3_get_server_method(int ver); 129static SSL_METHOD *ssl3_get_server_method(int ver);
130static int ssl3_get_client_hello(SSL *s); 130static int ssl3_get_client_hello(SSL *s);
diff --git a/src/lib/libssl/src/Configure b/src/lib/libssl/src/Configure
index 0976f41f8d..986db2f614 100644
--- a/src/lib/libssl/src/Configure
+++ b/src/lib/libssl/src/Configure
@@ -366,6 +366,9 @@ my %table=(
366"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", 366"linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
367"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", 367"linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN -DTERMIO::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
368 368
369# assembler versions -- currently defunct:
370##"OpenBSD-alpha","gcc:-DTERMIOS -O3 -fomit-frame-pointer:::(unknown):SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${alpha_asm}",
371
369# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the 372# The intel boxes :-), It would be worth seeing if bsdi-gcc can use the
370# bn86-elf.o file file since it is hand tweaked assembler. 373# bn86-elf.o file file since it is hand tweaked assembler.
371"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 374"linux-elf", "gcc:-DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
diff --git a/src/lib/libssl/src/Makefile.org b/src/lib/libssl/src/Makefile.org
index 799c370cb6..71c196b1e6 100644
--- a/src/lib/libssl/src/Makefile.org
+++ b/src/lib/libssl/src/Makefile.org
@@ -35,8 +35,6 @@ OPENSSLDIR=/usr/local/ssl
35# DEVRANDOM - Give this the value of the 'random device' if your OS supports 35# DEVRANDOM - Give this the value of the 'random device' if your OS supports
36# one. 32 bytes will be read from this when the random 36# one. 32 bytes will be read from this when the random
37# number generator is initalised. 37# number generator is initalised.
38# SSL_ALLOW_ADH - define if you want the server to be able to use the
39# SSLv3 anon-DH ciphers.
40# SSL_FORBID_ENULL - define if you want the server to be not able to use the 38# SSL_FORBID_ENULL - define if you want the server to be not able to use the
41# NULL encryption ciphers. 39# NULL encryption ciphers.
42# 40#
@@ -734,21 +732,21 @@ install_docs:
734 fn=`basename $$i .pod`; \ 732 fn=`basename $$i .pod`; \
735 if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \ 733 if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
736 echo "installing man$$sec/`basename $$i .pod`.$$sec"; \ 734 echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
737 (cd `$(PERL) util/dirname.pl $$i`; \ 735 (cd `dirname $$i`; \
738 sh -c "`cd ../../util; ./pod2mantest ignore` \ 736 sh -c "`cd ../../util; ./pod2mantest ignore` \
739 --section=$$sec --center=OpenSSL \ 737 --section=$$sec --center=OpenSSL \
740 --release=$(VERSION) `basename $$i`") \ 738 --release=$(VERSION) `basename $$i`") \
741 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec); \ 739 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
742 done 740 done
743 @for i in doc/crypto/*.pod doc/ssl/*.pod; do \ 741 @for i in doc/crypto/*.pod doc/ssl/*.pod; do \
744 fn=`basename $$i .pod`; \ 742 fn=`basename $$i .pod`; \
745 if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \ 743 if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
746 echo "installing man$$sec/`basename $$i .pod`.$$sec"; \ 744 echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
747 (cd `$(PERL) util/dirname.pl $$i`; \ 745 (cd `dirname $$i`; \
748 sh -c "`cd ../../util; ./pod2mantest ignore` \ 746 sh -c "`cd ../../util; ./pod2mantest ignore` \
749 --section=$$sec --center=OpenSSL \ 747 --section=$$sec --center=OpenSSL \
750 --release=$(VERSION) `basename $$i`") \ 748 --release=$(VERSION) `basename $$i`") \
751 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec); \ 749 > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
752 done 750 done
753 751
754# DO NOT DELETE THIS LINE -- make depend depends on it. 752# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/src/lib/libssl/src/apps/speed.c b/src/lib/libssl/src/apps/speed.c
index 3f55e26bdd..fea0ffe2cf 100644
--- a/src/lib/libssl/src/apps/speed.c
+++ b/src/lib/libssl/src/apps/speed.c
@@ -1627,7 +1627,7 @@ show_res:
1627#endif 1627#endif
1628#ifdef HZ 1628#ifdef HZ
1629#define as_string(s) (#s) 1629#define as_string(s) (#s)
1630 printf("HZ=%g", HZ); 1630 printf("HZ=%g", (double)HZ);
1631# ifdef _SC_CLK_TCK 1631# ifdef _SC_CLK_TCK
1632 printf(" [sysconf value]"); 1632 printf(" [sysconf value]");
1633# endif 1633# endif
diff --git a/src/lib/libssl/src/crypto/asn1/a_utctm.c b/src/lib/libssl/src/crypto/asn1/a_utctm.c
index dbb4a42c9d..ed2d827db2 100644
--- a/src/lib/libssl/src/crypto/asn1/a_utctm.c
+++ b/src/lib/libssl/src/crypto/asn1/a_utctm.c
@@ -222,7 +222,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t)
222int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) 222int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
223 { 223 {
224 struct tm *tm; 224 struct tm *tm;
225 struct tm data;
226 int offset; 225 int offset;
227 int year; 226 int year;
228 227
@@ -239,7 +238,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t)
239 238
240 t -= offset*60; /* FIXME: may overflow in extreme cases */ 239 t -= offset*60; /* FIXME: may overflow in extreme cases */
241 240
242 tm = OPENSSL_gmtime(&t, &data); 241 { struct tm data; tm = OPENSSL_gmtime(&t, &data); }
243 242
244#define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 243#define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1
245 year = g2(s->data); 244 year = g2(s->data);
diff --git a/src/lib/libssl/src/crypto/des/fcrypt.c b/src/lib/libssl/src/crypto/des/fcrypt.c
index 387d97f28d..2758c32656 100644
--- a/src/lib/libssl/src/crypto/des/fcrypt.c
+++ b/src/lib/libssl/src/crypto/des/fcrypt.c
@@ -1,5 +1,13 @@
1/* NOCW */ 1/* NOCW */
2#include <stdio.h> 2#include <stdio.h>
3#ifdef _OSD_POSIX
4#ifndef CHARSET_EBCDIC
5#define CHARSET_EBCDIC 1
6#endif
7#endif
8#ifdef CHARSET_EBCDIC
9#include <openssl/ebcdic.h>
10#endif
3 11
4/* This version of crypt has been developed from my MIT compatible 12/* This version of crypt has been developed from my MIT compatible
5 * DES library. 13 * DES library.
diff --git a/src/lib/libssl/src/crypto/des/read_pwd.c b/src/lib/libssl/src/crypto/des/read_pwd.c
index 54e0e2e6b6..00000190f8 100644
--- a/src/lib/libssl/src/crypto/des/read_pwd.c
+++ b/src/lib/libssl/src/crypto/des/read_pwd.c
@@ -211,7 +211,7 @@ static int noecho_fgets(char *buf, int size, FILE *tty);
211#endif 211#endif
212static jmp_buf save; 212static jmp_buf save;
213 213
214int _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt, 214int des_read_pw_string(char *buf, int length, const char *prompt,
215 int verify) 215 int verify)
216 { 216 {
217 char buff[BUFSIZ]; 217 char buff[BUFSIZ];
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_key.c b/src/lib/libssl/src/crypto/dsa/dsa_key.c
index bf718c1c6d..ef87c3e637 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_key.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_key.c
@@ -64,8 +64,6 @@
64#include <openssl/dsa.h> 64#include <openssl/dsa.h>
65#include <openssl/rand.h> 65#include <openssl/rand.h>
66 66
67extern int __BN_rand_range(BIGNUM *r, BIGNUM *range);
68
69int DSA_generate_key(DSA *dsa) 67int DSA_generate_key(DSA *dsa)
70 { 68 {
71 int ok=0; 69 int ok=0;
@@ -82,7 +80,7 @@ int DSA_generate_key(DSA *dsa)
82 priv_key=dsa->priv_key; 80 priv_key=dsa->priv_key;
83 81
84 do 82 do
85 if (!__BN_rand_range(priv_key,dsa->q)) goto err; 83 if (!BN_rand_range(priv_key,dsa->q)) goto err;
86 while (BN_is_zero(priv_key)); 84 while (BN_is_zero(priv_key));
87 85
88 if (dsa->pub_key == NULL) 86 if (dsa->pub_key == NULL)
diff --git a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
index 07addc94d9..37dd5fc994 100644
--- a/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
+++ b/src/lib/libssl/src/crypto/dsa/dsa_ossl.c
@@ -66,8 +66,6 @@
66#include <openssl/asn1.h> 66#include <openssl/asn1.h>
67#include <openssl/engine.h> 67#include <openssl/engine.h>
68 68
69int __BN_rand_range(BIGNUM *r, BIGNUM *range);
70
71static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); 69static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
72static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); 70static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
73static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, 71static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
@@ -193,7 +191,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
193 191
194 /* Get random k */ 192 /* Get random k */
195 do 193 do
196 if (!__BN_rand_range(&k, dsa->q)) goto err; 194 if (!BN_rand_range(&k, dsa->q)) goto err;
197 while (BN_is_zero(&k)); 195 while (BN_is_zero(&k));
198 196
199 if ((dsa->method_mont_p == NULL) && (dsa->flags & DSA_FLAG_CACHE_MONT_P)) 197 if ((dsa->method_mont_p == NULL) && (dsa->flags & DSA_FLAG_CACHE_MONT_P))
@@ -344,55 +342,3 @@ static int dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
344{ 342{
345 return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx); 343 return BN_mod_exp_mont(r, a, p, m, ctx, m_ctx);
346} 344}
347
348
349/* random number r: 0 <= r < range */
350int __BN_rand_range(BIGNUM *r, BIGNUM *range)
351 {
352 int n;
353
354 if (range->neg || BN_is_zero(range))
355 {
356 /* BNerr(BN_F_BN_RAND_RANGE, BN_R_INVALID_RANGE); */
357 return 0;
358 }
359
360 n = BN_num_bits(range); /* n > 0 */
361
362 if (n == 1)
363 {
364 if (!BN_zero(r)) return 0;
365 }
366 else if (BN_is_bit_set(range, n - 2))
367 {
368 do
369 {
370 /* range = 11..._2, so each iteration succeeds with probability >= .75 */
371 if (!BN_rand(r, n, -1, 0)) return 0;
372 }
373 while (BN_cmp(r, range) >= 0);
374 }
375 else
376 {
377 /* range = 10..._2,
378 * so 3*range (= 11..._2) is exactly one bit longer than range */
379 do
380 {
381 if (!BN_rand(r, n + 1, -1, 0)) return 0;
382 /* If r < 3*range, use r := r MOD range
383 * (which is either r, r - range, or r - 2*range).
384 * Otherwise, iterate once more.
385 * Since 3*range = 11..._2, each iteration succeeds with
386 * probability >= .75. */
387 if (BN_cmp(r ,range) >= 0)
388 {
389 if (!BN_sub(r, r, range)) return 0;
390 if (BN_cmp(r, range) >= 0)
391 if (!BN_sub(r, r, range)) return 0;
392 }
393 }
394 while (BN_cmp(r, range) >= 0);
395 }
396
397 return 1;
398 }
diff --git a/src/lib/libssl/src/crypto/engine/Makefile.ssl b/src/lib/libssl/src/crypto/engine/Makefile.ssl
index 8ee3b7d2dd..5172028f93 100644
--- a/src/lib/libssl/src/crypto/engine/Makefile.ssl
+++ b/src/lib/libssl/src/crypto/engine/Makefile.ssl
@@ -74,7 +74,7 @@ tags:
74 74
75errors: 75errors:
76 $(PERL) $(TOP)/util/mkerr.pl -conf hw.ec \ 76 $(PERL) $(TOP)/util/mkerr.pl -conf hw.ec \
77 -nostatic -staticloader -write hw_*.c 77 -nostatic -staticloader -write hw_*.c; \
78 78
79tests: 79tests:
80 80
diff --git a/src/lib/libssl/src/crypto/engine/eng_all.c b/src/lib/libssl/src/crypto/engine/eng_all.c
index a35b3db9e8..bc50465422 100644
--- a/src/lib/libssl/src/crypto/engine/eng_all.c
+++ b/src/lib/libssl/src/crypto/engine/eng_all.c
@@ -96,6 +96,9 @@ void ENGINE_load_builtin_engines(void)
96#ifndef OPENSSL_NO_HW_SUREWARE 96#ifndef OPENSSL_NO_HW_SUREWARE
97 ENGINE_load_sureware(); 97 ENGINE_load_sureware();
98#endif 98#endif
99#ifndef OPENSSL_NO_HW_4758_CCA
100 ENGINE_load_4758cca();
101#endif
99#ifdef OPENSSL_OPENBSD_DEV_CRYPTO 102#ifdef OPENSSL_OPENBSD_DEV_CRYPTO
100 ENGINE_load_openbsd_dev_crypto(); 103 ENGINE_load_openbsd_dev_crypto();
101#endif 104#endif
@@ -114,5 +117,3 @@ void ENGINE_setup_openbsd(void) {
114 openbsd_default_loaded=1; 117 openbsd_default_loaded=1;
115} 118}
116#endif 119#endif
117
118
diff --git a/src/lib/libssl/src/crypto/engine/engine.h b/src/lib/libssl/src/crypto/engine/engine.h
index 97f5de9e12..fd17ff616d 100644
--- a/src/lib/libssl/src/crypto/engine/engine.h
+++ b/src/lib/libssl/src/crypto/engine/engine.h
@@ -312,7 +312,7 @@ void ENGINE_load_builtin_engines(void);
312#ifdef __OpenBSD__ 312#ifdef __OpenBSD__
313void ENGINE_load_cryptodev(void); 313void ENGINE_load_cryptodev(void);
314#endif 314#endif
315 315
316/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation 316/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
317 * "registry" handling. */ 317 * "registry" handling. */
318unsigned int ENGINE_get_table_flags(void); 318unsigned int ENGINE_get_table_flags(void);
diff --git a/src/lib/libssl/src/crypto/evp/evp_test.c b/src/lib/libssl/src/crypto/evp/evp_test.c
index 90294ef686..1bfffb34cf 100644
--- a/src/lib/libssl/src/crypto/evp/evp_test.c
+++ b/src/lib/libssl/src/crypto/evp/evp_test.c
@@ -118,7 +118,7 @@ static char *sstrsep(char **string, const char *delim)
118 } 118 }
119 119
120static unsigned char *ustrsep(char **p,const char *sep) 120static unsigned char *ustrsep(char **p,const char *sep)
121 { return (unsigned char *)sstrsep(p,sep); } 121 { return (unsigned char *)sstrsep((char **)p,sep); }
122 122
123static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn, 123static void test1(const EVP_CIPHER *c,const unsigned char *key,int kn,
124 const unsigned char *iv,int in, 124 const unsigned char *iv,int in,
@@ -358,7 +358,7 @@ int main(int argc,char **argv)
358 p[-1] = '\0'; 358 p[-1] = '\0';
359 encdec = -1; 359 encdec = -1;
360 } else { 360 } else {
361 encdec = atoi(sstrsep(&p,"\n")); 361 encdec = atoi(strsep(&p,"\n"));
362 } 362 }
363 363
364 364
diff --git a/src/lib/libssl/src/crypto/objects/Makefile.ssl b/src/lib/libssl/src/crypto/objects/Makefile.ssl
index 1e990107d3..a9f01ffc0d 100644
--- a/src/lib/libssl/src/crypto/objects/Makefile.ssl
+++ b/src/lib/libssl/src/crypto/objects/Makefile.ssl
@@ -15,6 +15,7 @@ MAKEDEPPROG= makedepend
15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) 15MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
16MAKEFILE= Makefile.ssl 16MAKEFILE= Makefile.ssl
17AR= ar r 17AR= ar r
18PERL= perl
18 19
19CFLAGS= $(INCLUDES) $(CFLAG) 20CFLAGS= $(INCLUDES) $(CFLAG)
20 21
diff --git a/src/lib/libssl/src/crypto/objects/obj_dat.pl b/src/lib/libssl/src/crypto/objects/obj_dat.pl
index 85ab209809..d0371661f9 100644
--- a/src/lib/libssl/src/crypto/objects/obj_dat.pl
+++ b/src/lib/libssl/src/crypto/objects/obj_dat.pl
@@ -1,4 +1,7 @@
1#!/usr/local/bin/perl 1#!/usr/local/bin/perl
2
3# fixes bug in floating point emulation on sparc64 when
4# this script produces off-by-one output on sparc64
2use integer; 5use integer;
3 6
4sub obj_cmp 7sub obj_cmp
diff --git a/src/lib/libssl/src/crypto/rand/randfile.c b/src/lib/libssl/src/crypto/rand/randfile.c
index 4b221e08f5..1c3e68ef31 100644
--- a/src/lib/libssl/src/crypto/rand/randfile.c
+++ b/src/lib/libssl/src/crypto/rand/randfile.c
@@ -99,12 +99,11 @@ int RAND_load_file(const char *file, long bytes)
99 if (file == NULL) return(0); 99 if (file == NULL) return(0);
100 100
101 i=stat(file,&sb); 101 i=stat(file,&sb);
102 if (i < 0) { 102 /* If the state fails, put some crap in anyway */
103 /* If the state fails, put some crap in anyway */ 103 RAND_add(&sb,sizeof(sb),0);
104 RAND_add(&sb,sizeof(sb),0); 104 if (i < 0) return(0);
105 return(0);
106 }
107 if (bytes == 0) return(ret); 105 if (bytes == 0) return(ret);
106
108 in=fopen(file,"rb"); 107 in=fopen(file,"rb");
109 if (in == NULL) goto err; 108 if (in == NULL) goto err;
110 if (sb.st_mode & (S_IFBLK | S_IFCHR)) { 109 if (sb.st_mode & (S_IFBLK | S_IFCHR)) {
@@ -218,12 +217,12 @@ err:
218 217
219const char *RAND_file_name(char *buf, size_t size) 218const char *RAND_file_name(char *buf, size_t size)
220 { 219 {
221 char *s = NULL; 220 char *s=NULL;
222 int ok = 0; 221 int ok = 0;
223 struct stat sb; 222 struct stat sb;
224 223
225 if (issetugid() == 0) 224 if (issetugid() == 0)
226 s = getenv("RANDFILE"); 225 s=getenv("RANDFILE");
227 if (s != NULL && *s && strlen(s) + 1 < size) 226 if (s != NULL && *s && strlen(s) + 1 < size)
228 { 227 {
229 strlcpy(buf,s,size); 228 strlcpy(buf,s,size);
@@ -272,4 +271,3 @@ const char *RAND_file_name(char *buf, size_t size)
272#endif 271#endif
273 return(buf); 272 return(buf);
274 } 273 }
275
diff --git a/src/lib/libssl/src/demos/easy_tls/Makefile b/src/lib/libssl/src/demos/easy_tls/Makefile
index fd3c246ef4..32a79c4cc9 100644
--- a/src/lib/libssl/src/demos/easy_tls/Makefile
+++ b/src/lib/libssl/src/demos/easy_tls/Makefile
@@ -1,5 +1,5 @@
1# Makefile for easy-tls example application (rudimentary client and server) 1# Makefile for easy-tls example application (rudimentary client and server)
2# $Id: Makefile,v 1.1 2002/05/15 02:29:18 beck Exp $ 2# $Id: Makefile,v 1.2 2002/09/05 22:12:11 markus Exp $
3 3
4SOLARIS_CFLAGS=-Wall -pedantic -g -O2 4SOLARIS_CFLAGS=-Wall -pedantic -g -O2
5SOLARIS_LIBS=-lxnet 5SOLARIS_LIBS=-lxnet
diff --git a/src/lib/libssl/src/demos/easy_tls/cacerts.pem b/src/lib/libssl/src/demos/easy_tls/cacerts.pem
index 0b1c91f95e..036e3c3dc0 100644
--- a/src/lib/libssl/src/demos/easy_tls/cacerts.pem
+++ b/src/lib/libssl/src/demos/easy_tls/cacerts.pem
@@ -1,4 +1,4 @@
1$Id: cacerts.pem,v 1.1 2002/05/15 02:29:18 beck Exp $ 1$Id: cacerts.pem,v 1.2 2002/09/05 22:12:11 markus Exp $
2 2
3issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) 3issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit)
4subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) 4subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit)
diff --git a/src/lib/libssl/src/demos/easy_tls/cert.pem b/src/lib/libssl/src/demos/easy_tls/cert.pem
index d4d19d9ad1..ab38de65e7 100644
--- a/src/lib/libssl/src/demos/easy_tls/cert.pem
+++ b/src/lib/libssl/src/demos/easy_tls/cert.pem
@@ -1,4 +1,4 @@
1$Id: cert.pem,v 1.1 2002/05/15 02:29:18 beck Exp $ 1$Id: cert.pem,v 1.2 2002/09/05 22:12:11 markus Exp $
2 2
3Example certificate and key. 3Example certificate and key.
4 4
diff --git a/src/lib/libssl/src/demos/easy_tls/easy-tls.c b/src/lib/libssl/src/demos/easy_tls/easy-tls.c
index 9fa0ef9a6b..70f7ae3c11 100644
--- a/src/lib/libssl/src/demos/easy_tls/easy-tls.c
+++ b/src/lib/libssl/src/demos/easy_tls/easy-tls.c
@@ -1,7 +1,7 @@
1/* -*- Mode: C; c-file-style: "bsd" -*- */ 1/* -*- Mode: C; c-file-style: "bsd" -*- */
2/* 2/*
3 * easy-tls.c -- generic TLS proxy. 3 * easy-tls.c -- generic TLS proxy.
4 * $Id: easy-tls.c,v 1.1 2002/05/15 02:29:18 beck Exp $ 4 * $Id: easy-tls.c,v 1.2 2002/09/05 22:12:11 markus Exp $
5 */ 5 */
6/* 6/*
7 (c) Copyright 1999 Bodo Moeller. All rights reserved. 7 (c) Copyright 1999 Bodo Moeller. All rights reserved.
@@ -73,7 +73,7 @@
73 */ 73 */
74 74
75static char const rcsid[] = 75static char const rcsid[] =
76"$Id: easy-tls.c,v 1.1 2002/05/15 02:29:18 beck Exp $"; 76"$Id: easy-tls.c,v 1.2 2002/09/05 22:12:11 markus Exp $";
77 77
78#include <assert.h> 78#include <assert.h>
79#include <errno.h> 79#include <errno.h>
@@ -567,8 +567,13 @@ no_passphrase_callback(char *buf, int num, int w, void *arg)
567 return -1; 567 return -1;
568} 568}
569 569
570#if OPENSSL_VERSION_NUMBER >= 0x00907000L
570static int 571static int
571verify_dont_fail_cb(X509_STORE_CTX *c, void *unused_arg) 572verify_dont_fail_cb(X509_STORE_CTX *c, void *unused_arg)
573#else
574static int
575verify_dont_fail_cb(X509_STORE_CTX *c)
576#endif
572{ 577{
573 int i; 578 int i;
574 579
diff --git a/src/lib/libssl/src/demos/easy_tls/easy-tls.h b/src/lib/libssl/src/demos/easy_tls/easy-tls.h
index 0cfbd8fe7b..3133200443 100644
--- a/src/lib/libssl/src/demos/easy_tls/easy-tls.h
+++ b/src/lib/libssl/src/demos/easy_tls/easy-tls.h
@@ -1,7 +1,7 @@
1/* -*- Mode: C; c-file-style: "bsd" -*- */ 1/* -*- Mode: C; c-file-style: "bsd" -*- */
2/* 2/*
3 * easy-tls.h -- generic TLS proxy. 3 * easy-tls.h -- generic TLS proxy.
4 * $Id: easy-tls.h,v 1.1 2002/05/15 02:29:18 beck Exp $ 4 * $Id: easy-tls.h,v 1.2 2002/09/05 22:12:11 markus Exp $
5 */ 5 */
6/* 6/*
7 * (c) Copyright 1999 Bodo Moeller. All rights reserved. 7 * (c) Copyright 1999 Bodo Moeller. All rights reserved.
diff --git a/src/lib/libssl/src/demos/easy_tls/test.c b/src/lib/libssl/src/demos/easy_tls/test.c
index 4ce676ca93..f86141d1d8 100644
--- a/src/lib/libssl/src/demos/easy_tls/test.c
+++ b/src/lib/libssl/src/demos/easy_tls/test.c
@@ -1,5 +1,5 @@
1/* test.c */ 1/* test.c */
2/* $Id: test.c,v 1.1 2002/05/15 02:29:18 beck Exp $ */ 2/* $Id: test.c,v 1.2 2002/09/05 22:12:11 markus Exp $ */
3 3
4#define L_PORT 9999 4#define L_PORT 9999
5#define C_PORT 443 5#define C_PORT 443
diff --git a/src/lib/libssl/src/demos/easy_tls/test.h b/src/lib/libssl/src/demos/easy_tls/test.h
index c580169464..575391c00b 100644
--- a/src/lib/libssl/src/demos/easy_tls/test.h
+++ b/src/lib/libssl/src/demos/easy_tls/test.h
@@ -1,5 +1,5 @@
1/* test.h */ 1/* test.h */
2/* $Id: test.h,v 1.1 2002/05/15 02:29:18 beck Exp $ */ 2/* $Id: test.h,v 1.2 2002/09/05 22:12:11 markus Exp $ */
3 3
4 4
5void test_process_init(int fd, int client_p, void *apparg); 5void test_process_init(int fd, int client_p, void *apparg);
diff --git a/src/lib/libssl/src/doc/crypto/des_modes.pod b/src/lib/libssl/src/doc/crypto/des_modes.pod
index dc17942f97..0cc22150e7 100644
--- a/src/lib/libssl/src/doc/crypto/des_modes.pod
+++ b/src/lib/libssl/src/doc/crypto/des_modes.pod
@@ -204,8 +204,8 @@ just one key.
204=item * 204=item *
205 205
206If the first and last key are the same, the key length is 112 bits. 206If the first and last key are the same, the key length is 112 bits.
207There are attacks that could reduce the key space to 55 bit's but it 207There are attacks that could reduce the effective key strength
208requires 2^56 blocks of memory. 208to only slightly more than 56 bits, but these require a lot of memory.
209 209
210=item * 210=item *
211 211
diff --git a/src/lib/libssl/src/e_os.h b/src/lib/libssl/src/e_os.h
index 055c1b0e29..f216936e18 100644
--- a/src/lib/libssl/src/e_os.h
+++ b/src/lib/libssl/src/e_os.h
@@ -79,7 +79,7 @@ extern "C" {
79#ifndef DEVRANDOM 79#ifndef DEVRANDOM
80/* set this to a comma-separated list of 'random' device files to try out. 80/* set this to a comma-separated list of 'random' device files to try out.
81 * My default, we will try to read at least one of these files */ 81 * My default, we will try to read at least one of these files */
82#define DEVRANDOM "/dev/arandom","/dev/urandom","/dev/random","/dev/srandom" 82#define DEVRANDOM "/dev/urandom","/dev/random","/dev/srandom"
83#endif 83#endif
84#ifndef DEVRANDOM_EGD 84#ifndef DEVRANDOM_EGD
85/* set this to a comma-seperated list of 'egd' sockets to try out. These 85/* set this to a comma-seperated list of 'egd' sockets to try out. These
diff --git a/src/lib/libssl/src/ssl/s3_srvr.c b/src/lib/libssl/src/ssl/s3_srvr.c
index dfffed7165..cef8d4f81e 100644
--- a/src/lib/libssl/src/ssl/s3_srvr.c
+++ b/src/lib/libssl/src/ssl/s3_srvr.c
@@ -114,8 +114,6 @@
114 114
115 115
116#include <stdio.h> 116#include <stdio.h>
117#include "ssl_locl.h"
118#include "kssl_lcl.h"
119#include <openssl/buffer.h> 117#include <openssl/buffer.h>
120#include <openssl/rand.h> 118#include <openssl/rand.h>
121#include <openssl/objects.h> 119#include <openssl/objects.h>
@@ -123,8 +121,10 @@
123#include <openssl/x509.h> 121#include <openssl/x509.h>
124#ifndef OPENSSL_NO_KRB5 122#ifndef OPENSSL_NO_KRB5
125#include <openssl/krb5_asn.h> 123#include <openssl/krb5_asn.h>
124#include "kssl_lcl.h"
126#endif 125#endif
127#include <openssl/md5.h> 126#include <openssl/md5.h>
127#include "ssl_locl.h"
128 128
129static SSL_METHOD *ssl3_get_server_method(int ver); 129static SSL_METHOD *ssl3_get_server_method(int ver);
130static int ssl3_get_client_hello(SSL *s); 130static int ssl3_get_client_hello(SSL *s);
diff --git a/src/lib/libssl/src/ssl/ssl_locl.h b/src/lib/libssl/src/ssl/ssl_locl.h
index 0029edc3a6..6afb0f4cdf 100644
--- a/src/lib/libssl/src/ssl/ssl_locl.h
+++ b/src/lib/libssl/src/ssl/ssl_locl.h
@@ -116,7 +116,7 @@
116#include <string.h> 116#include <string.h>
117#include <errno.h> 117#include <errno.h>
118 118
119#include <e_os.h> 119#include "e_os.h"
120 120
121#include <openssl/buffer.h> 121#include <openssl/buffer.h>
122#include <openssl/comp.h> 122#include <openssl/comp.h>
diff --git a/src/lib/libssl/src/test/Makefile.ssl b/src/lib/libssl/src/test/Makefile.ssl
index 952ab16371..49f2cc9a23 100644
--- a/src/lib/libssl/src/test/Makefile.ssl
+++ b/src/lib/libssl/src/test/Makefile.ssl
@@ -14,6 +14,7 @@ MAKEFILE= Makefile.ssl
14MAKE= make -f $(MAKEFILE) 14MAKE= make -f $(MAKEFILE)
15MAKEDEPPROG= makedepend 15MAKEDEPPROG= makedepend
16MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) 16MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
17PERL= perl
17 18
18PEX_LIBS= 19PEX_LIBS=
19EX_LIBS= #-lnsl -lsocket 20EX_LIBS= #-lnsl -lsocket
@@ -234,7 +235,7 @@ test_gen:
234 @echo "Generate and verify a certificate request" 235 @echo "Generate and verify a certificate request"
235 @sh ./testgen 236 @sh ./testgen
236 237
237test_ss: 238test_ss keyU.ss certU.ss certCA.ss: testss
238 @echo "Generate and certify a test certificate" 239 @echo "Generate and certify a test certificate"
239 @sh ./testss 240 @sh ./testss
240 241
@@ -242,13 +243,17 @@ test_engine:
242 @echo "Manipulate the ENGINE structures" 243 @echo "Manipulate the ENGINE structures"
243 ./$(ENGINETEST) 244 ./$(ENGINETEST)
244 245
245test_ssl: 246test_ssl: keyU.ss certU.ss certCA.ss
246 @echo "test SSL protocol" 247 @echo "test SSL protocol"
247 @sh ./testssl 248 @sh ./testssl keyU.ss certU.ss certCA.ss
248 249
249test_ca: 250test_ca:
250 @echo "Generate and certify a test certificate via the 'ca' program" 251 @if ../apps/openssl no-rsa; then \
251 @sh ./testca 252 echo "skipping CA.sh test -- requires RSA"; \
253 else \
254 echo "Generate and certify a test certificate via the 'ca' program"; \
255 sh ./testca; \
256 fi
252 257
253test_rd: #$(RDTEST) 258test_rd: #$(RDTEST)
254# @echo "test Rijndael" 259# @echo "test Rijndael"
diff --git a/src/lib/libssl/src/util/domd b/src/lib/libssl/src/util/domd
index 8cbe383c16..aa99cb0523 100644
--- a/src/lib/libssl/src/util/domd
+++ b/src/lib/libssl/src/util/domd
@@ -18,11 +18,11 @@ if [ "$MAKEDEPEND" = "gcc" ]; then
18 sed -e '/^# DO NOT DELETE.*/,$d' < Makefile.ssl > Makefile.tmp 18 sed -e '/^# DO NOT DELETE.*/,$d' < Makefile.ssl > Makefile.tmp
19 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp 19 echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' >> Makefile.tmp
20 gcc -D OPENSSL_DOING_MAKEDEPEND -M $@ >> Makefile.tmp 20 gcc -D OPENSSL_DOING_MAKEDEPEND -M $@ >> Makefile.tmp
21 ${PERL} $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new 21 perl $TOP/util/clean-depend.pl < Makefile.tmp > Makefile.new
22 rm -f Makefile.tmp 22 rm -f Makefile.tmp
23else 23else
24 ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND -f Makefile.ssl $@ 24 ${MAKEDEPEND} -D OPENSSL_DOING_MAKEDEPEND -f Makefile.ssl $@
25 ${PERL} $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new 25 perl $TOP/util/clean-depend.pl < Makefile.ssl > Makefile.new
26fi 26fi
27mv Makefile.new Makefile.ssl 27mv Makefile.new Makefile.ssl
28# unfake the presence of Kerberos 28# unfake the presence of Kerberos
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 0029edc3a6..6afb0f4cdf 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -116,7 +116,7 @@
116#include <string.h> 116#include <string.h>
117#include <errno.h> 117#include <errno.h>
118 118
119#include <e_os.h> 119#include "e_os.h"
120 120
121#include <openssl/buffer.h> 121#include <openssl/buffer.h>
122#include <openssl/comp.h> 122#include <openssl/comp.h>
diff --git a/src/lib/libssl/test/Makefile.ssl b/src/lib/libssl/test/Makefile.ssl
index 952ab16371..49f2cc9a23 100644
--- a/src/lib/libssl/test/Makefile.ssl
+++ b/src/lib/libssl/test/Makefile.ssl
@@ -14,6 +14,7 @@ MAKEFILE= Makefile.ssl
14MAKE= make -f $(MAKEFILE) 14MAKE= make -f $(MAKEFILE)
15MAKEDEPPROG= makedepend 15MAKEDEPPROG= makedepend
16MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) 16MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
17PERL= perl
17 18
18PEX_LIBS= 19PEX_LIBS=
19EX_LIBS= #-lnsl -lsocket 20EX_LIBS= #-lnsl -lsocket
@@ -234,7 +235,7 @@ test_gen:
234 @echo "Generate and verify a certificate request" 235 @echo "Generate and verify a certificate request"
235 @sh ./testgen 236 @sh ./testgen
236 237
237test_ss: 238test_ss keyU.ss certU.ss certCA.ss: testss
238 @echo "Generate and certify a test certificate" 239 @echo "Generate and certify a test certificate"
239 @sh ./testss 240 @sh ./testss
240 241
@@ -242,13 +243,17 @@ test_engine:
242 @echo "Manipulate the ENGINE structures" 243 @echo "Manipulate the ENGINE structures"
243 ./$(ENGINETEST) 244 ./$(ENGINETEST)
244 245
245test_ssl: 246test_ssl: keyU.ss certU.ss certCA.ss
246 @echo "test SSL protocol" 247 @echo "test SSL protocol"
247 @sh ./testssl 248 @sh ./testssl keyU.ss certU.ss certCA.ss
248 249
249test_ca: 250test_ca:
250 @echo "Generate and certify a test certificate via the 'ca' program" 251 @if ../apps/openssl no-rsa; then \
251 @sh ./testca 252 echo "skipping CA.sh test -- requires RSA"; \
253 else \
254 echo "Generate and certify a test certificate via the 'ca' program"; \
255 sh ./testca; \
256 fi
252 257
253test_rd: #$(RDTEST) 258test_rd: #$(RDTEST)
254# @echo "test Rijndael" 259# @echo "test Rijndael"