summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto')
-rw-r--r--src/lib/libcrypto/asn1/asn_mime.c2
-rw-r--r--src/lib/libcrypto/asn1/t_x509.c11
-rw-r--r--src/lib/libcrypto/bio/bss_dgram.c64
-rw-r--r--src/lib/libcrypto/bn/Makefile1
-rw-r--r--src/lib/libcrypto/bn/bn_div.c15
-rw-r--r--src/lib/libcrypto/bn/bn_gf2m.c6
-rw-r--r--src/lib/libcrypto/bn/bn_nist.c184
-rw-r--r--src/lib/libcrypto/cms/cms_smime.c6
-rw-r--r--src/lib/libcrypto/cryptlib.h1
-rw-r--r--src/lib/libcrypto/crypto.h1
-rw-r--r--src/lib/libcrypto/dh/Makefile20
-rw-r--r--src/lib/libcrypto/dsa/Makefile11
-rw-r--r--src/lib/libcrypto/ecdh/Makefile32
-rw-r--r--src/lib/libcrypto/ecdsa/Makefile48
-rw-r--r--src/lib/libcrypto/engine/Makefile390
-rw-r--r--src/lib/libcrypto/engine/eng_all.c3
-rw-r--r--src/lib/libcrypto/engine/eng_cnf.c9
-rw-r--r--src/lib/libcrypto/engine/eng_err.c3
-rw-r--r--src/lib/libcrypto/engine/eng_int.h2
-rw-r--r--src/lib/libcrypto/engine/eng_pkey.c42
-rw-r--r--src/lib/libcrypto/engine/engine.h16
-rw-r--r--src/lib/libcrypto/err/err.c1
-rw-r--r--src/lib/libcrypto/err/err.h4
-rw-r--r--src/lib/libcrypto/evp/Makefile54
-rw-r--r--src/lib/libcrypto/evp/evp.h2
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c13
-rw-r--r--src/lib/libcrypto/hmac/hmac.c7
-rw-r--r--src/lib/libcrypto/hmac/hmac.h1
-rw-r--r--src/lib/libcrypto/md32_common.h2
-rw-r--r--src/lib/libcrypto/objects/obj_mac.num66
-rw-r--r--src/lib/libcrypto/objects/objects.txt105
-rw-r--r--src/lib/libcrypto/opensslv.h6
-rw-r--r--src/lib/libcrypto/ossl_typ.h2
-rw-r--r--src/lib/libcrypto/pkcs12/p12_crt.c26
-rw-r--r--src/lib/libcrypto/rand/Makefile17
-rw-r--r--src/lib/libcrypto/rsa/Makefile13
-rw-r--r--src/lib/libcrypto/rsa/rsa.h2
-rw-r--r--src/lib/libcrypto/rsa/rsa_eay.c39
-rw-r--r--src/lib/libcrypto/rsa/rsa_ssl.c2
-rw-r--r--src/lib/libcrypto/sha/asm/sha1-586.pl2
-rw-r--r--src/lib/libcrypto/stack/safestack.h44
-rw-r--r--src/lib/libcrypto/util/libeay.num58
-rw-r--r--src/lib/libcrypto/util/mk1mf.pl4
-rw-r--r--src/lib/libcrypto/util/mkdef.pl6
-rw-r--r--src/lib/libcrypto/util/pl/VC-32.pl8
-rw-r--r--src/lib/libcrypto/util/ssleay.num1
-rw-r--r--src/lib/libcrypto/x509/x509_att.c12
-rw-r--r--src/lib/libcrypto/x509/x509_vfy.c12
-rw-r--r--src/lib/libcrypto/x509v3/pcy_data.c8
-rw-r--r--src/lib/libcrypto/x509v3/pcy_tree.c18
-rw-r--r--src/lib/libcrypto/x509v3/v3_addr.c12
-rw-r--r--src/lib/libcrypto/x509v3/v3_asid.c2
-rw-r--r--src/lib/libcrypto/x509v3/v3_purp.c6
-rw-r--r--src/lib/libcrypto/x509v3/x509v3.h4
54 files changed, 1083 insertions, 343 deletions
diff --git a/src/lib/libcrypto/asn1/asn_mime.c b/src/lib/libcrypto/asn1/asn_mime.c
index fe7c4ec7ab..bc80b20d63 100644
--- a/src/lib/libcrypto/asn1/asn_mime.c
+++ b/src/lib/libcrypto/asn1/asn_mime.c
@@ -526,6 +526,8 @@ int SMIME_text(BIO *in, BIO *out)
526 sk_MIME_HEADER_pop_free(headers, mime_hdr_free); 526 sk_MIME_HEADER_pop_free(headers, mime_hdr_free);
527 while ((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0) 527 while ((len = BIO_read(in, iobuf, sizeof(iobuf))) > 0)
528 BIO_write(out, iobuf, len); 528 BIO_write(out, iobuf, len);
529 if (len < 0)
530 return 0;
529 return 1; 531 return 1;
530} 532}
531 533
diff --git a/src/lib/libcrypto/asn1/t_x509.c b/src/lib/libcrypto/asn1/t_x509.c
index 26d3361722..cb76c32c8d 100644
--- a/src/lib/libcrypto/asn1/t_x509.c
+++ b/src/lib/libcrypto/asn1/t_x509.c
@@ -393,8 +393,9 @@ int ASN1_GENERALIZEDTIME_print(BIO *bp, ASN1_GENERALIZEDTIME *tm)
393 d= (v[6]-'0')*10+(v[7]-'0'); 393 d= (v[6]-'0')*10+(v[7]-'0');
394 h= (v[8]-'0')*10+(v[9]-'0'); 394 h= (v[8]-'0')*10+(v[9]-'0');
395 m= (v[10]-'0')*10+(v[11]-'0'); 395 m= (v[10]-'0')*10+(v[11]-'0');
396 if ( (v[12] >= '0') && (v[12] <= '9') && 396 if (i >= 14 &&
397 (v[13] >= '0') && (v[13] <= '9')) 397 (v[12] >= '0') && (v[12] <= '9') &&
398 (v[13] >= '0') && (v[13] <= '9'))
398 s= (v[12]-'0')*10+(v[13]-'0'); 399 s= (v[12]-'0')*10+(v[13]-'0');
399 400
400 if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s", 401 if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
@@ -428,8 +429,9 @@ int ASN1_UTCTIME_print(BIO *bp, ASN1_UTCTIME *tm)
428 d= (v[4]-'0')*10+(v[5]-'0'); 429 d= (v[4]-'0')*10+(v[5]-'0');
429 h= (v[6]-'0')*10+(v[7]-'0'); 430 h= (v[6]-'0')*10+(v[7]-'0');
430 m= (v[8]-'0')*10+(v[9]-'0'); 431 m= (v[8]-'0')*10+(v[9]-'0');
431 if ( (v[10] >= '0') && (v[10] <= '9') && 432 if (i >=12 &&
432 (v[11] >= '0') && (v[11] <= '9')) 433 (v[10] >= '0') && (v[10] <= '9') &&
434 (v[11] >= '0') && (v[11] <= '9'))
433 s= (v[10]-'0')*10+(v[11]-'0'); 435 s= (v[10]-'0')*10+(v[11]-'0');
434 436
435 if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s", 437 if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
@@ -501,4 +503,3 @@ err:
501 OPENSSL_free(b); 503 OPENSSL_free(b);
502 return(ret); 504 return(ret);
503 } 505 }
504
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c
index ea2c3fff63..c3da6dc82f 100644
--- a/src/lib/libcrypto/bio/bss_dgram.c
+++ b/src/lib/libcrypto/bio/bss_dgram.c
@@ -82,7 +82,7 @@ static int dgram_new(BIO *h);
82static int dgram_free(BIO *data); 82static int dgram_free(BIO *data);
83static int dgram_clear(BIO *bio); 83static int dgram_clear(BIO *bio);
84 84
85int BIO_dgram_should_retry(int s); 85static int BIO_dgram_should_retry(int s);
86 86
87static BIO_METHOD methods_dgramp= 87static BIO_METHOD methods_dgramp=
88 { 88 {
@@ -345,30 +345,90 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
345 345
346 memcpy(&(data->peer), to, sizeof(struct sockaddr)); 346 memcpy(&(data->peer), to, sizeof(struct sockaddr));
347 break; 347 break;
348#if defined(SO_RCVTIMEO)
348 case BIO_CTRL_DGRAM_SET_RECV_TIMEOUT: 349 case BIO_CTRL_DGRAM_SET_RECV_TIMEOUT:
350#ifdef OPENSSL_SYS_WINDOWS
351 {
352 struct timeval *tv = (struct timeval *)ptr;
353 int timeout = tv->tv_sec * 1000 + tv->tv_usec/1000;
354 if (setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
355 (void*)&timeout, sizeof(timeout)) < 0)
356 { perror("setsockopt"); ret = -1; }
357 }
358#else
349 if ( setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, ptr, 359 if ( setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, ptr,
350 sizeof(struct timeval)) < 0) 360 sizeof(struct timeval)) < 0)
351 { perror("setsockopt"); ret = -1; } 361 { perror("setsockopt"); ret = -1; }
362#endif
352 break; 363 break;
353 case BIO_CTRL_DGRAM_GET_RECV_TIMEOUT: 364 case BIO_CTRL_DGRAM_GET_RECV_TIMEOUT:
365#ifdef OPENSSL_SYS_WINDOWS
366 {
367 int timeout, sz = sizeof(timeout);
368 struct timeval *tv = (struct timeval *)ptr;
369 if (getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
370 (void*)&timeout, &sz) < 0)
371 { perror("getsockopt"); ret = -1; }
372 else
373 {
374 tv->tv_sec = timeout / 1000;
375 tv->tv_usec = (timeout % 1000) * 1000;
376 ret = sizeof(*tv);
377 }
378 }
379#else
354 if ( getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, 380 if ( getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
355 ptr, (void *)&ret) < 0) 381 ptr, (void *)&ret) < 0)
356 { perror("getsockopt"); ret = -1; } 382 { perror("getsockopt"); ret = -1; }
383#endif
357 break; 384 break;
385#endif
386#if defined(SO_SNDTIMEO)
358 case BIO_CTRL_DGRAM_SET_SEND_TIMEOUT: 387 case BIO_CTRL_DGRAM_SET_SEND_TIMEOUT:
388#ifdef OPENSSL_SYS_WINDOWS
389 {
390 struct timeval *tv = (struct timeval *)ptr;
391 int timeout = tv->tv_sec * 1000 + tv->tv_usec/1000;
392 if (setsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO,
393 (void*)&timeout, sizeof(timeout)) < 0)
394 { perror("setsockopt"); ret = -1; }
395 }
396#else
359 if ( setsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO, ptr, 397 if ( setsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO, ptr,
360 sizeof(struct timeval)) < 0) 398 sizeof(struct timeval)) < 0)
361 { perror("setsockopt"); ret = -1; } 399 { perror("setsockopt"); ret = -1; }
400#endif
362 break; 401 break;
363 case BIO_CTRL_DGRAM_GET_SEND_TIMEOUT: 402 case BIO_CTRL_DGRAM_GET_SEND_TIMEOUT:
403#ifdef OPENSSL_SYS_WINDOWS
404 {
405 int timeout, sz = sizeof(timeout);
406 struct timeval *tv = (struct timeval *)ptr;
407 if (getsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO,
408 (void*)&timeout, &sz) < 0)
409 { perror("getsockopt"); ret = -1; }
410 else
411 {
412 tv->tv_sec = timeout / 1000;
413 tv->tv_usec = (timeout % 1000) * 1000;
414 ret = sizeof(*tv);
415 }
416 }
417#else
364 if ( getsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO, 418 if ( getsockopt(b->num, SOL_SOCKET, SO_SNDTIMEO,
365 ptr, (void *)&ret) < 0) 419 ptr, (void *)&ret) < 0)
366 { perror("getsockopt"); ret = -1; } 420 { perror("getsockopt"); ret = -1; }
421#endif
367 break; 422 break;
423#endif
368 case BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP: 424 case BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP:
369 /* fall-through */ 425 /* fall-through */
370 case BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP: 426 case BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP:
427#ifdef OPENSSL_SYS_WINDOWS
428 if ( data->_errno == WSAETIMEDOUT)
429#else
371 if ( data->_errno == EAGAIN) 430 if ( data->_errno == EAGAIN)
431#endif
372 { 432 {
373 ret = 1; 433 ret = 1;
374 data->_errno = 0; 434 data->_errno = 0;
@@ -403,7 +463,7 @@ static int dgram_puts(BIO *bp, const char *str)
403 return(ret); 463 return(ret);
404 } 464 }
405 465
406int BIO_dgram_should_retry(int i) 466static int BIO_dgram_should_retry(int i)
407 { 467 {
408 int err; 468 int err;
409 469
diff --git a/src/lib/libcrypto/bn/Makefile b/src/lib/libcrypto/bn/Makefile
index e97c751390..0491e3db4c 100644
--- a/src/lib/libcrypto/bn/Makefile
+++ b/src/lib/libcrypto/bn/Makefile
@@ -116,6 +116,7 @@ linux_ppc64.s: asm/ppc.pl; $(PERL) $< $@
116aix_ppc32.s: asm/ppc.pl; $(PERL) asm/ppc.pl $@ 116aix_ppc32.s: asm/ppc.pl; $(PERL) asm/ppc.pl $@
117aix_ppc64.s: asm/ppc.pl; $(PERL) asm/ppc.pl $@ 117aix_ppc64.s: asm/ppc.pl; $(PERL) asm/ppc.pl $@
118osx_ppc32.s: asm/ppc.pl; $(PERL) $< $@ 118osx_ppc32.s: asm/ppc.pl; $(PERL) $< $@
119osx_ppc64.s: asm/ppc.pl; $(PERL) $< $@
119 120
120files: 121files:
121 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO 122 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
diff --git a/src/lib/libcrypto/bn/bn_div.c b/src/lib/libcrypto/bn/bn_div.c
index 8655eb118e..1e8e57626b 100644
--- a/src/lib/libcrypto/bn/bn_div.c
+++ b/src/lib/libcrypto/bn/bn_div.c
@@ -187,6 +187,17 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
187 BN_ULONG d0,d1; 187 BN_ULONG d0,d1;
188 int num_n,div_n; 188 int num_n,div_n;
189 189
190 /* Invalid zero-padding would have particularly bad consequences
191 * in the case of 'num', so don't just rely on bn_check_top() for this one
192 * (bn_check_top() works only for BN_DEBUG builds) */
193 if (num->top > 0 && num->d[num->top - 1] == 0)
194 {
195 BNerr(BN_F_BN_DIV,BN_R_NOT_INITIALIZED);
196 return 0;
197 }
198
199 bn_check_top(num);
200
190 if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0)) 201 if ((BN_get_flags(num, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(divisor, BN_FLG_CONSTTIME) != 0))
191 { 202 {
192 return BN_div_no_branch(dv, rm, num, divisor, ctx); 203 return BN_div_no_branch(dv, rm, num, divisor, ctx);
@@ -194,7 +205,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
194 205
195 bn_check_top(dv); 206 bn_check_top(dv);
196 bn_check_top(rm); 207 bn_check_top(rm);
197 bn_check_top(num); 208 /* bn_check_top(num); */ /* 'num' has been checked already */
198 bn_check_top(divisor); 209 bn_check_top(divisor);
199 210
200 if (BN_is_zero(divisor)) 211 if (BN_is_zero(divisor))
@@ -419,7 +430,7 @@ static int BN_div_no_branch(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
419 430
420 bn_check_top(dv); 431 bn_check_top(dv);
421 bn_check_top(rm); 432 bn_check_top(rm);
422 bn_check_top(num); 433 /* bn_check_top(num); */ /* 'num' has been checked in BN_div() */
423 bn_check_top(divisor); 434 bn_check_top(divisor);
424 435
425 if (BN_is_zero(divisor)) 436 if (BN_is_zero(divisor))
diff --git a/src/lib/libcrypto/bn/bn_gf2m.c b/src/lib/libcrypto/bn/bn_gf2m.c
index 6a793857e1..306f029f27 100644
--- a/src/lib/libcrypto/bn/bn_gf2m.c
+++ b/src/lib/libcrypto/bn/bn_gf2m.c
@@ -384,7 +384,11 @@ int BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const unsigned int p[])
384 if (zz == 0) break; 384 if (zz == 0) break;
385 d1 = BN_BITS2 - d0; 385 d1 = BN_BITS2 - d0;
386 386
387 if (d0) z[dN] = (z[dN] << d1) >> d1; /* clear up the top d1 bits */ 387 /* clear up the top d1 bits */
388 if (d0)
389 z[dN] = (z[dN] << d1) >> d1;
390 else
391 z[dN] = 0;
388 z[0] ^= zz; /* reduction t^0 component */ 392 z[0] ^= zz; /* reduction t^0 component */
389 393
390 for (k = 1; p[k] != 0; k++) 394 for (k = 1; p[k] != 0; k++)
diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c
index e14232fdbb..1fc94f55c3 100644
--- a/src/lib/libcrypto/bn/bn_nist.c
+++ b/src/lib/libcrypto/bn/bn_nist.c
@@ -59,6 +59,7 @@
59#include "bn_lcl.h" 59#include "bn_lcl.h"
60#include "cryptlib.h" 60#include "cryptlib.h"
61 61
62
62#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2 63#define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2
63#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2 64#define BN_NIST_224_TOP (224+BN_BITS2-1)/BN_BITS2
64#define BN_NIST_256_TOP (256+BN_BITS2-1)/BN_BITS2 65#define BN_NIST_256_TOP (256+BN_BITS2-1)/BN_BITS2
@@ -101,60 +102,98 @@ static const BN_ULONG _nist_p_521[] = {0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,
101 0xFFFFFFFF,0x000001FF}; 102 0xFFFFFFFF,0x000001FF};
102#endif 103#endif
103 104
105
106static const BIGNUM _bignum_nist_p_192 =
107 {
108 (BN_ULONG *)_nist_p_192,
109 BN_NIST_192_TOP,
110 BN_NIST_192_TOP,
111 0,
112 BN_FLG_STATIC_DATA
113 };
114
115static const BIGNUM _bignum_nist_p_224 =
116 {
117 (BN_ULONG *)_nist_p_224,
118 BN_NIST_224_TOP,
119 BN_NIST_224_TOP,
120 0,
121 BN_FLG_STATIC_DATA
122 };
123
124static const BIGNUM _bignum_nist_p_256 =
125 {
126 (BN_ULONG *)_nist_p_256,
127 BN_NIST_256_TOP,
128 BN_NIST_256_TOP,
129 0,
130 BN_FLG_STATIC_DATA
131 };
132
133static const BIGNUM _bignum_nist_p_384 =
134 {
135 (BN_ULONG *)_nist_p_384,
136 BN_NIST_384_TOP,
137 BN_NIST_384_TOP,
138 0,
139 BN_FLG_STATIC_DATA
140 };
141
142static const BIGNUM _bignum_nist_p_521 =
143 {
144 (BN_ULONG *)_nist_p_521,
145 BN_NIST_521_TOP,
146 BN_NIST_521_TOP,
147 0,
148 BN_FLG_STATIC_DATA
149 };
150
151
104const BIGNUM *BN_get0_nist_prime_192(void) 152const BIGNUM *BN_get0_nist_prime_192(void)
105 { 153 {
106 static BIGNUM const_nist_192 = { (BN_ULONG *)_nist_p_192, 154 return &_bignum_nist_p_192;
107 BN_NIST_192_TOP, BN_NIST_192_TOP, 0, BN_FLG_STATIC_DATA };
108 return &const_nist_192;
109 } 155 }
110 156
111const BIGNUM *BN_get0_nist_prime_224(void) 157const BIGNUM *BN_get0_nist_prime_224(void)
112 { 158 {
113 static BIGNUM const_nist_224 = { (BN_ULONG *)_nist_p_224, 159 return &_bignum_nist_p_224;
114 BN_NIST_224_TOP, BN_NIST_224_TOP, 0, BN_FLG_STATIC_DATA };
115 return &const_nist_224;
116 } 160 }
117 161
118const BIGNUM *BN_get0_nist_prime_256(void) 162const BIGNUM *BN_get0_nist_prime_256(void)
119 { 163 {
120 static BIGNUM const_nist_256 = { (BN_ULONG *)_nist_p_256, 164 return &_bignum_nist_p_256;
121 BN_NIST_256_TOP, BN_NIST_256_TOP, 0, BN_FLG_STATIC_DATA };
122 return &const_nist_256;
123 } 165 }
124 166
125const BIGNUM *BN_get0_nist_prime_384(void) 167const BIGNUM *BN_get0_nist_prime_384(void)
126 { 168 {
127 static BIGNUM const_nist_384 = { (BN_ULONG *)_nist_p_384, 169 return &_bignum_nist_p_384;
128 BN_NIST_384_TOP, BN_NIST_384_TOP, 0, BN_FLG_STATIC_DATA };
129 return &const_nist_384;
130 } 170 }
131 171
132const BIGNUM *BN_get0_nist_prime_521(void) 172const BIGNUM *BN_get0_nist_prime_521(void)
133 { 173 {
134 static BIGNUM const_nist_521 = { (BN_ULONG *)_nist_p_521, 174 return &_bignum_nist_p_521;
135 BN_NIST_521_TOP, BN_NIST_521_TOP, 0, BN_FLG_STATIC_DATA };
136 return &const_nist_521;
137 } 175 }
138 176
139#define BN_NIST_ADD_ONE(a) while (!(*(a)=(*(a)+1)&BN_MASK2)) ++(a);
140 177
141static void nist_cp_bn_0(BN_ULONG *buf, BN_ULONG *a, int top, int max) 178static void nist_cp_bn_0(BN_ULONG *buf, BN_ULONG *a, int top, int max)
142 { 179 {
143 int i; 180 int i;
144 BN_ULONG *_tmp1 = (buf), *_tmp2 = (a); 181 BN_ULONG *_tmp1 = (buf), *_tmp2 = (a);
145 for (i = (top); i != 0; i--) 182
146 *_tmp1++ = *_tmp2++; 183 OPENSSL_assert(top <= max);
147 for (i = (max) - (top); i != 0; i--) 184 for (i = (top); i != 0; i--)
148 *_tmp1++ = (BN_ULONG) 0; 185 *_tmp1++ = *_tmp2++;
149 } 186 for (i = (max) - (top); i != 0; i--)
187 *_tmp1++ = (BN_ULONG) 0;
188 }
150 189
151static void nist_cp_bn(BN_ULONG *buf, BN_ULONG *a, int top) 190static void nist_cp_bn(BN_ULONG *buf, BN_ULONG *a, int top)
152 { 191 {
153 int i; 192 int i;
154 BN_ULONG *_tmp1 = (buf), *_tmp2 = (a); 193 BN_ULONG *_tmp1 = (buf), *_tmp2 = (a);
155 for (i = (top); i != 0; i--) 194 for (i = (top); i != 0; i--)
156 *_tmp1++ = *_tmp2++; 195 *_tmp1++ = *_tmp2++;
157 } 196 }
158 197
159#if BN_BITS2 == 64 198#if BN_BITS2 == 64
160#define bn_cp_64(to, n, from, m) (to)[n] = (m>=0)?((from)[m]):0; 199#define bn_cp_64(to, n, from, m) (to)[n] = (m>=0)?((from)[m]):0;
@@ -199,6 +238,11 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
199 *res; 238 *res;
200 size_t mask; 239 size_t mask;
201 240
241 field = &_bignum_nist_p_192; /* just to make sure */
242
243 if (BN_is_negative(a) || a->top > 2*BN_NIST_192_TOP)
244 return BN_nnmod(r, field, a, ctx);
245
202 i = BN_ucmp(field, a); 246 i = BN_ucmp(field, a);
203 if (i == 0) 247 if (i == 0)
204 { 248 {
@@ -208,9 +252,6 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
208 else if (i > 0) 252 else if (i > 0)
209 return (r == a) ? 1 : (BN_copy(r ,a) != NULL); 253 return (r == a) ? 1 : (BN_copy(r ,a) != NULL);
210 254
211 if (top == BN_NIST_192_TOP)
212 return BN_usub(r, a, field);
213
214 if (r != a) 255 if (r != a)
215 { 256 {
216 if (!bn_wexpand(r, BN_NIST_192_TOP)) 257 if (!bn_wexpand(r, BN_NIST_192_TOP))
@@ -245,6 +286,11 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
245 r->top = BN_NIST_192_TOP; 286 r->top = BN_NIST_192_TOP;
246 bn_correct_top(r); 287 bn_correct_top(r);
247 288
289 if (BN_ucmp(field, r) <= 0)
290 {
291 if (!BN_usub(r, r, field)) return 0;
292 }
293
248 return 1; 294 return 1;
249 } 295 }
250 296
@@ -272,6 +318,11 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
272 *res; 318 *res;
273 size_t mask; 319 size_t mask;
274 320
321 field = &_bignum_nist_p_224; /* just to make sure */
322
323 if (BN_is_negative(a) || a->top > 2*BN_NIST_224_TOP)
324 return BN_nnmod(r, field, a, ctx);
325
275 i = BN_ucmp(field, a); 326 i = BN_ucmp(field, a);
276 if (i == 0) 327 if (i == 0)
277 { 328 {
@@ -281,9 +332,6 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
281 else if (i > 0) 332 else if (i > 0)
282 return (r == a)? 1 : (BN_copy(r ,a) != NULL); 333 return (r == a)? 1 : (BN_copy(r ,a) != NULL);
283 334
284 if (top == BN_NIST_224_TOP)
285 return BN_usub(r, a, field);
286
287 if (r != a) 335 if (r != a)
288 { 336 {
289 if (!bn_wexpand(r, BN_NIST_224_TOP)) 337 if (!bn_wexpand(r, BN_NIST_224_TOP))
@@ -333,6 +381,11 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
333 r->top = BN_NIST_224_TOP; 381 r->top = BN_NIST_224_TOP;
334 bn_correct_top(r); 382 bn_correct_top(r);
335 383
384 if (BN_ucmp(field, r) <= 0)
385 {
386 if (!BN_usub(r, r, field)) return 0;
387 }
388
336 return 1; 389 return 1;
337#else /* BN_BITS!=32 */ 390#else /* BN_BITS!=32 */
338 return 0; 391 return 0;
@@ -364,6 +417,11 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
364 *res; 417 *res;
365 size_t mask; 418 size_t mask;
366 419
420 field = &_bignum_nist_p_256; /* just to make sure */
421
422 if (BN_is_negative(a) || a->top > 2*BN_NIST_256_TOP)
423 return BN_nnmod(r, field, a, ctx);
424
367 i = BN_ucmp(field, a); 425 i = BN_ucmp(field, a);
368 if (i == 0) 426 if (i == 0)
369 { 427 {
@@ -373,9 +431,6 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
373 else if (i > 0) 431 else if (i > 0)
374 return (r == a)? 1 : (BN_copy(r ,a) != NULL); 432 return (r == a)? 1 : (BN_copy(r ,a) != NULL);
375 433
376 if (top == BN_NIST_256_TOP)
377 return BN_usub(r, a, field);
378
379 if (r != a) 434 if (r != a)
380 { 435 {
381 if (!bn_wexpand(r, BN_NIST_256_TOP)) 436 if (!bn_wexpand(r, BN_NIST_256_TOP))
@@ -470,6 +525,11 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
470 r->top = BN_NIST_256_TOP; 525 r->top = BN_NIST_256_TOP;
471 bn_correct_top(r); 526 bn_correct_top(r);
472 527
528 if (BN_ucmp(field, r) <= 0)
529 {
530 if (!BN_usub(r, r, field)) return 0;
531 }
532
473 return 1; 533 return 1;
474#else /* BN_BITS!=32 */ 534#else /* BN_BITS!=32 */
475 return 0; 535 return 0;
@@ -505,6 +565,11 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
505 *res; 565 *res;
506 size_t mask; 566 size_t mask;
507 567
568 field = &_bignum_nist_p_384; /* just to make sure */
569
570 if (BN_is_negative(a) || a->top > 2*BN_NIST_384_TOP)
571 return BN_nnmod(r, field, a, ctx);
572
508 i = BN_ucmp(field, a); 573 i = BN_ucmp(field, a);
509 if (i == 0) 574 if (i == 0)
510 { 575 {
@@ -514,9 +579,6 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
514 else if (i > 0) 579 else if (i > 0)
515 return (r == a)? 1 : (BN_copy(r ,a) != NULL); 580 return (r == a)? 1 : (BN_copy(r ,a) != NULL);
516 581
517 if (top == BN_NIST_384_TOP)
518 return BN_usub(r, a, field);
519
520 if (r != a) 582 if (r != a)
521 { 583 {
522 if (!bn_wexpand(r, BN_NIST_384_TOP)) 584 if (!bn_wexpand(r, BN_NIST_384_TOP))
@@ -631,6 +693,11 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
631 r->top = BN_NIST_384_TOP; 693 r->top = BN_NIST_384_TOP;
632 bn_correct_top(r); 694 bn_correct_top(r);
633 695
696 if (BN_ucmp(field, r) <= 0)
697 {
698 if (!BN_usub(r, r, field)) return 0;
699 }
700
634 return 1; 701 return 1;
635#else /* BN_BITS!=32 */ 702#else /* BN_BITS!=32 */
636 return 0; 703 return 0;
@@ -646,14 +713,35 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
646#define BN_NIST_521_TOP_MASK (BN_ULONG)0x1FF 713#define BN_NIST_521_TOP_MASK (BN_ULONG)0x1FF
647#endif 714#endif
648 int top, ret = 0; 715 int top, ret = 0;
649 BN_ULONG *r_d;
650 BIGNUM *tmp; 716 BIGNUM *tmp;
651 717
718 field = &_bignum_nist_p_521; /* just to make sure */
719
720 if (BN_is_negative(a))
721 return BN_nnmod(r, field, a, ctx);
722
652 /* check whether a reduction is necessary */ 723 /* check whether a reduction is necessary */
653 top = a->top; 724 top = a->top;
654 if (top < BN_NIST_521_TOP || ( top == BN_NIST_521_TOP && 725 if (top < BN_NIST_521_TOP || ( top == BN_NIST_521_TOP &&
655 (!(a->d[BN_NIST_521_TOP-1] & ~(BN_NIST_521_TOP_MASK))))) 726 (!(a->d[BN_NIST_521_TOP-1] & ~(BN_NIST_521_TOP_MASK)))))
656 return (r == a)? 1 : (BN_copy(r ,a) != NULL); 727 {
728 int i = BN_ucmp(field, a);
729 if (i == 0)
730 {
731 BN_zero(r);
732 return 1;
733 }
734 else
735 {
736#ifdef BN_DEBUG
737 OPENSSL_assert(i > 0); /* because 'field' is 1111...1111 */
738#endif
739 return (r == a)? 1 : (BN_copy(r ,a) != NULL);
740 }
741 }
742
743 if (BN_num_bits(a) > 2*521)
744 return BN_nnmod(r, field, a, ctx);
657 745
658 BN_CTX_start(ctx); 746 BN_CTX_start(ctx);
659 tmp = BN_CTX_get(ctx); 747 tmp = BN_CTX_get(ctx);
@@ -673,15 +761,11 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field,
673 761
674 if (!BN_uadd(r, tmp, r)) 762 if (!BN_uadd(r, tmp, r))
675 goto err; 763 goto err;
676 top = r->top; 764
677 r_d = r->d; 765 if (BN_ucmp(field, r) <= 0)
678 if (top == BN_NIST_521_TOP &&
679 (r_d[BN_NIST_521_TOP-1] & ~(BN_NIST_521_TOP_MASK)))
680 { 766 {
681 BN_NIST_ADD_ONE(r_d) 767 if (!BN_usub(r, r, field)) goto err;
682 r->d[BN_NIST_521_TOP-1] &= BN_NIST_521_TOP_MASK;
683 } 768 }
684 bn_correct_top(r);
685 769
686 ret = 1; 770 ret = 1;
687err: 771err:
diff --git a/src/lib/libcrypto/cms/cms_smime.c b/src/lib/libcrypto/cms/cms_smime.c
index f79c504e91..b35d28d411 100644
--- a/src/lib/libcrypto/cms/cms_smime.c
+++ b/src/lib/libcrypto/cms/cms_smime.c
@@ -89,11 +89,13 @@ static int cms_copy_content(BIO *out, BIO *in, unsigned int flags)
89 if (!BIO_get_cipher_status(in)) 89 if (!BIO_get_cipher_status(in))
90 goto err; 90 goto err;
91 } 91 }
92 if (i < 0)
93 goto err;
92 break; 94 break;
93 } 95 }
94 96
95 if (tmpout) 97 if (tmpout && (BIO_write(tmpout, buf, i) != i))
96 BIO_write(tmpout, buf, i); 98 goto err;
97 } 99 }
98 100
99 if(flags & CMS_TEXT) 101 if(flags & CMS_TEXT)
diff --git a/src/lib/libcrypto/cryptlib.h b/src/lib/libcrypto/cryptlib.h
index 5ceaa964b5..fc249c57f3 100644
--- a/src/lib/libcrypto/cryptlib.h
+++ b/src/lib/libcrypto/cryptlib.h
@@ -103,7 +103,6 @@ extern unsigned long OPENSSL_ia32cap_P;
103void OPENSSL_showfatal(const char *,...); 103void OPENSSL_showfatal(const char *,...);
104void *OPENSSL_stderr(void); 104void *OPENSSL_stderr(void);
105extern int OPENSSL_NONPIC_relocated; 105extern int OPENSSL_NONPIC_relocated;
106int OPENSSL_isservice(void);
107 106
108#ifdef __cplusplus 107#ifdef __cplusplus
109} 108}
diff --git a/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h
index d2b5ffe332..fe2c1d6403 100644
--- a/src/lib/libcrypto/crypto.h
+++ b/src/lib/libcrypto/crypto.h
@@ -521,6 +521,7 @@ void OpenSSLDie(const char *file,int line,const char *assertion);
521 521
522unsigned long *OPENSSL_ia32cap_loc(void); 522unsigned long *OPENSSL_ia32cap_loc(void);
523#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc())) 523#define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))
524int OPENSSL_isservice(void);
524 525
525/* BEGIN ERROR CODES */ 526/* BEGIN ERROR CODES */
526/* The following lines are auto generated by the script mkerr.pl. Any changes 527/* The following lines are auto generated by the script mkerr.pl. Any changes
diff --git a/src/lib/libcrypto/dh/Makefile b/src/lib/libcrypto/dh/Makefile
index d368e33b4c..950cad9c5b 100644
--- a/src/lib/libcrypto/dh/Makefile
+++ b/src/lib/libcrypto/dh/Makefile
@@ -123,11 +123,17 @@ dh_key.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
123dh_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h 123dh_key.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h
124dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 124dh_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
125dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_key.c 125dh_key.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_key.c
126dh_lib.o: ../../e_os.h ../../include/openssl/bio.h ../../include/openssl/bn.h 126dh_lib.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
127dh_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 127dh_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
128dh_lib.o: ../../include/openssl/dh.h ../../include/openssl/e_os2.h 128dh_lib.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
129dh_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
130dh_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
129dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h 131dh_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
130dh_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 132dh_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
131dh_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 133dh_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
132dh_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 134dh_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
133dh_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h dh_lib.c 135dh_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
136dh_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
137dh_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
138dh_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
139dh_lib.o: ../cryptlib.h dh_lib.c
diff --git a/src/lib/libcrypto/dsa/Makefile b/src/lib/libcrypto/dsa/Makefile
index 676baf7d49..5493f19e85 100644
--- a/src/lib/libcrypto/dsa/Makefile
+++ b/src/lib/libcrypto/dsa/Makefile
@@ -126,11 +126,16 @@ dsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h
126dsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 126dsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
127dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 127dsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
128dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h 128dsa_lib.o: ../../include/openssl/dh.h ../../include/openssl/dsa.h
129dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 129dsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
130dsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 130dsa_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
131dsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
132dsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
133dsa_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
131dsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 134dsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
132dsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 135dsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
136dsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
133dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 137dsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
138dsa_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
134dsa_lib.o: ../cryptlib.h dsa_lib.c 139dsa_lib.o: ../cryptlib.h dsa_lib.c
135dsa_ossl.o: ../../e_os.h ../../include/openssl/asn1.h 140dsa_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
136dsa_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 141dsa_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
diff --git a/src/lib/libcrypto/ecdh/Makefile b/src/lib/libcrypto/ecdh/Makefile
index 95aa69fea5..65d8904ee8 100644
--- a/src/lib/libcrypto/ecdh/Makefile
+++ b/src/lib/libcrypto/ecdh/Makefile
@@ -84,20 +84,30 @@ ech_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
84ech_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 84ech_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
85ech_err.o: ech_err.c 85ech_err.o: ech_err.c
86ech_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 86ech_key.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
87ech_key.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 87ech_key.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
88ech_key.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 88ech_key.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
89ech_key.o: ../../include/openssl/engine.h ../../include/openssl/opensslconf.h 89ech_key.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
90ech_key.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
91ech_key.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
92ech_key.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
90ech_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 93ech_key.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
91ech_key.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 94ech_key.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
92ech_key.o: ../../include/openssl/symhacks.h ech_key.c ech_locl.h 95ech_key.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
96ech_key.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
97ech_key.o: ../../include/openssl/x509_vfy.h ech_key.c ech_locl.h
93ech_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 98ech_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
94ech_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 99ech_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
95ech_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h 100ech_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
101ech_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
96ech_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h 102ech_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
97ech_lib.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 103ech_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
98ech_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 104ech_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
99ech_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 105ech_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
100ech_lib.o: ../../include/openssl/symhacks.h ech_lib.c ech_locl.h 106ech_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
107ech_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
108ech_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
109ech_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
110ech_lib.o: ech_lib.c ech_locl.h
101ech_ossl.o: ../../e_os.h ../../include/openssl/asn1.h 111ech_ossl.o: ../../e_os.h ../../include/openssl/asn1.h
102ech_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 112ech_ossl.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
103ech_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 113ech_ossl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
diff --git a/src/lib/libcrypto/ecdsa/Makefile b/src/lib/libcrypto/ecdsa/Makefile
index 16a93cd3ae..9b48d5641f 100644
--- a/src/lib/libcrypto/ecdsa/Makefile
+++ b/src/lib/libcrypto/ecdsa/Makefile
@@ -92,14 +92,18 @@ ecs_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
92ecs_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 92ecs_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
93ecs_err.o: ecs_err.c 93ecs_err.o: ecs_err.c
94ecs_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 94ecs_lib.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
95ecs_lib.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 95ecs_lib.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
96ecs_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 96ecs_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
97ecs_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
97ecs_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h 98ecs_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
98ecs_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 99ecs_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
99ecs_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 100ecs_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
100ecs_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 101ecs_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
101ecs_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 102ecs_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
102ecs_lib.o: ecs_lib.c ecs_locl.h 103ecs_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
104ecs_lib.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
105ecs_lib.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
106ecs_lib.o: ../../include/openssl/x509_vfy.h ecs_lib.c ecs_locl.h
103ecs_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 107ecs_ossl.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
104ecs_ossl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 108ecs_ossl.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h
105ecs_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 109ecs_ossl.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
@@ -110,16 +114,26 @@ ecs_ossl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
110ecs_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 114ecs_ossl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
111ecs_ossl.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_ossl.c 115ecs_ossl.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_ossl.c
112ecs_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 116ecs_sign.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
113ecs_sign.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 117ecs_sign.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
114ecs_sign.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h 118ecs_sign.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
115ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/opensslconf.h 119ecs_sign.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
120ecs_sign.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
121ecs_sign.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
122ecs_sign.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
116ecs_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 123ecs_sign.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
117ecs_sign.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 124ecs_sign.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
118ecs_sign.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_sign.c 125ecs_sign.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
126ecs_sign.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
127ecs_sign.o: ../../include/openssl/x509_vfy.h ecs_locl.h ecs_sign.c
119ecs_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 128ecs_vrf.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
120ecs_vrf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 129ecs_vrf.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
121ecs_vrf.o: ../../include/openssl/ec.h ../../include/openssl/ecdsa.h 130ecs_vrf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
122ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/opensslconf.h 131ecs_vrf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
132ecs_vrf.o: ../../include/openssl/engine.h ../../include/openssl/evp.h
133ecs_vrf.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
134ecs_vrf.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
123ecs_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 135ecs_vrf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
124ecs_vrf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 136ecs_vrf.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
125ecs_vrf.o: ../../include/openssl/symhacks.h ecs_locl.h ecs_vrf.c 137ecs_vrf.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
138ecs_vrf.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
139ecs_vrf.o: ../../include/openssl/x509_vfy.h ecs_locl.h ecs_vrf.c
diff --git a/src/lib/libcrypto/engine/Makefile b/src/lib/libcrypto/engine/Makefile
index 13f211a0ae..47cc619b8a 100644
--- a/src/lib/libcrypto/engine/Makefile
+++ b/src/lib/libcrypto/engine/Makefile
@@ -82,88 +82,142 @@ clean:
82 82
83# DO NOT DELETE THIS LINE -- make depend depends on it. 83# DO NOT DELETE THIS LINE -- make depend depends on it.
84 84
85eng_all.o: ../../e_os.h ../../include/openssl/bio.h 85eng_all.o: ../../e_os.h ../../include/openssl/asn1.h
86eng_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 86eng_all.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
87eng_all.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 87eng_all.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
88eng_all.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 88eng_all.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
89eng_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 89eng_all.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
90eng_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 90eng_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h
91eng_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 91eng_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
92eng_all.o: ../cryptlib.h eng_all.c eng_int.h 92eng_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
93eng_cnf.o: ../../e_os.h ../../include/openssl/bio.h 93eng_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
94eng_cnf.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h 94eng_all.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
95eng_cnf.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 95eng_all.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
96eng_all.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
97eng_all.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_all.c eng_int.h
98eng_cnf.o: ../../e_os.h ../../include/openssl/asn1.h
99eng_cnf.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
100eng_cnf.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
101eng_cnf.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
102eng_cnf.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
96eng_cnf.o: ../../include/openssl/engine.h ../../include/openssl/err.h 103eng_cnf.o: ../../include/openssl/engine.h ../../include/openssl/err.h
97eng_cnf.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 104eng_cnf.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
98eng_cnf.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 105eng_cnf.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
99eng_cnf.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 106eng_cnf.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
100eng_cnf.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_cnf.c eng_int.h 107eng_cnf.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
108eng_cnf.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
109eng_cnf.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
110eng_cnf.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
111eng_cnf.o: ../cryptlib.h eng_cnf.c eng_int.h
101eng_cryptodev.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 112eng_cryptodev.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
102eng_cryptodev.o: ../../include/openssl/bn.h ../../include/openssl/crypto.h 113eng_cryptodev.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
103eng_cryptodev.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 114eng_cryptodev.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
104eng_cryptodev.o: ../../include/openssl/evp.h ../../include/openssl/obj_mac.h 115eng_cryptodev.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
116eng_cryptodev.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
117eng_cryptodev.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
118eng_cryptodev.o: ../../include/openssl/obj_mac.h
105eng_cryptodev.o: ../../include/openssl/objects.h 119eng_cryptodev.o: ../../include/openssl/objects.h
106eng_cryptodev.o: ../../include/openssl/opensslconf.h 120eng_cryptodev.o: ../../include/openssl/opensslconf.h
107eng_cryptodev.o: ../../include/openssl/opensslv.h 121eng_cryptodev.o: ../../include/openssl/opensslv.h
108eng_cryptodev.o: ../../include/openssl/ossl_typ.h 122eng_cryptodev.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
109eng_cryptodev.o: ../../include/openssl/safestack.h 123eng_cryptodev.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
110eng_cryptodev.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 124eng_cryptodev.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
125eng_cryptodev.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
111eng_cryptodev.o: eng_cryptodev.c 126eng_cryptodev.o: eng_cryptodev.c
112eng_ctrl.o: ../../e_os.h ../../include/openssl/bio.h 127eng_ctrl.o: ../../e_os.h ../../include/openssl/asn1.h
113eng_ctrl.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 128eng_ctrl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
114eng_ctrl.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 129eng_ctrl.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
115eng_ctrl.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 130eng_ctrl.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
116eng_ctrl.o: ../../include/openssl/opensslconf.h 131eng_ctrl.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
132eng_ctrl.o: ../../include/openssl/err.h ../../include/openssl/evp.h
133eng_ctrl.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
134eng_ctrl.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
117eng_ctrl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 135eng_ctrl.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
118eng_ctrl.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 136eng_ctrl.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
119eng_ctrl.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_ctrl.c eng_int.h 137eng_ctrl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
120eng_dyn.o: ../../e_os.h ../../include/openssl/bio.h 138eng_ctrl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
121eng_dyn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 139eng_ctrl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_ctrl.c eng_int.h
122eng_dyn.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h 140eng_dyn.o: ../../e_os.h ../../include/openssl/asn1.h
141eng_dyn.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
142eng_dyn.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
143eng_dyn.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
144eng_dyn.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
123eng_dyn.o: ../../include/openssl/engine.h ../../include/openssl/err.h 145eng_dyn.o: ../../include/openssl/engine.h ../../include/openssl/err.h
124eng_dyn.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 146eng_dyn.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
125eng_dyn.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 147eng_dyn.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
126eng_dyn.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 148eng_dyn.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
127eng_dyn.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_dyn.c eng_int.h 149eng_dyn.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
128eng_err.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 150eng_dyn.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
129eng_err.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 151eng_dyn.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
130eng_err.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 152eng_dyn.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
153eng_dyn.o: ../cryptlib.h eng_dyn.c eng_int.h
154eng_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
155eng_err.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
156eng_err.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
157eng_err.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
158eng_err.o: ../../include/openssl/engine.h ../../include/openssl/err.h
159eng_err.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
160eng_err.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
131eng_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 161eng_err.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
132eng_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 162eng_err.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
163eng_err.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
133eng_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 164eng_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
165eng_err.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
134eng_err.o: eng_err.c 166eng_err.o: eng_err.c
135eng_fat.o: ../../e_os.h ../../include/openssl/bio.h 167eng_fat.o: ../../e_os.h ../../include/openssl/asn1.h
136eng_fat.o: ../../include/openssl/buffer.h ../../include/openssl/conf.h 168eng_fat.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
137eng_fat.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 169eng_fat.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
170eng_fat.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
171eng_fat.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
138eng_fat.o: ../../include/openssl/engine.h ../../include/openssl/err.h 172eng_fat.o: ../../include/openssl/engine.h ../../include/openssl/err.h
139eng_fat.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h 173eng_fat.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
140eng_fat.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 174eng_fat.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
141eng_fat.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 175eng_fat.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
142eng_fat.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_fat.c eng_int.h 176eng_fat.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
143eng_init.o: ../../e_os.h ../../include/openssl/bio.h 177eng_fat.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
144eng_init.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 178eng_fat.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
145eng_init.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 179eng_fat.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
146eng_init.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 180eng_fat.o: ../cryptlib.h eng_fat.c eng_int.h
147eng_init.o: ../../include/openssl/opensslconf.h 181eng_init.o: ../../e_os.h ../../include/openssl/asn1.h
182eng_init.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
183eng_init.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
184eng_init.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
185eng_init.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
186eng_init.o: ../../include/openssl/err.h ../../include/openssl/evp.h
187eng_init.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
188eng_init.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
148eng_init.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 189eng_init.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
149eng_init.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 190eng_init.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
150eng_init.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_init.c eng_int.h 191eng_init.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
151eng_lib.o: ../../e_os.h ../../include/openssl/bio.h 192eng_init.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
152eng_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 193eng_init.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_init.c eng_int.h
153eng_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 194eng_lib.o: ../../e_os.h ../../include/openssl/asn1.h
154eng_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 195eng_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
155eng_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 196eng_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
156eng_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h 197eng_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
157eng_lib.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 198eng_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
158eng_lib.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h eng_lib.c 199eng_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
159eng_list.o: ../../e_os.h ../../include/openssl/bio.h 200eng_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
160eng_list.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 201eng_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
161eng_list.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 202eng_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
162eng_list.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 203eng_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
163eng_list.o: ../../include/openssl/opensslconf.h 204eng_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
205eng_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
206eng_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
207eng_lib.o: ../cryptlib.h eng_int.h eng_lib.c
208eng_list.o: ../../e_os.h ../../include/openssl/asn1.h
209eng_list.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
210eng_list.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
211eng_list.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
212eng_list.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
213eng_list.o: ../../include/openssl/err.h ../../include/openssl/evp.h
214eng_list.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
215eng_list.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
164eng_list.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 216eng_list.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
165eng_list.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 217eng_list.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
166eng_list.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h eng_list.c 218eng_list.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
219eng_list.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
220eng_list.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_list.c
167eng_openssl.o: ../../e_os.h ../../include/openssl/asn1.h 221eng_openssl.o: ../../e_os.h ../../include/openssl/asn1.h
168eng_openssl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 222eng_openssl.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
169eng_openssl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h 223eng_openssl.o: ../../include/openssl/crypto.h ../../include/openssl/dh.h
@@ -183,106 +237,166 @@ eng_openssl.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
183eng_openssl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h 237eng_openssl.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
184eng_openssl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_openssl.c 238eng_openssl.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_openssl.c
185eng_padlock.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h 239eng_padlock.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
186eng_padlock.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 240eng_padlock.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
187eng_padlock.o: ../../include/openssl/dso.h ../../include/openssl/e_os2.h 241eng_padlock.o: ../../include/openssl/crypto.h ../../include/openssl/dso.h
242eng_padlock.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
243eng_padlock.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
188eng_padlock.o: ../../include/openssl/engine.h ../../include/openssl/err.h 244eng_padlock.o: ../../include/openssl/engine.h ../../include/openssl/err.h
189eng_padlock.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h 245eng_padlock.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
190eng_padlock.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 246eng_padlock.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
191eng_padlock.o: ../../include/openssl/opensslconf.h 247eng_padlock.o: ../../include/openssl/opensslconf.h
192eng_padlock.o: ../../include/openssl/opensslv.h 248eng_padlock.o: ../../include/openssl/opensslv.h
193eng_padlock.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h 249eng_padlock.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
194eng_padlock.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 250eng_padlock.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
195eng_padlock.o: ../../include/openssl/symhacks.h eng_padlock.c 251eng_padlock.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
196eng_pkey.o: ../../e_os.h ../../include/openssl/bio.h 252eng_padlock.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
197eng_pkey.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 253eng_padlock.o: ../../include/openssl/x509_vfy.h eng_padlock.c
198eng_pkey.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 254eng_pkey.o: ../../e_os.h ../../include/openssl/asn1.h
199eng_pkey.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 255eng_pkey.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
200eng_pkey.o: ../../include/openssl/opensslconf.h 256eng_pkey.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
257eng_pkey.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
258eng_pkey.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
259eng_pkey.o: ../../include/openssl/err.h ../../include/openssl/evp.h
260eng_pkey.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
261eng_pkey.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
201eng_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 262eng_pkey.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
202eng_pkey.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 263eng_pkey.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
203eng_pkey.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h eng_pkey.c 264eng_pkey.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
265eng_pkey.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
266eng_pkey.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h eng_pkey.c
204eng_table.o: ../../e_os.h ../../include/openssl/asn1.h 267eng_table.o: ../../e_os.h ../../include/openssl/asn1.h
205eng_table.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 268eng_table.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
206eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 269eng_table.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
207eng_table.o: ../../include/openssl/engine.h ../../include/openssl/err.h 270eng_table.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
208eng_table.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h 271eng_table.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
209eng_table.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 272eng_table.o: ../../include/openssl/err.h ../../include/openssl/evp.h
273eng_table.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
274eng_table.o: ../../include/openssl/objects.h
210eng_table.o: ../../include/openssl/opensslconf.h 275eng_table.o: ../../include/openssl/opensslconf.h
211eng_table.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 276eng_table.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
212eng_table.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 277eng_table.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
213eng_table.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h 278eng_table.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
279eng_table.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
280eng_table.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
214eng_table.o: eng_table.c 281eng_table.o: eng_table.c
215tb_cipher.o: ../../e_os.h ../../include/openssl/bio.h 282tb_cipher.o: ../../e_os.h ../../include/openssl/asn1.h
216tb_cipher.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 283tb_cipher.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
217tb_cipher.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 284tb_cipher.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
218tb_cipher.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 285tb_cipher.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
286tb_cipher.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
287tb_cipher.o: ../../include/openssl/err.h ../../include/openssl/evp.h
288tb_cipher.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
289tb_cipher.o: ../../include/openssl/objects.h
219tb_cipher.o: ../../include/openssl/opensslconf.h 290tb_cipher.o: ../../include/openssl/opensslconf.h
220tb_cipher.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 291tb_cipher.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
221tb_cipher.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 292tb_cipher.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
222tb_cipher.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h 293tb_cipher.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
294tb_cipher.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
295tb_cipher.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
223tb_cipher.o: tb_cipher.c 296tb_cipher.o: tb_cipher.c
224tb_dh.o: ../../e_os.h ../../include/openssl/bio.h 297tb_dh.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
225tb_dh.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 298tb_dh.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
226tb_dh.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 299tb_dh.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
227tb_dh.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 300tb_dh.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
301tb_dh.o: ../../include/openssl/engine.h ../../include/openssl/err.h
302tb_dh.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
303tb_dh.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
228tb_dh.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 304tb_dh.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
229tb_dh.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 305tb_dh.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
306tb_dh.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
230tb_dh.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 307tb_dh.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
308tb_dh.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
231tb_dh.o: ../cryptlib.h eng_int.h tb_dh.c 309tb_dh.o: ../cryptlib.h eng_int.h tb_dh.c
232tb_digest.o: ../../e_os.h ../../include/openssl/bio.h 310tb_digest.o: ../../e_os.h ../../include/openssl/asn1.h
233tb_digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 311tb_digest.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
234tb_digest.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 312tb_digest.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
235tb_digest.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 313tb_digest.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
314tb_digest.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
315tb_digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
316tb_digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
317tb_digest.o: ../../include/openssl/objects.h
236tb_digest.o: ../../include/openssl/opensslconf.h 318tb_digest.o: ../../include/openssl/opensslconf.h
237tb_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 319tb_digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
238tb_digest.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 320tb_digest.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
239tb_digest.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h 321tb_digest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
322tb_digest.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
323tb_digest.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h
240tb_digest.o: tb_digest.c 324tb_digest.o: tb_digest.c
241tb_dsa.o: ../../e_os.h ../../include/openssl/bio.h 325tb_dsa.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
242tb_dsa.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 326tb_dsa.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
243tb_dsa.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 327tb_dsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
244tb_dsa.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 328tb_dsa.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
329tb_dsa.o: ../../include/openssl/engine.h ../../include/openssl/err.h
330tb_dsa.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
331tb_dsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
245tb_dsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 332tb_dsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
246tb_dsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 333tb_dsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
334tb_dsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
247tb_dsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 335tb_dsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
336tb_dsa.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
248tb_dsa.o: ../cryptlib.h eng_int.h tb_dsa.c 337tb_dsa.o: ../cryptlib.h eng_int.h tb_dsa.c
249tb_ecdh.o: ../../e_os.h ../../include/openssl/bio.h 338tb_ecdh.o: ../../e_os.h ../../include/openssl/asn1.h
250tb_ecdh.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 339tb_ecdh.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
251tb_ecdh.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 340tb_ecdh.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
252tb_ecdh.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 341tb_ecdh.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
253tb_ecdh.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 342tb_ecdh.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
254tb_ecdh.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 343tb_ecdh.o: ../../include/openssl/err.h ../../include/openssl/evp.h
255tb_ecdh.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 344tb_ecdh.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
256tb_ecdh.o: ../cryptlib.h eng_int.h tb_ecdh.c 345tb_ecdh.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
257tb_ecdsa.o: ../../e_os.h ../../include/openssl/bio.h 346tb_ecdh.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
258tb_ecdsa.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 347tb_ecdh.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
259tb_ecdsa.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 348tb_ecdh.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
260tb_ecdsa.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 349tb_ecdh.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
261tb_ecdsa.o: ../../include/openssl/opensslconf.h 350tb_ecdh.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_ecdh.c
351tb_ecdsa.o: ../../e_os.h ../../include/openssl/asn1.h
352tb_ecdsa.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
353tb_ecdsa.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
354tb_ecdsa.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
355tb_ecdsa.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
356tb_ecdsa.o: ../../include/openssl/err.h ../../include/openssl/evp.h
357tb_ecdsa.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
358tb_ecdsa.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
262tb_ecdsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 359tb_ecdsa.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
263tb_ecdsa.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 360tb_ecdsa.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
264tb_ecdsa.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h tb_ecdsa.c 361tb_ecdsa.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
265tb_rand.o: ../../e_os.h ../../include/openssl/bio.h 362tb_ecdsa.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
266tb_rand.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 363tb_ecdsa.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_ecdsa.c
267tb_rand.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 364tb_rand.o: ../../e_os.h ../../include/openssl/asn1.h
268tb_rand.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 365tb_rand.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
269tb_rand.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 366tb_rand.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
270tb_rand.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 367tb_rand.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
271tb_rand.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 368tb_rand.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
272tb_rand.o: ../cryptlib.h eng_int.h tb_rand.c 369tb_rand.o: ../../include/openssl/err.h ../../include/openssl/evp.h
273tb_rsa.o: ../../e_os.h ../../include/openssl/bio.h 370tb_rand.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
371tb_rand.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
372tb_rand.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
373tb_rand.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
374tb_rand.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
375tb_rand.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
376tb_rand.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_rand.c
377tb_rsa.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
274tb_rsa.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 378tb_rsa.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
275tb_rsa.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 379tb_rsa.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
276tb_rsa.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 380tb_rsa.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
381tb_rsa.o: ../../include/openssl/engine.h ../../include/openssl/err.h
382tb_rsa.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
383tb_rsa.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
277tb_rsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 384tb_rsa.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
278tb_rsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h 385tb_rsa.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
386tb_rsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
279tb_rsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 387tb_rsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
388tb_rsa.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
280tb_rsa.o: ../cryptlib.h eng_int.h tb_rsa.c 389tb_rsa.o: ../cryptlib.h eng_int.h tb_rsa.c
281tb_store.o: ../../e_os.h ../../include/openssl/bio.h 390tb_store.o: ../../e_os.h ../../include/openssl/asn1.h
282tb_store.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 391tb_store.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
283tb_store.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 392tb_store.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
284tb_store.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 393tb_store.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
285tb_store.o: ../../include/openssl/opensslconf.h 394tb_store.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
395tb_store.o: ../../include/openssl/err.h ../../include/openssl/evp.h
396tb_store.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
397tb_store.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
286tb_store.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 398tb_store.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
287tb_store.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 399tb_store.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
288tb_store.o: ../../include/openssl/symhacks.h ../cryptlib.h eng_int.h tb_store.c 400tb_store.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
401tb_store.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
402tb_store.o: ../../include/openssl/x509_vfy.h ../cryptlib.h eng_int.h tb_store.c
diff --git a/src/lib/libcrypto/engine/eng_all.c b/src/lib/libcrypto/engine/eng_all.c
index 8599046717..d29cd57dc2 100644
--- a/src/lib/libcrypto/engine/eng_all.c
+++ b/src/lib/libcrypto/engine/eng_all.c
@@ -107,6 +107,9 @@ void ENGINE_load_builtin_engines(void)
107#if defined(__OpenBSD__) || defined(__FreeBSD__) 107#if defined(__OpenBSD__) || defined(__FreeBSD__)
108 ENGINE_load_cryptodev(); 108 ENGINE_load_cryptodev();
109#endif 109#endif
110#if defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_NO_CAPIENG)
111 ENGINE_load_capi();
112#endif
110#endif 113#endif
111 } 114 }
112 115
diff --git a/src/lib/libcrypto/engine/eng_cnf.c b/src/lib/libcrypto/engine/eng_cnf.c
index a97e01e619..8417ddaaef 100644
--- a/src/lib/libcrypto/engine/eng_cnf.c
+++ b/src/lib/libcrypto/engine/eng_cnf.c
@@ -98,6 +98,8 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
98 CONF_VALUE *ecmd; 98 CONF_VALUE *ecmd;
99 char *ctrlname, *ctrlvalue; 99 char *ctrlname, *ctrlvalue;
100 ENGINE *e = NULL; 100 ENGINE *e = NULL;
101 int soft = 0;
102
101 name = skip_dot(name); 103 name = skip_dot(name);
102#ifdef ENGINE_CONF_DEBUG 104#ifdef ENGINE_CONF_DEBUG
103 fprintf(stderr, "Configuring engine %s\n", name); 105 fprintf(stderr, "Configuring engine %s\n", name);
@@ -125,6 +127,8 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
125 /* Override engine name to use */ 127 /* Override engine name to use */
126 if (!strcmp(ctrlname, "engine_id")) 128 if (!strcmp(ctrlname, "engine_id"))
127 name = ctrlvalue; 129 name = ctrlvalue;
130 else if (!strcmp(ctrlname, "soft_load"))
131 soft = 1;
128 /* Load a dynamic ENGINE */ 132 /* Load a dynamic ENGINE */
129 else if (!strcmp(ctrlname, "dynamic_path")) 133 else if (!strcmp(ctrlname, "dynamic_path"))
130 { 134 {
@@ -147,6 +151,11 @@ static int int_engine_configure(char *name, char *value, const CONF *cnf)
147 if (!e) 151 if (!e)
148 { 152 {
149 e = ENGINE_by_id(name); 153 e = ENGINE_by_id(name);
154 if (!e && soft)
155 {
156 ERR_clear_error();
157 return 1;
158 }
150 if (!e) 159 if (!e)
151 return 0; 160 return 0;
152 } 161 }
diff --git a/src/lib/libcrypto/engine/eng_err.c b/src/lib/libcrypto/engine/eng_err.c
index 369f2e22d3..574ffbb5c0 100644
--- a/src/lib/libcrypto/engine/eng_err.c
+++ b/src/lib/libcrypto/engine/eng_err.c
@@ -1,6 +1,6 @@
1/* crypto/engine/eng_err.c */ 1/* crypto/engine/eng_err.c */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1999-2008 The OpenSSL Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -92,6 +92,7 @@ static ERR_STRING_DATA ENGINE_str_functs[]=
92{ERR_FUNC(ENGINE_F_ENGINE_LIST_REMOVE), "ENGINE_LIST_REMOVE"}, 92{ERR_FUNC(ENGINE_F_ENGINE_LIST_REMOVE), "ENGINE_LIST_REMOVE"},
93{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY), "ENGINE_load_private_key"}, 93{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PRIVATE_KEY), "ENGINE_load_private_key"},
94{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY), "ENGINE_load_public_key"}, 94{ERR_FUNC(ENGINE_F_ENGINE_LOAD_PUBLIC_KEY), "ENGINE_load_public_key"},
95{ERR_FUNC(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT), "ENGINE_load_ssl_client_cert"},
95{ERR_FUNC(ENGINE_F_ENGINE_NEW), "ENGINE_new"}, 96{ERR_FUNC(ENGINE_F_ENGINE_NEW), "ENGINE_new"},
96{ERR_FUNC(ENGINE_F_ENGINE_REMOVE), "ENGINE_remove"}, 97{ERR_FUNC(ENGINE_F_ENGINE_REMOVE), "ENGINE_remove"},
97{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_STRING), "ENGINE_set_default_string"}, 98{ERR_FUNC(ENGINE_F_ENGINE_SET_DEFAULT_STRING), "ENGINE_set_default_string"},
diff --git a/src/lib/libcrypto/engine/eng_int.h b/src/lib/libcrypto/engine/eng_int.h
index a5b1edebf4..a66f107a44 100644
--- a/src/lib/libcrypto/engine/eng_int.h
+++ b/src/lib/libcrypto/engine/eng_int.h
@@ -170,6 +170,8 @@ struct engine_st
170 ENGINE_LOAD_KEY_PTR load_privkey; 170 ENGINE_LOAD_KEY_PTR load_privkey;
171 ENGINE_LOAD_KEY_PTR load_pubkey; 171 ENGINE_LOAD_KEY_PTR load_pubkey;
172 172
173 ENGINE_SSL_CLIENT_CERT_PTR load_ssl_client_cert;
174
173 const ENGINE_CMD_DEFN *cmd_defns; 175 const ENGINE_CMD_DEFN *cmd_defns;
174 int flags; 176 int flags;
175 /* reference count on the structure itself */ 177 /* reference count on the structure itself */
diff --git a/src/lib/libcrypto/engine/eng_pkey.c b/src/lib/libcrypto/engine/eng_pkey.c
index bc8b21abec..1dfa2e3664 100644
--- a/src/lib/libcrypto/engine/eng_pkey.c
+++ b/src/lib/libcrypto/engine/eng_pkey.c
@@ -69,6 +69,13 @@ int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f)
69 return 1; 69 return 1;
70 } 70 }
71 71
72int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
73 ENGINE_SSL_CLIENT_CERT_PTR loadssl_f)
74 {
75 e->load_ssl_client_cert = loadssl_f;
76 return 1;
77 }
78
72ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e) 79ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e)
73 { 80 {
74 return e->load_privkey; 81 return e->load_privkey;
@@ -79,6 +86,11 @@ ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e)
79 return e->load_pubkey; 86 return e->load_pubkey;
80 } 87 }
81 88
89ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e)
90 {
91 return e->load_ssl_client_cert;
92 }
93
82/* API functions to load public/private keys */ 94/* API functions to load public/private keys */
83 95
84EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, 96EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
@@ -152,3 +164,33 @@ EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
152 } 164 }
153 return pkey; 165 return pkey;
154 } 166 }
167
168int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
169 STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey,
170 STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data)
171 {
172
173 if(e == NULL)
174 {
175 ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT,
176 ERR_R_PASSED_NULL_PARAMETER);
177 return 0;
178 }
179 CRYPTO_w_lock(CRYPTO_LOCK_ENGINE);
180 if(e->funct_ref == 0)
181 {
182 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
183 ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT,
184 ENGINE_R_NOT_INITIALISED);
185 return 0;
186 }
187 CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE);
188 if (!e->load_ssl_client_cert)
189 {
190 ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT,
191 ENGINE_R_NO_LOAD_FUNCTION);
192 return 0;
193 }
194 return e->load_ssl_client_cert(e, s, ca_dn, pcert, ppkey, pother,
195 ui_method, callback_data);
196 }
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h
index 3ec59338ff..f503595ece 100644
--- a/src/lib/libcrypto/engine/engine.h
+++ b/src/lib/libcrypto/engine/engine.h
@@ -93,6 +93,8 @@
93#include <openssl/err.h> 93#include <openssl/err.h>
94#endif 94#endif
95 95
96#include <openssl/x509.h>
97
96#include <openssl/ossl_typ.h> 98#include <openssl/ossl_typ.h>
97#include <openssl/symhacks.h> 99#include <openssl/symhacks.h>
98 100
@@ -278,6 +280,9 @@ typedef int (*ENGINE_CTRL_FUNC_PTR)(ENGINE *, int, long, void *, void (*f)(void)
278/* Generic load_key function pointer */ 280/* Generic load_key function pointer */
279typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *, 281typedef EVP_PKEY * (*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
280 UI_METHOD *ui_method, void *callback_data); 282 UI_METHOD *ui_method, void *callback_data);
283typedef int (*ENGINE_SSL_CLIENT_CERT_PTR)(ENGINE *, SSL *ssl,
284 STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **pkey,
285 STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data);
281/* These callback types are for an ENGINE's handler for cipher and digest logic. 286/* These callback types are for an ENGINE's handler for cipher and digest logic.
282 * These handlers have these prototypes; 287 * These handlers have these prototypes;
283 * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid); 288 * int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
@@ -334,6 +339,9 @@ void ENGINE_load_ubsec(void);
334void ENGINE_load_cryptodev(void); 339void ENGINE_load_cryptodev(void);
335void ENGINE_load_padlock(void); 340void ENGINE_load_padlock(void);
336void ENGINE_load_builtin_engines(void); 341void ENGINE_load_builtin_engines(void);
342#ifndef OPENSSL_NO_CAPIENG
343void ENGINE_load_capi(void);
344#endif
337 345
338/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation 346/* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
339 * "registry" handling. */ 347 * "registry" handling. */
@@ -459,6 +467,8 @@ int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
459int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); 467int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
460int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); 468int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
461int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); 469int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
470int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
471 ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
462int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); 472int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
463int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); 473int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
464int ENGINE_set_flags(ENGINE *e, int flags); 474int ENGINE_set_flags(ENGINE *e, int flags);
@@ -494,6 +504,7 @@ ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
494ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); 504ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
495ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); 505ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
496ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); 506ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
507ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
497ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); 508ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
498ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); 509ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
499const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); 510const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
@@ -529,6 +540,10 @@ EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
529 UI_METHOD *ui_method, void *callback_data); 540 UI_METHOD *ui_method, void *callback_data);
530EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, 541EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
531 UI_METHOD *ui_method, void *callback_data); 542 UI_METHOD *ui_method, void *callback_data);
543int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
544 STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey,
545 STACK_OF(X509) **pother,
546 UI_METHOD *ui_method, void *callback_data);
532 547
533/* This returns a pointer for the current ENGINE structure that 548/* This returns a pointer for the current ENGINE structure that
534 * is (by default) performing any RSA operations. The value returned 549 * is (by default) performing any RSA operations. The value returned
@@ -723,6 +738,7 @@ void ERR_load_ENGINE_strings(void);
723#define ENGINE_F_ENGINE_LIST_REMOVE 121 738#define ENGINE_F_ENGINE_LIST_REMOVE 121
724#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150 739#define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
725#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151 740#define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
741#define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT 192
726#define ENGINE_F_ENGINE_NEW 122 742#define ENGINE_F_ENGINE_NEW 122
727#define ENGINE_F_ENGINE_REMOVE 123 743#define ENGINE_F_ENGINE_REMOVE 123
728#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189 744#define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index b6ff070e8f..7952e70ab0 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -149,6 +149,7 @@ static ERR_STRING_DATA ERR_str_libraries[]=
149{ERR_PACK(ERR_LIB_DSO,0,0) ,"DSO support routines"}, 149{ERR_PACK(ERR_LIB_DSO,0,0) ,"DSO support routines"},
150{ERR_PACK(ERR_LIB_ENGINE,0,0) ,"engine routines"}, 150{ERR_PACK(ERR_LIB_ENGINE,0,0) ,"engine routines"},
151{ERR_PACK(ERR_LIB_OCSP,0,0) ,"OCSP routines"}, 151{ERR_PACK(ERR_LIB_OCSP,0,0) ,"OCSP routines"},
152{ERR_PACK(ERR_LIB_FIPS,0,0) ,"FIPS routines"},
152{ERR_PACK(ERR_LIB_CMS,0,0) ,"CMS routines"}, 153{ERR_PACK(ERR_LIB_CMS,0,0) ,"CMS routines"},
153{0,NULL}, 154{0,NULL},
154 }; 155 };
diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h
index bf28fce492..8d9f0da172 100644
--- a/src/lib/libcrypto/err/err.h
+++ b/src/lib/libcrypto/err/err.h
@@ -140,7 +140,8 @@ typedef struct err_state_st
140#define ERR_LIB_ECDSA 42 140#define ERR_LIB_ECDSA 42
141#define ERR_LIB_ECDH 43 141#define ERR_LIB_ECDH 43
142#define ERR_LIB_STORE 44 142#define ERR_LIB_STORE 44
143#define ERR_LIB_CMS 45 143#define ERR_LIB_FIPS 45
144#define ERR_LIB_CMS 46
144 145
145#define ERR_LIB_USER 128 146#define ERR_LIB_USER 128
146 147
@@ -172,6 +173,7 @@ typedef struct err_state_st
172#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__) 173#define ECDSAerr(f,r) ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)
173#define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__) 174#define ECDHerr(f,r) ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__)
174#define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__) 175#define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)
176#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)
175#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__) 177#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)
176 178
177/* Borland C seems too stupid to be able to shift and do longs in 179/* Borland C seems too stupid to be able to shift and do longs in
diff --git a/src/lib/libcrypto/evp/Makefile b/src/lib/libcrypto/evp/Makefile
index 8f2555c7e5..9de56dc03d 100644
--- a/src/lib/libcrypto/evp/Makefile
+++ b/src/lib/libcrypto/evp/Makefile
@@ -135,13 +135,17 @@ bio_ok.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
135bio_ok.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_ok.c 135bio_ok.o: ../../include/openssl/symhacks.h ../cryptlib.h bio_ok.c
136c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 136c_all.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
137c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 137c_all.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
138c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 138c_all.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
139c_all.o: ../../include/openssl/err.h ../../include/openssl/evp.h 139c_all.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
140c_all.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 140c_all.o: ../../include/openssl/engine.h ../../include/openssl/err.h
141c_all.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 141c_all.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
142c_all.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 142c_all.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
143c_all.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 143c_all.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
144c_all.o: ../../include/openssl/symhacks.h ../cryptlib.h c_all.c 144c_all.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
145c_all.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
146c_all.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
147c_all.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
148c_all.o: ../cryptlib.h c_all.c
145c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 149c_allc.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
146c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 150c_allc.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
147c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h 151c_allc.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
@@ -170,13 +174,17 @@ c_alld.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
170c_alld.o: ../cryptlib.h c_alld.c 174c_alld.o: ../cryptlib.h c_alld.c
171digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h 175digest.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
172digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 176digest.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
173digest.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 177digest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
174digest.o: ../../include/openssl/err.h ../../include/openssl/evp.h 178digest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
175digest.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h 179digest.o: ../../include/openssl/engine.h ../../include/openssl/err.h
176digest.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h 180digest.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
177digest.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 181digest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
178digest.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 182digest.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
179digest.o: ../../include/openssl/symhacks.h ../cryptlib.h digest.c 183digest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
184digest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
185digest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
186digest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
187digest.o: ../cryptlib.h digest.c
180e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h 188e_aes.o: ../../include/openssl/aes.h ../../include/openssl/asn1.h
181e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h 189e_aes.o: ../../include/openssl/bio.h ../../include/openssl/crypto.h
182e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h 190e_aes.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
@@ -312,13 +320,17 @@ evp_acnf.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_acnf.c
312evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h 320evp_enc.o: ../../e_os.h ../../include/openssl/asn1.h
313evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 321evp_enc.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
314evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 322evp_enc.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
315evp_enc.o: ../../include/openssl/engine.h ../../include/openssl/err.h 323evp_enc.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
316evp_enc.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h 324evp_enc.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
317evp_enc.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h 325evp_enc.o: ../../include/openssl/err.h ../../include/openssl/evp.h
318evp_enc.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 326evp_enc.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
319evp_enc.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h 327evp_enc.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
320evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h 328evp_enc.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
321evp_enc.o: ../../include/openssl/symhacks.h ../cryptlib.h evp_enc.c evp_locl.h 329evp_enc.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
330evp_enc.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
331evp_enc.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
332evp_enc.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
333evp_enc.o: ../cryptlib.h evp_enc.c evp_locl.h
322evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h 334evp_err.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
323evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h 335evp_err.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
324evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h 336evp_err.o: ../../include/openssl/err.h ../../include/openssl/evp.h
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h
index c19d764c15..1aa2d6fb35 100644
--- a/src/lib/libcrypto/evp/evp.h
+++ b/src/lib/libcrypto/evp/evp.h
@@ -303,6 +303,8 @@ struct env_md_ctx_st
303 * cleaned */ 303 * cleaned */
304#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data 304#define EVP_MD_CTX_FLAG_REUSE 0x0004 /* Don't free up ctx->md_data
305 * in EVP_MD_CTX_cleanup */ 305 * in EVP_MD_CTX_cleanup */
306#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0x0008 /* Allow use of non FIPS digest
307 * in FIPS mode */
306 308
307struct evp_cipher_st 309struct evp_cipher_st
308 { 310 {
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index a1904993bf..6e582c458d 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -279,7 +279,12 @@ int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
279 { 279 {
280 int i,j,bl; 280 int i,j,bl;
281 281
282 OPENSSL_assert(inl > 0); 282 if (inl <= 0)
283 {
284 *outl = 0;
285 return inl == 0;
286 }
287
283 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0) 288 if(ctx->buf_len == 0 && (inl&(ctx->block_mask)) == 0)
284 { 289 {
285 if(ctx->cipher->do_cipher(ctx,out,in,inl)) 290 if(ctx->cipher->do_cipher(ctx,out,in,inl))
@@ -381,10 +386,10 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,
381 int fix_len; 386 int fix_len;
382 unsigned int b; 387 unsigned int b;
383 388
384 if (inl == 0) 389 if (inl <= 0)
385 { 390 {
386 *outl=0; 391 *outl = 0;
387 return 1; 392 return inl == 0;
388 } 393 }
389 394
390 if (ctx->flags & EVP_CIPH_NO_PADDING) 395 if (ctx->flags & EVP_CIPH_NO_PADDING)
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c
index c45e001492..1d140f7adb 100644
--- a/src/lib/libcrypto/hmac/hmac.c
+++ b/src/lib/libcrypto/hmac/hmac.c
@@ -171,3 +171,10 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
171 return(md); 171 return(md);
172 } 172 }
173 173
174void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags)
175 {
176 EVP_MD_CTX_set_flags(&ctx->i_ctx, flags);
177 EVP_MD_CTX_set_flags(&ctx->o_ctx, flags);
178 EVP_MD_CTX_set_flags(&ctx->md_ctx, flags);
179 }
180
diff --git a/src/lib/libcrypto/hmac/hmac.h b/src/lib/libcrypto/hmac/hmac.h
index 719fc408ac..fc38ffb52b 100644
--- a/src/lib/libcrypto/hmac/hmac.h
+++ b/src/lib/libcrypto/hmac/hmac.h
@@ -100,6 +100,7 @@ unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
100 const unsigned char *d, size_t n, unsigned char *md, 100 const unsigned char *d, size_t n, unsigned char *md,
101 unsigned int *md_len); 101 unsigned int *md_len);
102 102
103void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
103 104
104#ifdef __cplusplus 105#ifdef __cplusplus
105} 106}
diff --git a/src/lib/libcrypto/md32_common.h b/src/lib/libcrypto/md32_common.h
index 089c450290..61bcd9786f 100644
--- a/src/lib/libcrypto/md32_common.h
+++ b/src/lib/libcrypto/md32_common.h
@@ -301,7 +301,7 @@ int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len)
301 { 301 {
302 p=(unsigned char *)c->data; 302 p=(unsigned char *)c->data;
303 303
304 if ((n+len) >= HASH_CBLOCK) 304 if (len >= HASH_CBLOCK || len+n >= HASH_CBLOCK)
305 { 305 {
306 memcpy (p+n,data,HASH_CBLOCK-n); 306 memcpy (p+n,data,HASH_CBLOCK-n);
307 HASH_BLOCK_DATA_ORDER (c,p,1); 307 HASH_BLOCK_DATA_ORDER (c,p,1);
diff --git a/src/lib/libcrypto/objects/obj_mac.num b/src/lib/libcrypto/objects/obj_mac.num
index 47815b1e4e..53c9cb0d6a 100644
--- a/src/lib/libcrypto/objects/obj_mac.num
+++ b/src/lib/libcrypto/objects/obj_mac.num
@@ -788,3 +788,69 @@ id_ct_asciiTextWithCRLF 787
788id_aes128_wrap 788 788id_aes128_wrap 788
789id_aes192_wrap 789 789id_aes192_wrap 789
790id_aes256_wrap 790 790id_aes256_wrap 790
791ecdsa_with_Recommended 791
792ecdsa_with_Specified 792
793ecdsa_with_SHA224 793
794ecdsa_with_SHA256 794
795ecdsa_with_SHA384 795
796ecdsa_with_SHA512 796
797hmacWithMD5 797
798hmacWithSHA224 798
799hmacWithSHA256 799
800hmacWithSHA384 800
801hmacWithSHA512 801
802dsa_with_SHA224 802
803dsa_with_SHA256 803
804whirlpool 804
805cryptopro 805
806cryptocom 806
807id_GostR3411_94_with_GostR3410_2001 807
808id_GostR3411_94_with_GostR3410_94 808
809id_GostR3411_94 809
810id_HMACGostR3411_94 810
811id_GostR3410_2001 811
812id_GostR3410_94 812
813id_Gost28147_89 813
814gost89_cnt 814
815id_Gost28147_89_MAC 815
816id_GostR3411_94_prf 816
817id_GostR3410_2001DH 817
818id_GostR3410_94DH 818
819id_Gost28147_89_CryptoPro_KeyMeshing 819
820id_Gost28147_89_None_KeyMeshing 820
821id_GostR3411_94_TestParamSet 821
822id_GostR3411_94_CryptoProParamSet 822
823id_Gost28147_89_TestParamSet 823
824id_Gost28147_89_CryptoPro_A_ParamSet 824
825id_Gost28147_89_CryptoPro_B_ParamSet 825
826id_Gost28147_89_CryptoPro_C_ParamSet 826
827id_Gost28147_89_CryptoPro_D_ParamSet 827
828id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828
829id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829
830id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830
831id_GostR3410_94_TestParamSet 831
832id_GostR3410_94_CryptoPro_A_ParamSet 832
833id_GostR3410_94_CryptoPro_B_ParamSet 833
834id_GostR3410_94_CryptoPro_C_ParamSet 834
835id_GostR3410_94_CryptoPro_D_ParamSet 835
836id_GostR3410_94_CryptoPro_XchA_ParamSet 836
837id_GostR3410_94_CryptoPro_XchB_ParamSet 837
838id_GostR3410_94_CryptoPro_XchC_ParamSet 838
839id_GostR3410_2001_TestParamSet 839
840id_GostR3410_2001_CryptoPro_A_ParamSet 840
841id_GostR3410_2001_CryptoPro_B_ParamSet 841
842id_GostR3410_2001_CryptoPro_C_ParamSet 842
843id_GostR3410_2001_CryptoPro_XchA_ParamSet 843
844id_GostR3410_2001_CryptoPro_XchB_ParamSet 844
845id_GostR3410_94_a 845
846id_GostR3410_94_aBis 846
847id_GostR3410_94_b 847
848id_GostR3410_94_bBis 848
849id_Gost28147_89_cc 849
850id_GostR3410_94_cc 850
851id_GostR3410_2001_cc 851
852id_GostR3411_94_with_GostR3410_94_cc 852
853id_GostR3411_94_with_GostR3410_2001_cc 853
854id_GostR3410_2001_ParamSet_cc 854
855hmac 855
856LocalKeySet 856
diff --git a/src/lib/libcrypto/objects/objects.txt b/src/lib/libcrypto/objects/objects.txt
index 34c8d1d647..e009702e55 100644
--- a/src/lib/libcrypto/objects/objects.txt
+++ b/src/lib/libcrypto/objects/objects.txt
@@ -79,6 +79,12 @@ X9-62_primeCurve 7 : prime256v1
79!Alias id-ecSigType ansi-X9-62 4 79!Alias id-ecSigType ansi-X9-62 4
80!global 80!global
81X9-62_id-ecSigType 1 : ecdsa-with-SHA1 81X9-62_id-ecSigType 1 : ecdsa-with-SHA1
82X9-62_id-ecSigType 2 : ecdsa-with-Recommended
83X9-62_id-ecSigType 3 : ecdsa-with-Specified
84ecdsa-with-Specified 1 : ecdsa-with-SHA224
85ecdsa-with-Specified 2 : ecdsa-with-SHA256
86ecdsa-with-Specified 3 : ecdsa-with-SHA384
87ecdsa-with-Specified 4 : ecdsa-with-SHA512
82 88
83# SECG curve OIDs from "SEC 2: Recommended Elliptic Curve Domain Parameters" 89# SECG curve OIDs from "SEC 2: Recommended Elliptic Curve Domain Parameters"
84# (http://www.secg.org/) 90# (http://www.secg.org/)
@@ -313,6 +319,7 @@ pkcs9 20 : : friendlyName
313pkcs9 21 : : localKeyID 319pkcs9 21 : : localKeyID
314!Cname ms-csp-name 320!Cname ms-csp-name
3151 3 6 1 4 1 311 17 1 : CSPName : Microsoft CSP Name 3211 3 6 1 4 1 311 17 1 : CSPName : Microsoft CSP Name
3221 3 6 1 4 1 311 17 2 : LocalKeySet : Microsoft Local Key set
316!Alias certTypes pkcs9 22 323!Alias certTypes pkcs9 22
317certTypes 1 : : x509Certificate 324certTypes 1 : : x509Certificate
318certTypes 2 : : sdsiCertificate 325certTypes 2 : : sdsiCertificate
@@ -348,7 +355,15 @@ rsadsi 2 2 : MD2 : md2
348rsadsi 2 4 : MD4 : md4 355rsadsi 2 4 : MD4 : md4
349rsadsi 2 5 : MD5 : md5 356rsadsi 2 5 : MD5 : md5
350 : MD5-SHA1 : md5-sha1 357 : MD5-SHA1 : md5-sha1
358rsadsi 2 6 : : hmacWithMD5
351rsadsi 2 7 : : hmacWithSHA1 359rsadsi 2 7 : : hmacWithSHA1
360
361# From RFC4231
362rsadsi 2 8 : : hmacWithSHA224
363rsadsi 2 9 : : hmacWithSHA256
364rsadsi 2 10 : : hmacWithSHA384
365rsadsi 2 11 : : hmacWithSHA512
366
352rsadsi 3 2 : RC2-CBC : rc2-cbc 367rsadsi 3 2 : RC2-CBC : rc2-cbc
353 : RC2-ECB : rc2-ecb 368 : RC2-ECB : rc2-ecb
354!Cname rc2-cfb64 369!Cname rc2-cfb64
@@ -833,6 +848,11 @@ nist_hashalgs 2 : SHA384 : sha384
833nist_hashalgs 3 : SHA512 : sha512 848nist_hashalgs 3 : SHA512 : sha512
834nist_hashalgs 4 : SHA224 : sha224 849nist_hashalgs 4 : SHA224 : sha224
835 850
851# OIDs for dsa-with-sha224 and dsa-with-sha256
852!Alias dsa_with_sha2 nistAlgorithms 3
853dsa_with_sha2 1 : dsa_with_SHA224
854dsa_with_sha2 2 : dsa_with_SHA256
855
836# Hold instruction CRL entry extension 856# Hold instruction CRL entry extension
837!Cname hold-instruction-code 857!Cname hold-instruction-code
838id-ce 23 : holdInstructionCode : Hold Instruction Code 858id-ce 23 : holdInstructionCode : Hold Instruction Code
@@ -1070,13 +1090,93 @@ rsadsi 1 1 6 : rsaOAEPEncryptionSET
1070 : Oakley-EC2N-3 : ipsec3 1090 : Oakley-EC2N-3 : ipsec3
1071 : Oakley-EC2N-4 : ipsec4 1091 : Oakley-EC2N-4 : ipsec4
1072 1092
1093iso 0 10118 3 0 55 : whirlpool
1094
1095# GOST OIDs
1096
1097member-body 643 2 2 : cryptopro
1098member-body 643 2 9 : cryptocom
1099
1100cryptopro 3 : id-GostR3411-94-with-GostR3410-2001 : GOST R 34.11-94 with GOST R 34.10-2001
1101cryptopro 4 : id-GostR3411-94-with-GostR3410-94 : GOST R 34.11-94 with GOST R 34.10-94
1102!Cname id-GostR3411-94
1103cryptopro 9 : md_gost94 : GOST R 34.11-94
1104cryptopro 10 : id-HMACGostR3411-94 : HMAC GOST 34.11-94
1105!Cname id-GostR3410-2001
1106cryptopro 19 : gost2001 : GOST R 34.10-2001
1107!Cname id-GostR3410-94
1108cryptopro 20 : gost94 : GOST R 34.10-94
1109!Cname id-Gost28147-89
1110cryptopro 21 : gost89 : GOST 28147-89
1111 : gost89-cnt
1112!Cname id-Gost28147-89-MAC
1113cryptopro 22 : gost-mac : GOST 28147-89 MAC
1114!Cname id-GostR3411-94-prf
1115cryptopro 23 : prf-gostr3411-94 : GOST R 34.11-94 PRF
1116cryptopro 98 : id-GostR3410-2001DH : GOST R 34.10-2001 DH
1117cryptopro 99 : id-GostR3410-94DH : GOST R 34.10-94 DH
1118
1119cryptopro 14 1 : id-Gost28147-89-CryptoPro-KeyMeshing
1120cryptopro 14 0 : id-Gost28147-89-None-KeyMeshing
1121
1122# GOST parameter set OIDs
1123
1124cryptopro 30 0 : id-GostR3411-94-TestParamSet
1125cryptopro 30 1 : id-GostR3411-94-CryptoProParamSet
1126
1127cryptopro 31 0 : id-Gost28147-89-TestParamSet
1128cryptopro 31 1 : id-Gost28147-89-CryptoPro-A-ParamSet
1129cryptopro 31 2 : id-Gost28147-89-CryptoPro-B-ParamSet
1130cryptopro 31 3 : id-Gost28147-89-CryptoPro-C-ParamSet
1131cryptopro 31 4 : id-Gost28147-89-CryptoPro-D-ParamSet
1132cryptopro 31 5 : id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet
1133cryptopro 31 6 : id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet
1134cryptopro 31 7 : id-Gost28147-89-CryptoPro-RIC-1-ParamSet
1135
1136cryptopro 32 0 : id-GostR3410-94-TestParamSet
1137cryptopro 32 2 : id-GostR3410-94-CryptoPro-A-ParamSet
1138cryptopro 32 3 : id-GostR3410-94-CryptoPro-B-ParamSet
1139cryptopro 32 4 : id-GostR3410-94-CryptoPro-C-ParamSet
1140cryptopro 32 5 : id-GostR3410-94-CryptoPro-D-ParamSet
1141
1142cryptopro 33 1 : id-GostR3410-94-CryptoPro-XchA-ParamSet
1143cryptopro 33 2 : id-GostR3410-94-CryptoPro-XchB-ParamSet
1144cryptopro 33 3 : id-GostR3410-94-CryptoPro-XchC-ParamSet
1145
1146cryptopro 35 0 : id-GostR3410-2001-TestParamSet
1147cryptopro 35 1 : id-GostR3410-2001-CryptoPro-A-ParamSet
1148cryptopro 35 2 : id-GostR3410-2001-CryptoPro-B-ParamSet
1149cryptopro 35 3 : id-GostR3410-2001-CryptoPro-C-ParamSet
1150
1151cryptopro 36 0 : id-GostR3410-2001-CryptoPro-XchA-ParamSet
1152cryptopro 36 1 : id-GostR3410-2001-CryptoPro-XchB-ParamSet
1153
1154id-GostR3410-94 1 : id-GostR3410-94-a
1155id-GostR3410-94 2 : id-GostR3410-94-aBis
1156id-GostR3410-94 3 : id-GostR3410-94-b
1157id-GostR3410-94 4 : id-GostR3410-94-bBis
1158
1159# Cryptocom LTD GOST OIDs
1160
1161cryptocom 1 6 1 : id-Gost28147-89-cc : GOST 28147-89 Cryptocom ParamSet
1162!Cname id-GostR3410-94-cc
1163cryptocom 1 5 3 : gost94cc : GOST 34.10-94 Cryptocom
1164!Cname id-GostR3410-2001-cc
1165cryptocom 1 5 4 : gost2001cc : GOST 34.10-2001 Cryptocom
1166
1167cryptocom 1 3 3 : id-GostR3411-94-with-GostR3410-94-cc : GOST R 34.11-94 with GOST R 34.10-94 Cryptocom
1168cryptocom 1 3 4 : id-GostR3411-94-with-GostR3410-2001-cc : GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom
1169
1170cryptocom 1 8 1 : id-GostR3410-2001-ParamSet-cc : GOST R 3410-2001 Parameter Set Cryptocom
1073 1171
1074# Definitions for Camellia cipher - CBC MODE 1172# Definitions for Camellia cipher - CBC MODE
1173
10751 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC : camellia-128-cbc 11741 2 392 200011 61 1 1 1 2 : CAMELLIA-128-CBC : camellia-128-cbc
10761 2 392 200011 61 1 1 1 3 : CAMELLIA-192-CBC : camellia-192-cbc 11751 2 392 200011 61 1 1 1 3 : CAMELLIA-192-CBC : camellia-192-cbc
10771 2 392 200011 61 1 1 1 4 : CAMELLIA-256-CBC : camellia-256-cbc 11761 2 392 200011 61 1 1 1 4 : CAMELLIA-256-CBC : camellia-256-cbc
1078 1177
1079# Definitions for Camellia cipher - ECB, CFB, OFB MODE 1178# Definitions for Camellia cipher - ECB, CFB, OFB MODE
1179
1080!Alias ntt-ds 0 3 4401 5 1180!Alias ntt-ds 0 3 4401 5
1081!Alias camellia ntt-ds 3 1 9 1181!Alias camellia ntt-ds 3 1 9
1082 1182
@@ -1107,7 +1207,6 @@ camellia 44 : CAMELLIA-256-CFB : camellia-256-cfb
1107 : CAMELLIA-192-CFB8 : camellia-192-cfb8 1207 : CAMELLIA-192-CFB8 : camellia-192-cfb8
1108 : CAMELLIA-256-CFB8 : camellia-256-cfb8 1208 : CAMELLIA-256-CFB8 : camellia-256-cfb8
1109 1209
1110
1111# Definitions for SEED cipher - ECB, CBC, OFB mode 1210# Definitions for SEED cipher - ECB, CBC, OFB mode
1112 1211
1113member-body 410 200004 : KISA : kisa 1212member-body 410 200004 : KISA : kisa
@@ -1117,3 +1216,7 @@ kisa 1 4 : SEED-CBC : seed-cbc
1117kisa 1 5 : SEED-CFB : seed-cfb 1216kisa 1 5 : SEED-CFB : seed-cfb
1118!Cname seed-ofb128 1217!Cname seed-ofb128
1119kisa 1 6 : SEED-OFB : seed-ofb 1218kisa 1 6 : SEED-OFB : seed-ofb
1219
1220# There is no OID that just denotes "HMAC" oddly enough...
1221
1222 : HMAC : hmac
diff --git a/src/lib/libcrypto/opensslv.h b/src/lib/libcrypto/opensslv.h
index b308894f18..5bdd370ac9 100644
--- a/src/lib/libcrypto/opensslv.h
+++ b/src/lib/libcrypto/opensslv.h
@@ -25,11 +25,11 @@
25 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for 25 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
26 * major minor fix final patch/beta) 26 * major minor fix final patch/beta)
27 */ 27 */
28#define OPENSSL_VERSION_NUMBER 0x0090808fL 28#define OPENSSL_VERSION_NUMBER 0x0090809fL
29#ifdef OPENSSL_FIPS 29#ifdef OPENSSL_FIPS
30#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8h-fips 28 May 2008" 30#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8i-fips 15 Sep 2008"
31#else 31#else
32#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8h 28 May 2008" 32#define OPENSSL_VERSION_TEXT "OpenSSL 0.9.8i 15 Sep 2008"
33#endif 33#endif
34#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT 34#define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT
35 35
diff --git a/src/lib/libcrypto/ossl_typ.h b/src/lib/libcrypto/ossl_typ.h
index 345fb1dc4d..734200428f 100644
--- a/src/lib/libcrypto/ossl_typ.h
+++ b/src/lib/libcrypto/ossl_typ.h
@@ -140,6 +140,8 @@ typedef struct X509_crl_st X509_CRL;
140typedef struct X509_name_st X509_NAME; 140typedef struct X509_name_st X509_NAME;
141typedef struct x509_store_st X509_STORE; 141typedef struct x509_store_st X509_STORE;
142typedef struct x509_store_ctx_st X509_STORE_CTX; 142typedef struct x509_store_ctx_st X509_STORE_CTX;
143typedef struct ssl_st SSL;
144typedef struct ssl_ctx_st SSL_CTX;
143 145
144typedef struct v3_ext_ctx X509V3_CTX; 146typedef struct v3_ext_ctx X509V3_CTX;
145typedef struct conf_st CONF; 147typedef struct conf_st CONF;
diff --git a/src/lib/libcrypto/pkcs12/p12_crt.c b/src/lib/libcrypto/pkcs12/p12_crt.c
index dbafda17b6..9748256b6f 100644
--- a/src/lib/libcrypto/pkcs12/p12_crt.c
+++ b/src/lib/libcrypto/pkcs12/p12_crt.c
@@ -63,6 +63,19 @@
63 63
64static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags, PKCS12_SAFEBAG *bag); 64static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags, PKCS12_SAFEBAG *bag);
65 65
66static int copy_bag_attr(PKCS12_SAFEBAG *bag, EVP_PKEY *pkey, int nid)
67 {
68 int idx;
69 X509_ATTRIBUTE *attr;
70 idx = EVP_PKEY_get_attr_by_NID(pkey, nid, -1);
71 if (idx < 0)
72 return 1;
73 attr = EVP_PKEY_get_attr(pkey, idx);
74 if (!X509at_add1_attr(&bag->attrib, attr))
75 return 0;
76 return 1;
77 }
78
66PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert, 79PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
67 STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter, 80 STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter,
68 int keytype) 81 int keytype)
@@ -122,20 +135,15 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
122 135
123 if (pkey) 136 if (pkey)
124 { 137 {
125 int cspidx;
126 bag = PKCS12_add_key(&bags, pkey, keytype, iter, nid_key, pass); 138 bag = PKCS12_add_key(&bags, pkey, keytype, iter, nid_key, pass);
127 139
128 if (!bag) 140 if (!bag)
129 goto err; 141 goto err;
130 142
131 cspidx = EVP_PKEY_get_attr_by_NID(pkey, NID_ms_csp_name, -1); 143 if (!copy_bag_attr(bag, pkey, NID_ms_csp_name))
132 if (cspidx >= 0) 144 goto err;
133 { 145 if (!copy_bag_attr(bag, pkey, NID_LocalKeySet))
134 X509_ATTRIBUTE *cspattr; 146 goto err;
135 cspattr = EVP_PKEY_get_attr(pkey, cspidx);
136 if (!X509at_add1_attr(&bag->attrib, cspattr))
137 goto err;
138 }
139 147
140 if(name && !PKCS12_add_friendlyname(bag, name, -1)) 148 if(name && !PKCS12_add_friendlyname(bag, name, -1))
141 goto err; 149 goto err;
diff --git a/src/lib/libcrypto/rand/Makefile b/src/lib/libcrypto/rand/Makefile
index 3c1ab5bbae..27694aa664 100644
--- a/src/lib/libcrypto/rand/Makefile
+++ b/src/lib/libcrypto/rand/Makefile
@@ -97,14 +97,19 @@ rand_err.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
97rand_err.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 97rand_err.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h
98rand_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 98rand_err.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
99rand_err.o: rand_err.c 99rand_err.o: rand_err.c
100rand_lib.o: ../../e_os.h ../../include/openssl/bio.h 100rand_lib.o: ../../e_os.h ../../include/openssl/asn1.h
101rand_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 101rand_lib.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
102rand_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 102rand_lib.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
103rand_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 103rand_lib.o: ../../include/openssl/ec.h ../../include/openssl/ecdh.h
104rand_lib.o: ../../include/openssl/opensslconf.h 104rand_lib.o: ../../include/openssl/ecdsa.h ../../include/openssl/engine.h
105rand_lib.o: ../../include/openssl/err.h ../../include/openssl/evp.h
106rand_lib.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
107rand_lib.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
105rand_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h 108rand_lib.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
106rand_lib.o: ../../include/openssl/rand.h ../../include/openssl/safestack.h 109rand_lib.o: ../../include/openssl/pkcs7.h ../../include/openssl/rand.h
110rand_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
107rand_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 111rand_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
112rand_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
108rand_lib.o: ../cryptlib.h rand_lib.c 113rand_lib.o: ../cryptlib.h rand_lib.c
109rand_nw.o: ../../e_os.h ../../include/openssl/asn1.h 114rand_nw.o: ../../e_os.h ../../include/openssl/asn1.h
110rand_nw.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 115rand_nw.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h
diff --git a/src/lib/libcrypto/rsa/Makefile b/src/lib/libcrypto/rsa/Makefile
index 13900812ac..8f1c611800 100644
--- a/src/lib/libcrypto/rsa/Makefile
+++ b/src/lib/libcrypto/rsa/Makefile
@@ -133,12 +133,17 @@ rsa_gen.o: ../cryptlib.h rsa_gen.c
133rsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h 133rsa_lib.o: ../../e_os.h ../../include/openssl/asn1.h
134rsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 134rsa_lib.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
135rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h 135rsa_lib.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
136rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/engine.h 136rsa_lib.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
137rsa_lib.o: ../../include/openssl/err.h ../../include/openssl/lhash.h 137rsa_lib.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
138rsa_lib.o: ../../include/openssl/engine.h ../../include/openssl/err.h
139rsa_lib.o: ../../include/openssl/evp.h ../../include/openssl/lhash.h
140rsa_lib.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
138rsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h 141rsa_lib.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
139rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/rand.h 142rsa_lib.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
140rsa_lib.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h 143rsa_lib.o: ../../include/openssl/rand.h ../../include/openssl/rsa.h
144rsa_lib.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
141rsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h 145rsa_lib.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
146rsa_lib.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
142rsa_lib.o: ../cryptlib.h rsa_lib.c 147rsa_lib.o: ../cryptlib.h rsa_lib.c
143rsa_none.o: ../../e_os.h ../../include/openssl/asn1.h 148rsa_none.o: ../../e_os.h ../../include/openssl/asn1.h
144rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h 149rsa_none.o: ../../include/openssl/bio.h ../../include/openssl/bn.h
diff --git a/src/lib/libcrypto/rsa/rsa.h b/src/lib/libcrypto/rsa/rsa.h
index 6b5e4f8a9a..3699afaaaf 100644
--- a/src/lib/libcrypto/rsa/rsa.h
+++ b/src/lib/libcrypto/rsa/rsa.h
@@ -281,6 +281,7 @@ int RSA_print_fp(FILE *fp, const RSA *r,int offset);
281int RSA_print(BIO *bp, const RSA *r,int offset); 281int RSA_print(BIO *bp, const RSA *r,int offset);
282#endif 282#endif
283 283
284#ifndef OPENSSL_NO_RC4
284int i2d_RSA_NET(const RSA *a, unsigned char **pp, 285int i2d_RSA_NET(const RSA *a, unsigned char **pp,
285 int (*cb)(char *buf, int len, const char *prompt, int verify), 286 int (*cb)(char *buf, int len, const char *prompt, int verify),
286 int sgckey); 287 int sgckey);
@@ -294,6 +295,7 @@ int i2d_Netscape_RSA(const RSA *a, unsigned char **pp,
294RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length, 295RSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,
295 int (*cb)(char *buf, int len, const char *prompt, 296 int (*cb)(char *buf, int len, const char *prompt,
296 int verify)); 297 int verify));
298#endif
297 299
298/* The following 2 functions sign and verify a X509_SIG ASN1 object 300/* The following 2 functions sign and verify a X509_SIG ASN1 object
299 * inside PKCS#1 padded RSA encryption */ 301 * inside PKCS#1 padded RSA encryption */
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c
index 272c5eed18..5a6eda7961 100644
--- a/src/lib/libcrypto/rsa/rsa_eay.c
+++ b/src/lib/libcrypto/rsa/rsa_eay.c
@@ -150,16 +150,6 @@ const RSA_METHOD *RSA_PKCS1_SSLeay(void)
150 return(&rsa_pkcs1_eay_meth); 150 return(&rsa_pkcs1_eay_meth);
151 } 151 }
152 152
153/* Usage example;
154 * MONT_HELPER(rsa->_method_mod_p, bn_ctx, rsa->p, rsa->flags & RSA_FLAG_CACHE_PRIVATE, goto err);
155 */
156#define MONT_HELPER(method_mod, ctx, m, pre_cond, err_instr) \
157 if ((pre_cond) && ((method_mod) == NULL) && \
158 !BN_MONT_CTX_set_locked(&(method_mod), \
159 CRYPTO_LOCK_RSA, \
160 (m), (ctx))) \
161 err_instr
162
163static int RSA_eay_public_encrypt(int flen, const unsigned char *from, 153static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
164 unsigned char *to, RSA *rsa, int padding) 154 unsigned char *to, RSA *rsa, int padding)
165 { 155 {
@@ -233,7 +223,9 @@ static int RSA_eay_public_encrypt(int flen, const unsigned char *from,
233 goto err; 223 goto err;
234 } 224 }
235 225
236 MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err); 226 if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
227 if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, CRYPTO_LOCK_RSA, rsa->n, ctx))
228 goto err;
237 229
238 if (!rsa->meth->bn_mod_exp(ret,f,rsa->e,rsa->n,ctx, 230 if (!rsa->meth->bn_mod_exp(ret,f,rsa->e,rsa->n,ctx,
239 rsa->_method_mod_n)) goto err; 231 rsa->_method_mod_n)) goto err;
@@ -460,7 +452,9 @@ static int RSA_eay_private_encrypt(int flen, const unsigned char *from,
460 else 452 else
461 d= rsa->d; 453 d= rsa->d;
462 454
463 MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err); 455 if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
456 if(!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, CRYPTO_LOCK_RSA, rsa->n, ctx))
457 goto err;
464 458
465 if (!rsa->meth->bn_mod_exp(ret,f,d,rsa->n,ctx, 459 if (!rsa->meth->bn_mod_exp(ret,f,d,rsa->n,ctx,
466 rsa->_method_mod_n)) goto err; 460 rsa->_method_mod_n)) goto err;
@@ -581,7 +575,9 @@ static int RSA_eay_private_decrypt(int flen, const unsigned char *from,
581 else 575 else
582 d = rsa->d; 576 d = rsa->d;
583 577
584 MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err); 578 if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
579 if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, CRYPTO_LOCK_RSA, rsa->n, ctx))
580 goto err;
585 if (!rsa->meth->bn_mod_exp(ret,f,d,rsa->n,ctx, 581 if (!rsa->meth->bn_mod_exp(ret,f,d,rsa->n,ctx,
586 rsa->_method_mod_n)) 582 rsa->_method_mod_n))
587 goto err; 583 goto err;
@@ -691,7 +687,9 @@ static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
691 goto err; 687 goto err;
692 } 688 }
693 689
694 MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err); 690 if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
691 if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, CRYPTO_LOCK_RSA, rsa->n, ctx))
692 goto err;
695 693
696 if (!rsa->meth->bn_mod_exp(ret,f,rsa->e,rsa->n,ctx, 694 if (!rsa->meth->bn_mod_exp(ret,f,rsa->e,rsa->n,ctx,
697 rsa->_method_mod_n)) goto err; 695 rsa->_method_mod_n)) goto err;
@@ -769,11 +767,18 @@ static int RSA_eay_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
769 q = rsa->q; 767 q = rsa->q;
770 } 768 }
771 769
772 MONT_HELPER(rsa->_method_mod_p, ctx, p, rsa->flags & RSA_FLAG_CACHE_PRIVATE, goto err); 770 if (rsa->flags & RSA_FLAG_CACHE_PRIVATE)
773 MONT_HELPER(rsa->_method_mod_q, ctx, q, rsa->flags & RSA_FLAG_CACHE_PRIVATE, goto err); 771 {
772 if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_p, CRYPTO_LOCK_RSA, p, ctx))
773 goto err;
774 if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_q, CRYPTO_LOCK_RSA, q, ctx))
775 goto err;
776 }
774 } 777 }
775 778
776 MONT_HELPER(rsa->_method_mod_n, ctx, rsa->n, rsa->flags & RSA_FLAG_CACHE_PUBLIC, goto err); 779 if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
780 if (!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, CRYPTO_LOCK_RSA, rsa->n, ctx))
781 goto err;
777 782
778 /* compute I mod q */ 783 /* compute I mod q */
779 if (!(rsa->flags & RSA_FLAG_NO_CONSTTIME)) 784 if (!(rsa->flags & RSA_FLAG_NO_CONSTTIME))
diff --git a/src/lib/libcrypto/rsa/rsa_ssl.c b/src/lib/libcrypto/rsa/rsa_ssl.c
index ea72629494..cfeff15bc9 100644
--- a/src/lib/libcrypto/rsa/rsa_ssl.c
+++ b/src/lib/libcrypto/rsa/rsa_ssl.c
@@ -130,7 +130,7 @@ int RSA_padding_check_SSLv23(unsigned char *to, int tlen,
130 RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_NULL_BEFORE_BLOCK_MISSING); 130 RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23,RSA_R_NULL_BEFORE_BLOCK_MISSING);
131 return(-1); 131 return(-1);
132 } 132 }
133 for (k= -8; k<0; k++) 133 for (k = -9; k<-1; k++)
134 { 134 {
135 if (p[k] != 0x03) break; 135 if (p[k] != 0x03) break;
136 } 136 }
diff --git a/src/lib/libcrypto/sha/asm/sha1-586.pl b/src/lib/libcrypto/sha/asm/sha1-586.pl
index 0b4dab2bd5..a787dd37da 100644
--- a/src/lib/libcrypto/sha/asm/sha1-586.pl
+++ b/src/lib/libcrypto/sha/asm/sha1-586.pl
@@ -149,7 +149,7 @@ sub BODY_40_59
149 &add($f,$e); # f+=ROTATE(a,5) 149 &add($f,$e); # f+=ROTATE(a,5)
150 } 150 }
151 151
152&function_begin("sha1_block_data_order",16); 152&function_begin("sha1_block_data_order");
153 &mov($tmp1,&wparam(0)); # SHA_CTX *c 153 &mov($tmp1,&wparam(0)); # SHA_CTX *c
154 &mov($T,&wparam(1)); # const void *input 154 &mov($T,&wparam(1)); # const void *input
155 &mov($A,&wparam(2)); # size_t num 155 &mov($A,&wparam(2)); # size_t num
diff --git a/src/lib/libcrypto/stack/safestack.h b/src/lib/libcrypto/stack/safestack.h
index 78cc485e6d..40b17902e0 100644
--- a/src/lib/libcrypto/stack/safestack.h
+++ b/src/lib/libcrypto/stack/safestack.h
@@ -986,6 +986,50 @@ STACK_OF(type) \
986#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st)) 986#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))
987#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st)) 987#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st))
988 988
989#define sk_MIME_HEADER_new(st) SKM_sk_new(MIME_HEADER, (st))
990#define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER)
991#define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st))
992#define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st))
993#define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i))
994#define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val))
995#define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st))
996#define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val))
997#define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val))
998#define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val))
999#define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val))
1000#define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i))
1001#define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr))
1002#define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i))
1003#define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp))
1004#define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st)
1005#define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func))
1006#define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st))
1007#define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st))
1008#define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))
1009#define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st))
1010
1011#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st))
1012#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)
1013#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))
1014#define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st))
1015#define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i))
1016#define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val))
1017#define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st))
1018#define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val))
1019#define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val))
1020#define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val))
1021#define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val))
1022#define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i))
1023#define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr))
1024#define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i))
1025#define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp))
1026#define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st)
1027#define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func))
1028#define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st))
1029#define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st))
1030#define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st))
1031#define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st))
1032
989#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st)) 1033#define sk_MIME_PARAM_new(st) SKM_sk_new(MIME_PARAM, (st))
990#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM) 1034#define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)
991#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st)) 1035#define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))
diff --git a/src/lib/libcrypto/util/libeay.num b/src/lib/libcrypto/util/libeay.num
index 2989500c4b..62664f3c37 100644
--- a/src/lib/libcrypto/util/libeay.num
+++ b/src/lib/libcrypto/util/libeay.num
@@ -725,7 +725,7 @@ d2i_DSAPublicKey 731 EXIST::FUNCTION:DSA
725d2i_DSAparams 732 EXIST::FUNCTION:DSA 725d2i_DSAparams 732 EXIST::FUNCTION:DSA
726d2i_NETSCAPE_SPKAC 733 EXIST::FUNCTION: 726d2i_NETSCAPE_SPKAC 733 EXIST::FUNCTION:
727d2i_NETSCAPE_SPKI 734 EXIST::FUNCTION: 727d2i_NETSCAPE_SPKI 734 EXIST::FUNCTION:
728d2i_Netscape_RSA 735 EXIST::FUNCTION:RSA 728d2i_Netscape_RSA 735 EXIST::FUNCTION:RC4,RSA
729d2i_PKCS7 736 EXIST::FUNCTION: 729d2i_PKCS7 736 EXIST::FUNCTION:
730d2i_PKCS7_DIGEST 737 EXIST::FUNCTION: 730d2i_PKCS7_DIGEST 737 EXIST::FUNCTION:
731d2i_PKCS7_ENCRYPT 738 EXIST::FUNCTION: 731d2i_PKCS7_ENCRYPT 738 EXIST::FUNCTION:
@@ -827,7 +827,7 @@ i2d_DSAPublicKey 834 EXIST::FUNCTION:DSA
827i2d_DSAparams 835 EXIST::FUNCTION:DSA 827i2d_DSAparams 835 EXIST::FUNCTION:DSA
828i2d_NETSCAPE_SPKAC 836 EXIST::FUNCTION: 828i2d_NETSCAPE_SPKAC 836 EXIST::FUNCTION:
829i2d_NETSCAPE_SPKI 837 EXIST::FUNCTION: 829i2d_NETSCAPE_SPKI 837 EXIST::FUNCTION:
830i2d_Netscape_RSA 838 EXIST::FUNCTION:RSA 830i2d_Netscape_RSA 838 EXIST::FUNCTION:RC4,RSA
831i2d_PKCS7 839 EXIST::FUNCTION: 831i2d_PKCS7 839 EXIST::FUNCTION:
832i2d_PKCS7_DIGEST 840 EXIST::FUNCTION: 832i2d_PKCS7_DIGEST 840 EXIST::FUNCTION:
833i2d_PKCS7_ENCRYPT 841 EXIST::FUNCTION: 833i2d_PKCS7_ENCRYPT 841 EXIST::FUNCTION:
@@ -1814,9 +1814,9 @@ RAND_egd_bytes 2402 EXIST::FUNCTION:
1814X509_REQ_get1_email 2403 EXIST::FUNCTION: 1814X509_REQ_get1_email 2403 EXIST::FUNCTION:
1815X509_get1_email 2404 EXIST::FUNCTION: 1815X509_get1_email 2404 EXIST::FUNCTION:
1816X509_email_free 2405 EXIST::FUNCTION: 1816X509_email_free 2405 EXIST::FUNCTION:
1817i2d_RSA_NET 2406 EXIST::FUNCTION:RSA 1817i2d_RSA_NET 2406 EXIST::FUNCTION:RC4,RSA
1818d2i_RSA_NET_2 2407 NOEXIST::FUNCTION: 1818d2i_RSA_NET_2 2407 NOEXIST::FUNCTION:
1819d2i_RSA_NET 2408 EXIST::FUNCTION:RSA 1819d2i_RSA_NET 2408 EXIST::FUNCTION:RC4,RSA
1820DSO_bind_func 2409 EXIST::FUNCTION: 1820DSO_bind_func 2409 EXIST::FUNCTION:
1821CRYPTO_get_new_dynlockid 2410 EXIST::FUNCTION: 1821CRYPTO_get_new_dynlockid 2410 EXIST::FUNCTION:
1822sk_new_null 2411 EXIST::FUNCTION: 1822sk_new_null 2411 EXIST::FUNCTION:
@@ -2843,7 +2843,7 @@ FIPS_selftest_failed 3284 NOEXIST::FUNCTION:
2843sk_is_sorted 3285 EXIST::FUNCTION: 2843sk_is_sorted 3285 EXIST::FUNCTION:
2844X509_check_ca 3286 EXIST::FUNCTION: 2844X509_check_ca 3286 EXIST::FUNCTION:
2845private_idea_set_encrypt_key 3287 NOEXIST::FUNCTION: 2845private_idea_set_encrypt_key 3287 NOEXIST::FUNCTION:
2846HMAC_CTX_set_flags 3288 NOEXIST::FUNCTION: 2846HMAC_CTX_set_flags 3288 EXIST::FUNCTION:HMAC
2847private_SHA_Init 3289 NOEXIST::FUNCTION: 2847private_SHA_Init 3289 NOEXIST::FUNCTION:
2848private_CAST_set_key 3290 NOEXIST::FUNCTION: 2848private_CAST_set_key 3290 NOEXIST::FUNCTION:
2849private_RIPEMD160_Init 3291 NOEXIST::FUNCTION: 2849private_RIPEMD160_Init 3291 NOEXIST::FUNCTION:
@@ -3652,3 +3652,51 @@ CMS_set1_eContentType 4040 EXIST::FUNCTION:CMS
3652CMS_ReceiptRequest_create0 4041 EXIST::FUNCTION:CMS 3652CMS_ReceiptRequest_create0 4041 EXIST::FUNCTION:CMS
3653CMS_add1_signer 4042 EXIST::FUNCTION:CMS 3653CMS_add1_signer 4042 EXIST::FUNCTION:CMS
3654CMS_RecipientInfo_set0_pkey 4043 EXIST::FUNCTION:CMS 3654CMS_RecipientInfo_set0_pkey 4043 EXIST::FUNCTION:CMS
3655ENGINE_set_load_ssl_client_cert_function 4044 EXIST::FUNCTION:ENGINE
3656ENGINE_get_ssl_client_cert_function 4045 EXIST::FUNCTION:ENGINE
3657ENGINE_load_ssl_client_cert 4046 EXIST::FUNCTION:ENGINE
3658ENGINE_load_capi 4047 EXIST::FUNCTION:CAPIENG,ENGINE
3659OPENSSL_isservice 4048 EXIST::FUNCTION:
3660FIPS_dsa_sig_decode 4049 NOEXIST::FUNCTION:
3661EVP_CIPHER_CTX_clear_flags 4050 NOEXIST::FUNCTION:
3662FIPS_rand_status 4051 NOEXIST::FUNCTION:
3663FIPS_rand_set_key 4052 NOEXIST::FUNCTION:
3664CRYPTO_set_mem_info_functions 4053 NOEXIST::FUNCTION:
3665RSA_X931_generate_key_ex 4054 NOEXIST::FUNCTION:
3666int_ERR_set_state_func 4055 NOEXIST::FUNCTION:
3667int_EVP_MD_set_engine_callbacks 4056 NOEXIST::FUNCTION:
3668int_CRYPTO_set_do_dynlock_callback 4057 NOEXIST::FUNCTION:
3669FIPS_rng_stick 4058 NOEXIST::FUNCTION:
3670EVP_CIPHER_CTX_set_flags 4059 NOEXIST::FUNCTION:
3671BN_X931_generate_prime_ex 4060 NOEXIST::FUNCTION:
3672FIPS_selftest_check 4061 NOEXIST::FUNCTION:
3673FIPS_rand_set_dt 4062 NOEXIST::FUNCTION:
3674CRYPTO_dbg_pop_info 4063 NOEXIST::FUNCTION:
3675FIPS_dsa_free 4064 NOEXIST::FUNCTION:
3676RSA_X931_derive_ex 4065 NOEXIST::FUNCTION:
3677FIPS_rsa_new 4066 NOEXIST::FUNCTION:
3678FIPS_rand_bytes 4067 NOEXIST::FUNCTION:
3679fips_cipher_test 4068 NOEXIST::FUNCTION:
3680EVP_CIPHER_CTX_test_flags 4069 NOEXIST::FUNCTION:
3681CRYPTO_malloc_debug_init 4070 NOEXIST::FUNCTION:
3682CRYPTO_dbg_push_info 4071 NOEXIST::FUNCTION:
3683FIPS_corrupt_rsa_keygen 4072 NOEXIST::FUNCTION:
3684FIPS_dh_new 4073 NOEXIST::FUNCTION:
3685FIPS_corrupt_dsa_keygen 4074 NOEXIST::FUNCTION:
3686FIPS_dh_free 4075 NOEXIST::FUNCTION:
3687fips_pkey_signature_test 4076 NOEXIST::FUNCTION:
3688EVP_add_alg_module 4077 NOEXIST::FUNCTION:
3689int_RAND_init_engine_callbacks 4078 NOEXIST::FUNCTION:
3690int_EVP_CIPHER_set_engine_callbacks 4079 NOEXIST::FUNCTION:
3691int_EVP_MD_init_engine_callbacks 4080 NOEXIST::FUNCTION:
3692FIPS_rand_test_mode 4081 NOEXIST::FUNCTION:
3693FIPS_rand_reset 4082 NOEXIST::FUNCTION:
3694FIPS_dsa_new 4083 NOEXIST::FUNCTION:
3695int_RAND_set_callbacks 4084 NOEXIST::FUNCTION:
3696BN_X931_derive_prime_ex 4085 NOEXIST::FUNCTION:
3697int_ERR_lib_init 4086 NOEXIST::FUNCTION:
3698int_EVP_CIPHER_init_engine_callbacks 4087 NOEXIST::FUNCTION:
3699FIPS_rsa_free 4088 NOEXIST::FUNCTION:
3700FIPS_dsa_sig_encode 4089 NOEXIST::FUNCTION:
3701CRYPTO_dbg_remove_all_info 4090 NOEXIST::FUNCTION:
3702OPENSSL_init 4091 NOEXIST::FUNCTION:
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl
index 1ac5fd3a50..7ba804ce33 100644
--- a/src/lib/libcrypto/util/mk1mf.pl
+++ b/src/lib/libcrypto/util/mk1mf.pl
@@ -221,6 +221,7 @@ $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2;
221$cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; 221$cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3;
222$cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; 222$cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext;
223$cflags.=" -DOPENSSL_NO_CMS" if $no_cms; 223$cflags.=" -DOPENSSL_NO_CMS" if $no_cms;
224$cflags.=" -DOPENSSL_NO_CAPIENG" if $no_capieng;
224$cflags.=" -DOPENSSL_NO_ERR" if $no_err; 225$cflags.=" -DOPENSSL_NO_ERR" if $no_err;
225$cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; 226$cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5;
226$cflags.=" -DOPENSSL_NO_EC" if $no_ec; 227$cflags.=" -DOPENSSL_NO_EC" if $no_ec;
@@ -1017,6 +1018,7 @@ sub read_options
1017 "no-ssl3" => \$no_ssl3, 1018 "no-ssl3" => \$no_ssl3,
1018 "no-tlsext" => \$no_tlsext, 1019 "no-tlsext" => \$no_tlsext,
1019 "no-cms" => \$no_cms, 1020 "no-cms" => \$no_cms,
1021 "no-capieng" => \$no_capieng,
1020 "no-err" => \$no_err, 1022 "no-err" => \$no_err,
1021 "no-sock" => \$no_sock, 1023 "no-sock" => \$no_sock,
1022 "no-krb5" => \$no_krb5, 1024 "no-krb5" => \$no_krb5,
@@ -1100,7 +1102,7 @@ sub read_options
1100 } 1102 }
1101 } 1103 }
1102 } 1104 }
1103 elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; } 1105 elsif (/^([^=]*)=(.*)$/ && !/^-D/){ $VARS{$1}=$2; }
1104 elsif (/^-[lL].*$/) { $l_flags.="$_ "; } 1106 elsif (/^-[lL].*$/) { $l_flags.="$_ "; }
1105 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/) 1107 elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/)
1106 { $c_flags.="$_ "; } 1108 { $c_flags.="$_ "; }
diff --git a/src/lib/libcrypto/util/mkdef.pl b/src/lib/libcrypto/util/mkdef.pl
index ef1cc6e513..8ecfde1848 100644
--- a/src/lib/libcrypto/util/mkdef.pl
+++ b/src/lib/libcrypto/util/mkdef.pl
@@ -100,6 +100,8 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
100 "TLSEXT", 100 "TLSEXT",
101 # CMS 101 # CMS
102 "CMS", 102 "CMS",
103 # CryptoAPI Engine
104 "CAPIENG",
103 # Deprecated functions 105 # Deprecated functions
104 "DEPRECATED" ); 106 "DEPRECATED" );
105 107
@@ -120,7 +122,7 @@ my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5;
120my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; my $no_camellia; 122my $no_ec; my $no_ecdsa; my $no_ecdh; my $no_engine; my $no_hw; my $no_camellia;
121my $no_seed; 123my $no_seed;
122my $no_fp_api; my $no_static_engine; my $no_gmp; my $no_deprecated; 124my $no_fp_api; my $no_static_engine; my $no_gmp; my $no_deprecated;
123my $no_rfc3779; my $no_tlsext; my $no_cms; 125my $no_rfc3779; my $no_tlsext; my $no_cms; my $no_capieng;
124 126
125 127
126foreach (@ARGV, split(/ /, $options)) 128foreach (@ARGV, split(/ /, $options))
@@ -206,6 +208,7 @@ foreach (@ARGV, split(/ /, $options))
206 elsif (/^no-rfc3779$/) { $no_rfc3779=1; } 208 elsif (/^no-rfc3779$/) { $no_rfc3779=1; }
207 elsif (/^no-tlsext$/) { $no_tlsext=1; } 209 elsif (/^no-tlsext$/) { $no_tlsext=1; }
208 elsif (/^no-cms$/) { $no_cms=1; } 210 elsif (/^no-cms$/) { $no_cms=1; }
211 elsif (/^no-capieng$/) { $no_capieng=1; }
209 } 212 }
210 213
211 214
@@ -1131,6 +1134,7 @@ sub is_valid
1131 if ($keyword eq "RFC3779" && $no_rfc3779) { return 0; } 1134 if ($keyword eq "RFC3779" && $no_rfc3779) { return 0; }
1132 if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; } 1135 if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; }
1133 if ($keyword eq "CMS" && $no_cms) { return 0; } 1136 if ($keyword eq "CMS" && $no_cms) { return 0; }
1137 if ($keyword eq "CAPIENG" && $no_capieng) { return 0; }
1134 if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; } 1138 if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; }
1135 1139
1136 # Nothing recognise as true 1140 # Nothing recognise as true
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl
index 9cb2ab7e99..1e254119e6 100644
--- a/src/lib/libcrypto/util/pl/VC-32.pl
+++ b/src/lib/libcrypto/util/pl/VC-32.pl
@@ -138,7 +138,7 @@ if ($FLAVOR =~ /CE/)
138 } 138 }
139else 139else
140 { 140 {
141 $ex_libs.=' gdi32.lib advapi32.lib user32.lib'; 141 $ex_libs.=' gdi32.lib crypt32.lib advapi32.lib user32.lib';
142 $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/); 142 $ex_libs.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
143 } 143 }
144 144
@@ -259,7 +259,6 @@ sub do_lib_rule
259 $name =~ tr/a-z/A-Z/; 259 $name =~ tr/a-z/A-Z/;
260 $name = "/def:ms/${name}.def"; 260 $name = "/def:ms/${name}.def";
261 } 261 }
262
263# $target="\$(LIB_D)$o$target"; 262# $target="\$(LIB_D)$o$target";
264 $ret.="$target: $objs\n"; 263 $ret.="$target: $objs\n";
265 if (!$shlib) 264 if (!$shlib)
@@ -274,6 +273,10 @@ sub do_lib_rule
274 if ($name eq "") 273 if ($name eq "")
275 { 274 {
276 $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/); 275 $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
276 if ($target =~ /capi/)
277 {
278 $ex.=' crypt32.lib advapi32.lib';
279 }
277 } 280 }
278 elsif ($FLAVOR =~ /CE/) 281 elsif ($FLAVOR =~ /CE/)
279 { 282 {
@@ -283,6 +286,7 @@ sub do_lib_rule
283 { 286 {
284 $ex.=' unicows.lib' if ($FLAVOR =~ /NT/); 287 $ex.=' unicows.lib' if ($FLAVOR =~ /NT/);
285 $ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib'; 288 $ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib';
289 $ex.=' crypt32.lib';
286 $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/); 290 $ex.=' bufferoverflowu.lib' if ($FLAVOR =~ /WIN64/);
287 } 291 }
288 $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/; 292 $ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/;
diff --git a/src/lib/libcrypto/util/ssleay.num b/src/lib/libcrypto/util/ssleay.num
index b3ac136a56..2055cc1597 100644
--- a/src/lib/libcrypto/util/ssleay.num
+++ b/src/lib/libcrypto/util/ssleay.num
@@ -241,3 +241,4 @@ SSL_CTX_sess_get_remove_cb 289 EXIST::FUNCTION:
241SSL_set_SSL_CTX 290 EXIST::FUNCTION: 241SSL_set_SSL_CTX 290 EXIST::FUNCTION:
242SSL_get_servername 291 EXIST::FUNCTION:TLSEXT 242SSL_get_servername 291 EXIST::FUNCTION:TLSEXT
243SSL_get_servername_type 292 EXIST::FUNCTION:TLSEXT 243SSL_get_servername_type 292 EXIST::FUNCTION:TLSEXT
244SSL_CTX_set_client_cert_engine 293 EXIST::FUNCTION:ENGINE
diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c
index 511b49d589..98460e8921 100644
--- a/src/lib/libcrypto/x509/x509_att.c
+++ b/src/lib/libcrypto/x509/x509_att.c
@@ -245,7 +245,7 @@ X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
245 goto err; 245 goto err;
246 if (!X509_ATTRIBUTE_set1_data(ret,atrtype,data,len)) 246 if (!X509_ATTRIBUTE_set1_data(ret,atrtype,data,len))
247 goto err; 247 goto err;
248 248
249 if ((attr != NULL) && (*attr == NULL)) *attr=ret; 249 if ((attr != NULL) && (*attr == NULL)) *attr=ret;
250 return(ret); 250 return(ret);
251err: 251err:
@@ -302,8 +302,15 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *dat
302 atype = attrtype; 302 atype = attrtype;
303 } 303 }
304 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err; 304 if(!(attr->value.set = sk_ASN1_TYPE_new_null())) goto err;
305 attr->single = 0;
306 /* This is a bit naughty because the attribute should really have
307 * at least one value but some types use and zero length SET and
308 * require this.
309 */
310 if (attrtype == 0)
311 return 1;
305 if(!(ttmp = ASN1_TYPE_new())) goto err; 312 if(!(ttmp = ASN1_TYPE_new())) goto err;
306 if (len == -1) 313 if ((len == -1) && !(attrtype & MBSTRING_FLAG))
307 { 314 {
308 if (!ASN1_TYPE_set1(ttmp, attrtype, data)) 315 if (!ASN1_TYPE_set1(ttmp, attrtype, data))
309 goto err; 316 goto err;
@@ -311,7 +318,6 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *dat
311 else 318 else
312 ASN1_TYPE_set(ttmp, atype, stmp); 319 ASN1_TYPE_set(ttmp, atype, stmp);
313 if(!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err; 320 if(!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err;
314 attr->single = 0;
315 return 1; 321 return 1;
316 err: 322 err:
317 X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE); 323 X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE);
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c
index 9a62ebcf67..336c40ddd7 100644
--- a/src/lib/libcrypto/x509/x509_vfy.c
+++ b/src/lib/libcrypto/x509/x509_vfy.c
@@ -394,7 +394,7 @@ static int check_chain_extensions(X509_STORE_CTX *ctx)
394#ifdef OPENSSL_NO_CHAIN_VERIFY 394#ifdef OPENSSL_NO_CHAIN_VERIFY
395 return 1; 395 return 1;
396#else 396#else
397 int i, ok=0, must_be_ca; 397 int i, ok=0, must_be_ca, plen = 0;
398 X509 *x; 398 X509 *x;
399 int (*cb)(int xok,X509_STORE_CTX *xctx); 399 int (*cb)(int xok,X509_STORE_CTX *xctx);
400 int proxy_path_length = 0; 400 int proxy_path_length = 0;
@@ -495,9 +495,10 @@ static int check_chain_extensions(X509_STORE_CTX *ctx)
495 if (!ok) goto end; 495 if (!ok) goto end;
496 } 496 }
497 } 497 }
498 /* Check pathlen */ 498 /* Check pathlen if not self issued */
499 if ((i > 1) && (x->ex_pathlen != -1) 499 if ((i > 1) && !(x->ex_flags & EXFLAG_SI)
500 && (i > (x->ex_pathlen + proxy_path_length + 1))) 500 && (x->ex_pathlen != -1)
501 && (plen > (x->ex_pathlen + proxy_path_length + 1)))
501 { 502 {
502 ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED; 503 ctx->error = X509_V_ERR_PATH_LENGTH_EXCEEDED;
503 ctx->error_depth = i; 504 ctx->error_depth = i;
@@ -505,6 +506,9 @@ static int check_chain_extensions(X509_STORE_CTX *ctx)
505 ok=cb(0,ctx); 506 ok=cb(0,ctx);
506 if (!ok) goto end; 507 if (!ok) goto end;
507 } 508 }
509 /* Increment path length if not self issued */
510 if (!(x->ex_flags & EXFLAG_SI))
511 plen++;
508 /* If this certificate is a proxy certificate, the next 512 /* If this certificate is a proxy certificate, the next
509 certificate must be another proxy certificate or a EE 513 certificate must be another proxy certificate or a EE
510 certificate. If not, the next certificate must be a 514 certificate. If not, the next certificate must be a
diff --git a/src/lib/libcrypto/x509v3/pcy_data.c b/src/lib/libcrypto/x509v3/pcy_data.c
index 614d2b4935..4711b1ee92 100644
--- a/src/lib/libcrypto/x509v3/pcy_data.c
+++ b/src/lib/libcrypto/x509v3/pcy_data.c
@@ -87,6 +87,12 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id, int crit)
87 X509_POLICY_DATA *ret; 87 X509_POLICY_DATA *ret;
88 if (!policy && !id) 88 if (!policy && !id)
89 return NULL; 89 return NULL;
90 if (id)
91 {
92 id = OBJ_dup(id);
93 if (!id)
94 return NULL;
95 }
90 ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA)); 96 ret = OPENSSL_malloc(sizeof(X509_POLICY_DATA));
91 if (!ret) 97 if (!ret)
92 return NULL; 98 return NULL;
@@ -94,6 +100,8 @@ X509_POLICY_DATA *policy_data_new(POLICYINFO *policy, ASN1_OBJECT *id, int crit)
94 if (!ret->expected_policy_set) 100 if (!ret->expected_policy_set)
95 { 101 {
96 OPENSSL_free(ret); 102 OPENSSL_free(ret);
103 if (id)
104 ASN1_OBJECT_free(id);
97 return NULL; 105 return NULL;
98 } 106 }
99 107
diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c
index 4fda1d419a..b1ce77b9af 100644
--- a/src/lib/libcrypto/x509v3/pcy_tree.c
+++ b/src/lib/libcrypto/x509v3/pcy_tree.c
@@ -130,9 +130,9 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
130 ret = 2; 130 ret = 2;
131 if (explicit_policy > 0) 131 if (explicit_policy > 0)
132 { 132 {
133 explicit_policy--; 133 if (!(x->ex_flags & EXFLAG_SI))
134 if (!(x->ex_flags & EXFLAG_SS) 134 explicit_policy--;
135 && (cache->explicit_skip != -1) 135 if ((cache->explicit_skip != -1)
136 && (cache->explicit_skip < explicit_policy)) 136 && (cache->explicit_skip < explicit_policy))
137 explicit_policy = cache->explicit_skip; 137 explicit_policy = cache->explicit_skip;
138 } 138 }
@@ -197,13 +197,14 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
197 /* Any matching allowed if certificate is self 197 /* Any matching allowed if certificate is self
198 * issued and not the last in the chain. 198 * issued and not the last in the chain.
199 */ 199 */
200 if (!(x->ex_flags & EXFLAG_SS) || (i == 0)) 200 if (!(x->ex_flags & EXFLAG_SI) || (i == 0))
201 level->flags |= X509_V_FLAG_INHIBIT_ANY; 201 level->flags |= X509_V_FLAG_INHIBIT_ANY;
202 } 202 }
203 else 203 else
204 { 204 {
205 any_skip--; 205 if (!(x->ex_flags & EXFLAG_SI))
206 if ((cache->any_skip > 0) 206 any_skip--;
207 if ((cache->any_skip >= 0)
207 && (cache->any_skip < any_skip)) 208 && (cache->any_skip < any_skip))
208 any_skip = cache->any_skip; 209 any_skip = cache->any_skip;
209 } 210 }
@@ -213,7 +214,7 @@ static int tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs,
213 else 214 else
214 { 215 {
215 map_skip--; 216 map_skip--;
216 if ((cache->map_skip > 0) 217 if ((cache->map_skip >= 0)
217 && (cache->map_skip < map_skip)) 218 && (cache->map_skip < map_skip))
218 map_skip = cache->map_skip; 219 map_skip = cache->map_skip;
219 } 220 }
@@ -310,7 +311,8 @@ static int tree_link_any(X509_POLICY_LEVEL *curr,
310 311
311 if (data == NULL) 312 if (data == NULL)
312 return 0; 313 return 0;
313 data->qualifier_set = curr->anyPolicy->data->qualifier_set; 314 /* Curr may not have anyPolicy */
315 data->qualifier_set = cache->anyPolicy->qualifier_set;
314 data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS; 316 data->flags |= POLICY_DATA_FLAG_SHARED_QUALIFIERS;
315 if (!level_add_node(curr, data, node, tree)) 317 if (!level_add_node(curr, data, node, tree))
316 { 318 {
diff --git a/src/lib/libcrypto/x509v3/v3_addr.c b/src/lib/libcrypto/x509v3/v3_addr.c
index ed9847b307..c6730ab3fd 100644
--- a/src/lib/libcrypto/x509v3/v3_addr.c
+++ b/src/lib/libcrypto/x509v3/v3_addr.c
@@ -594,10 +594,10 @@ static IPAddressOrRanges *make_prefix_or_range(IPAddrBlocks *addr,
594 return NULL; 594 return NULL;
595 switch (afi) { 595 switch (afi) {
596 case IANA_AFI_IPV4: 596 case IANA_AFI_IPV4:
597 sk_IPAddressOrRange_set_cmp_func(aors, v4IPAddressOrRange_cmp); 597 (void)sk_IPAddressOrRange_set_cmp_func(aors, v4IPAddressOrRange_cmp);
598 break; 598 break;
599 case IANA_AFI_IPV6: 599 case IANA_AFI_IPV6:
600 sk_IPAddressOrRange_set_cmp_func(aors, v6IPAddressOrRange_cmp); 600 (void)sk_IPAddressOrRange_set_cmp_func(aors, v6IPAddressOrRange_cmp);
601 break; 601 break;
602 } 602 }
603 f->ipAddressChoice->type = IPAddressChoice_addressesOrRanges; 603 f->ipAddressChoice->type = IPAddressChoice_addressesOrRanges;
@@ -854,7 +854,7 @@ static int IPAddressOrRanges_canonize(IPAddressOrRanges *aors,
854 if (!make_addressRange(&merged, a_min, b_max, length)) 854 if (!make_addressRange(&merged, a_min, b_max, length))
855 return 0; 855 return 0;
856 sk_IPAddressOrRange_set(aors, i, merged); 856 sk_IPAddressOrRange_set(aors, i, merged);
857 sk_IPAddressOrRange_delete(aors, i + 1); 857 (void)sk_IPAddressOrRange_delete(aors, i + 1);
858 IPAddressOrRange_free(a); 858 IPAddressOrRange_free(a);
859 IPAddressOrRange_free(b); 859 IPAddressOrRange_free(b);
860 --i; 860 --i;
@@ -1122,7 +1122,7 @@ int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b)
1122 return 1; 1122 return 1;
1123 if (b == NULL || v3_addr_inherits(a) || v3_addr_inherits(b)) 1123 if (b == NULL || v3_addr_inherits(a) || v3_addr_inherits(b))
1124 return 0; 1124 return 0;
1125 sk_IPAddressFamily_set_cmp_func(b, IPAddressFamily_cmp); 1125 (void)sk_IPAddressFamily_set_cmp_func(b, IPAddressFamily_cmp);
1126 for (i = 0; i < sk_IPAddressFamily_num(a); i++) { 1126 for (i = 0; i < sk_IPAddressFamily_num(a); i++) {
1127 IPAddressFamily *fa = sk_IPAddressFamily_value(a, i); 1127 IPAddressFamily *fa = sk_IPAddressFamily_value(a, i);
1128 int j = sk_IPAddressFamily_find(b, fa); 1128 int j = sk_IPAddressFamily_find(b, fa);
@@ -1183,7 +1183,7 @@ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx,
1183 } 1183 }
1184 if (!v3_addr_is_canonical(ext)) 1184 if (!v3_addr_is_canonical(ext))
1185 validation_err(X509_V_ERR_INVALID_EXTENSION); 1185 validation_err(X509_V_ERR_INVALID_EXTENSION);
1186 sk_IPAddressFamily_set_cmp_func(ext, IPAddressFamily_cmp); 1186 (void)sk_IPAddressFamily_set_cmp_func(ext, IPAddressFamily_cmp);
1187 if ((child = sk_IPAddressFamily_dup(ext)) == NULL) { 1187 if ((child = sk_IPAddressFamily_dup(ext)) == NULL) {
1188 X509V3err(X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL, ERR_R_MALLOC_FAILURE); 1188 X509V3err(X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL, ERR_R_MALLOC_FAILURE);
1189 ret = 0; 1189 ret = 0;
@@ -1209,7 +1209,7 @@ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx,
1209 } 1209 }
1210 continue; 1210 continue;
1211 } 1211 }
1212 sk_IPAddressFamily_set_cmp_func(x->rfc3779_addr, IPAddressFamily_cmp); 1212 (void)sk_IPAddressFamily_set_cmp_func(x->rfc3779_addr, IPAddressFamily_cmp);
1213 for (j = 0; j < sk_IPAddressFamily_num(child); j++) { 1213 for (j = 0; j < sk_IPAddressFamily_num(child); j++) {
1214 IPAddressFamily *fc = sk_IPAddressFamily_value(child, j); 1214 IPAddressFamily *fc = sk_IPAddressFamily_value(child, j);
1215 int k = sk_IPAddressFamily_find(x->rfc3779_addr, fc); 1215 int k = sk_IPAddressFamily_find(x->rfc3779_addr, fc);
diff --git a/src/lib/libcrypto/x509v3/v3_asid.c b/src/lib/libcrypto/x509v3/v3_asid.c
index 271930f967..abd497ed1f 100644
--- a/src/lib/libcrypto/x509v3/v3_asid.c
+++ b/src/lib/libcrypto/x509v3/v3_asid.c
@@ -466,7 +466,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
466 break; 466 break;
467 } 467 }
468 ASIdOrRange_free(b); 468 ASIdOrRange_free(b);
469 sk_ASIdOrRange_delete(choice->u.asIdsOrRanges, i + 1); 469 (void)sk_ASIdOrRange_delete(choice->u.asIdsOrRanges, i + 1);
470 i--; 470 i--;
471 continue; 471 continue;
472 } 472 }
diff --git a/src/lib/libcrypto/x509v3/v3_purp.c b/src/lib/libcrypto/x509v3/v3_purp.c
index b2f5cdfa05..c54e7887c7 100644
--- a/src/lib/libcrypto/x509v3/v3_purp.c
+++ b/src/lib/libcrypto/x509v3/v3_purp.c
@@ -291,7 +291,9 @@ int X509_supported_extension(X509_EXTENSION *ex)
291 NID_sbgp_ipAddrBlock, /* 290 */ 291 NID_sbgp_ipAddrBlock, /* 290 */
292 NID_sbgp_autonomousSysNum, /* 291 */ 292 NID_sbgp_autonomousSysNum, /* 291 */
293#endif 293#endif
294 NID_proxyCertInfo /* 661 */ 294 NID_policy_constraints, /* 401 */
295 NID_proxyCertInfo, /* 661 */
296 NID_inhibit_any_policy /* 748 */
295 }; 297 };
296 298
297 int ex_nid; 299 int ex_nid;
@@ -325,7 +327,7 @@ static void x509v3_cache_extensions(X509 *x)
325#endif 327#endif
326 /* Does subject name match issuer ? */ 328 /* Does subject name match issuer ? */
327 if(!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x))) 329 if(!X509_NAME_cmp(X509_get_subject_name(x), X509_get_issuer_name(x)))
328 x->ex_flags |= EXFLAG_SS; 330 x->ex_flags |= EXFLAG_SI;
329 /* V1 should mean no extensions ... */ 331 /* V1 should mean no extensions ... */
330 if(!X509_get_version(x)) x->ex_flags |= EXFLAG_V1; 332 if(!X509_get_version(x)) x->ex_flags |= EXFLAG_V1;
331 /* Handle basic constraints */ 333 /* Handle basic constraints */
diff --git a/src/lib/libcrypto/x509v3/x509v3.h b/src/lib/libcrypto/x509v3/x509v3.h
index db2b0482c1..5ba59f71c9 100644
--- a/src/lib/libcrypto/x509v3/x509v3.h
+++ b/src/lib/libcrypto/x509v3/x509v3.h
@@ -363,6 +363,8 @@ DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
363#define EXFLAG_NSCERT 0x8 363#define EXFLAG_NSCERT 0x8
364 364
365#define EXFLAG_CA 0x10 365#define EXFLAG_CA 0x10
366/* Really self issued not necessarily self signed */
367#define EXFLAG_SI 0x20
366#define EXFLAG_SS 0x20 368#define EXFLAG_SS 0x20
367#define EXFLAG_V1 0x40 369#define EXFLAG_V1 0x40
368#define EXFLAG_INVALID 0x80 370#define EXFLAG_INVALID 0x80
@@ -370,7 +372,7 @@ DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)
370#define EXFLAG_CRITICAL 0x200 372#define EXFLAG_CRITICAL 0x200
371#define EXFLAG_PROXY 0x400 373#define EXFLAG_PROXY 0x400
372 374
373#define EXFLAG_INVALID_POLICY 0x400 375#define EXFLAG_INVALID_POLICY 0x800
374 376
375#define KU_DIGITAL_SIGNATURE 0x0080 377#define KU_DIGITAL_SIGNATURE 0x0080
376#define KU_NON_REPUDIATION 0x0040 378#define KU_NON_REPUDIATION 0x0040