diff options
Diffstat (limited to '')
75 files changed, 822 insertions, 461 deletions
diff --git a/src/lib/libcrypto/Attic/Makefile b/src/lib/libcrypto/Attic/Makefile index c1033f6d77..85d9f249c5 100644 --- a/src/lib/libcrypto/Attic/Makefile +++ b/src/lib/libcrypto/Attic/Makefile | |||
| @@ -74,7 +74,9 @@ x86_64cpuid.s: x86_64cpuid.pl | |||
| 74 | $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ | 74 | $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ |
| 75 | ia64cpuid.s: ia64cpuid.S | 75 | ia64cpuid.s: ia64cpuid.S |
| 76 | $(CC) $(CFLAGS) -E ia64cpuid.S > $@ | 76 | $(CC) $(CFLAGS) -E ia64cpuid.S > $@ |
| 77 | ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ | 77 | ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ |
| 78 | alphacpuid.s: alphacpuid.pl | ||
| 79 | $(PERL) $< | $(CC) -E - | tee $@ > /dev/null | ||
| 78 | 80 | ||
| 79 | testapps: | 81 | testapps: |
| 80 | [ -z "$(THIS)" ] || ( if echo $(SDIRS) | fgrep ' des '; \ | 82 | [ -z "$(THIS)" ] || ( if echo $(SDIRS) | fgrep ' des '; \ |
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c index c6fd204ae3..3348b8762c 100644 --- a/src/lib/libcrypto/asn1/a_int.c +++ b/src/lib/libcrypto/asn1/a_int.c | |||
| @@ -273,7 +273,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, | |||
| 273 | { | 273 | { |
| 274 | ASN1_INTEGER *ret=NULL; | 274 | ASN1_INTEGER *ret=NULL; |
| 275 | const unsigned char *p; | 275 | const unsigned char *p; |
| 276 | unsigned char *to,*s; | 276 | unsigned char *s; |
| 277 | long len; | 277 | long len; |
| 278 | int inf,tag,xclass; | 278 | int inf,tag,xclass; |
| 279 | int i; | 279 | int i; |
| @@ -308,7 +308,6 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, | |||
| 308 | i=ERR_R_MALLOC_FAILURE; | 308 | i=ERR_R_MALLOC_FAILURE; |
| 309 | goto err; | 309 | goto err; |
| 310 | } | 310 | } |
| 311 | to=s; | ||
| 312 | ret->type=V_ASN1_INTEGER; | 311 | ret->type=V_ASN1_INTEGER; |
| 313 | if(len) { | 312 | if(len) { |
| 314 | if ((*p == 0) && (len != 1)) | 313 | if ((*p == 0) && (len != 1)) |
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c index e5fbe7cbb1..3978c9150d 100644 --- a/src/lib/libcrypto/asn1/a_object.c +++ b/src/lib/libcrypto/asn1/a_object.c | |||
| @@ -139,7 +139,7 @@ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) | |||
| 139 | ASN1err(ASN1_F_A2D_ASN1_OBJECT,ASN1_R_INVALID_DIGIT); | 139 | ASN1err(ASN1_F_A2D_ASN1_OBJECT,ASN1_R_INVALID_DIGIT); |
| 140 | goto err; | 140 | goto err; |
| 141 | } | 141 | } |
| 142 | if (!use_bn && l > (ULONG_MAX / 10L)) | 142 | if (!use_bn && l >= ((ULONG_MAX - 80) / 10L)) |
| 143 | { | 143 | { |
| 144 | use_bn = 1; | 144 | use_bn = 1; |
| 145 | if (!bl) | 145 | if (!bl) |
| @@ -293,7 +293,7 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, | |||
| 293 | /* Sanity check OID encoding: can't have leading 0x80 in | 293 | /* Sanity check OID encoding: can't have leading 0x80 in |
| 294 | * subidentifiers, see: X.690 8.19.2 | 294 | * subidentifiers, see: X.690 8.19.2 |
| 295 | */ | 295 | */ |
| 296 | for (i = 0, p = *pp + 1; i < len - 1; i++, p++) | 296 | for (i = 0, p = *pp; i < len; i++, p++) |
| 297 | { | 297 | { |
| 298 | if (*p == 0x80 && (!i || !(p[-1] & 0x80))) | 298 | if (*p == 0x80 && (!i || !(p[-1] & 0x80))) |
| 299 | { | 299 | { |
diff --git a/src/lib/libcrypto/asn1/a_strex.c b/src/lib/libcrypto/asn1/a_strex.c index 7fc14d3296..264ebf2393 100644 --- a/src/lib/libcrypto/asn1/a_strex.c +++ b/src/lib/libcrypto/asn1/a_strex.c | |||
| @@ -74,6 +74,11 @@ | |||
| 74 | 74 | ||
| 75 | #define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253) | 75 | #define CHARTYPE_BS_ESC (ASN1_STRFLGS_ESC_2253 | CHARTYPE_FIRST_ESC_2253 | CHARTYPE_LAST_ESC_2253) |
| 76 | 76 | ||
| 77 | #define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \ | ||
| 78 | ASN1_STRFLGS_ESC_QUOTE | \ | ||
| 79 | ASN1_STRFLGS_ESC_CTRL | \ | ||
| 80 | ASN1_STRFLGS_ESC_MSB) | ||
| 81 | |||
| 77 | 82 | ||
| 78 | /* Three IO functions for sending data to memory, a BIO and | 83 | /* Three IO functions for sending data to memory, a BIO and |
| 79 | * and a FILE pointer. | 84 | * and a FILE pointer. |
| @@ -148,6 +153,13 @@ static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes, ch | |||
| 148 | if(!io_ch(arg, tmphex, 3)) return -1; | 153 | if(!io_ch(arg, tmphex, 3)) return -1; |
| 149 | return 3; | 154 | return 3; |
| 150 | } | 155 | } |
| 156 | /* If we get this far and do any escaping at all must escape | ||
| 157 | * the escape character itself: backslash. | ||
| 158 | */ | ||
| 159 | if (chtmp == '\\' && flags & ESC_FLAGS) { | ||
| 160 | if(!io_ch(arg, "\\\\", 2)) return -1; | ||
| 161 | return 2; | ||
| 162 | } | ||
| 151 | if(!io_ch(arg, &chtmp, 1)) return -1; | 163 | if(!io_ch(arg, &chtmp, 1)) return -1; |
| 152 | return 1; | 164 | return 1; |
| 153 | } | 165 | } |
| @@ -292,11 +304,6 @@ static const signed char tag2nbyte[] = { | |||
| 292 | 4, -1, 2 /* 28-30 */ | 304 | 4, -1, 2 /* 28-30 */ |
| 293 | }; | 305 | }; |
| 294 | 306 | ||
| 295 | #define ESC_FLAGS (ASN1_STRFLGS_ESC_2253 | \ | ||
| 296 | ASN1_STRFLGS_ESC_QUOTE | \ | ||
| 297 | ASN1_STRFLGS_ESC_CTRL | \ | ||
| 298 | ASN1_STRFLGS_ESC_MSB) | ||
| 299 | |||
| 300 | /* This is the main function, print out an | 307 | /* This is the main function, print out an |
| 301 | * ASN1_STRING taking note of various escape | 308 | * ASN1_STRING taking note of various escape |
| 302 | * and display options. Returns number of | 309 | * and display options. Returns number of |
diff --git a/src/lib/libcrypto/asn1/a_strnid.c b/src/lib/libcrypto/asn1/a_strnid.c index 753021a7a2..2fc48c1551 100644 --- a/src/lib/libcrypto/asn1/a_strnid.c +++ b/src/lib/libcrypto/asn1/a_strnid.c | |||
| @@ -95,7 +95,7 @@ unsigned long ASN1_STRING_get_default_mask(void) | |||
| 95 | * default: the default value, Printable, T61, BMP. | 95 | * default: the default value, Printable, T61, BMP. |
| 96 | */ | 96 | */ |
| 97 | 97 | ||
| 98 | int ASN1_STRING_set_default_mask_asc(char *p) | 98 | int ASN1_STRING_set_default_mask_asc(const char *p) |
| 99 | { | 99 | { |
| 100 | unsigned long mask; | 100 | unsigned long mask; |
| 101 | char *end; | 101 | char *end; |
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index f7718b5a94..59540e4e79 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
| @@ -1067,7 +1067,7 @@ ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, | |||
| 1067 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); | 1067 | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); |
| 1068 | 1068 | ||
| 1069 | void ASN1_STRING_set_default_mask(unsigned long mask); | 1069 | void ASN1_STRING_set_default_mask(unsigned long mask); |
| 1070 | int ASN1_STRING_set_default_mask_asc(char *p); | 1070 | int ASN1_STRING_set_default_mask_asc(const char *p); |
| 1071 | unsigned long ASN1_STRING_get_default_mask(void); | 1071 | unsigned long ASN1_STRING_get_default_mask(void); |
| 1072 | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, | 1072 | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, |
| 1073 | int inform, unsigned long mask); | 1073 | int inform, unsigned long mask); |
diff --git a/src/lib/libcrypto/asn1/n_pkey.c b/src/lib/libcrypto/asn1/n_pkey.c index 60bc437938..e7d0439062 100644 --- a/src/lib/libcrypto/asn1/n_pkey.c +++ b/src/lib/libcrypto/asn1/n_pkey.c | |||
| @@ -242,7 +242,7 @@ RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, | |||
| 242 | int sgckey) | 242 | int sgckey) |
| 243 | { | 243 | { |
| 244 | RSA *ret=NULL; | 244 | RSA *ret=NULL; |
| 245 | const unsigned char *p, *kp; | 245 | const unsigned char *p; |
| 246 | NETSCAPE_ENCRYPTED_PKEY *enckey = NULL; | 246 | NETSCAPE_ENCRYPTED_PKEY *enckey = NULL; |
| 247 | 247 | ||
| 248 | p = *pp; | 248 | p = *pp; |
| @@ -265,7 +265,6 @@ RSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length, | |||
| 265 | ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM); | 265 | ASN1err(ASN1_F_D2I_RSA_NET,ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM); |
| 266 | goto err; | 266 | goto err; |
| 267 | } | 267 | } |
| 268 | kp = enckey->enckey->digest->data; | ||
| 269 | if (cb == NULL) | 268 | if (cb == NULL) |
| 270 | cb=EVP_read_pw_string; | 269 | cb=EVP_read_pw_string; |
| 271 | if ((ret=d2i_RSA_NET_2(a, enckey->enckey->digest,cb, sgckey)) == NULL) goto err; | 270 | if ((ret=d2i_RSA_NET_2(a, enckey->enckey->digest,cb, sgckey)) == NULL) goto err; |
diff --git a/src/lib/libcrypto/asn1/t_crl.c b/src/lib/libcrypto/asn1/t_crl.c index bdb244c015..ee5a687ce8 100644 --- a/src/lib/libcrypto/asn1/t_crl.c +++ b/src/lib/libcrypto/asn1/t_crl.c | |||
| @@ -87,7 +87,7 @@ int X509_CRL_print(BIO *out, X509_CRL *x) | |||
| 87 | STACK_OF(X509_REVOKED) *rev; | 87 | STACK_OF(X509_REVOKED) *rev; |
| 88 | X509_REVOKED *r; | 88 | X509_REVOKED *r; |
| 89 | long l; | 89 | long l; |
| 90 | int i, n; | 90 | int i; |
| 91 | char *p; | 91 | char *p; |
| 92 | 92 | ||
| 93 | BIO_printf(out, "Certificate Revocation List (CRL):\n"); | 93 | BIO_printf(out, "Certificate Revocation List (CRL):\n"); |
| @@ -107,7 +107,6 @@ int X509_CRL_print(BIO *out, X509_CRL *x) | |||
| 107 | else BIO_printf(out,"NONE"); | 107 | else BIO_printf(out,"NONE"); |
| 108 | BIO_printf(out,"\n"); | 108 | BIO_printf(out,"\n"); |
| 109 | 109 | ||
| 110 | n=X509_CRL_get_ext_count(x); | ||
| 111 | X509V3_extensions_print(out, "CRL extensions", | 110 | X509V3_extensions_print(out, "CRL extensions", |
| 112 | x->crl->extensions, 0, 8); | 111 | x->crl->extensions, 0, 8); |
| 113 | 112 | ||
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c index 3bee439968..87d7dfdf5c 100644 --- a/src/lib/libcrypto/asn1/tasn_dec.c +++ b/src/lib/libcrypto/asn1/tasn_dec.c | |||
| @@ -168,7 +168,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
| 168 | int i; | 168 | int i; |
| 169 | int otag; | 169 | int otag; |
| 170 | int ret = 0; | 170 | int ret = 0; |
| 171 | ASN1_VALUE *pchval, **pchptr, *ptmpval; | 171 | ASN1_VALUE **pchptr, *ptmpval; |
| 172 | if (!pval) | 172 | if (!pval) |
| 173 | return 0; | 173 | return 0; |
| 174 | if (aux && aux->asn1_cb) | 174 | if (aux && aux->asn1_cb) |
| @@ -319,7 +319,6 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
| 319 | goto err; | 319 | goto err; |
| 320 | } | 320 | } |
| 321 | /* CHOICE type, try each possibility in turn */ | 321 | /* CHOICE type, try each possibility in turn */ |
| 322 | pchval = NULL; | ||
| 323 | p = *in; | 322 | p = *in; |
| 324 | for (i = 0, tt=it->templates; i < it->tcount; i++, tt++) | 323 | for (i = 0, tt=it->templates; i < it->tcount; i++, tt++) |
| 325 | { | 324 | { |
diff --git a/src/lib/libcrypto/asn1/x_name.c b/src/lib/libcrypto/asn1/x_name.c index caa4409feb..49be08b4da 100644 --- a/src/lib/libcrypto/asn1/x_name.c +++ b/src/lib/libcrypto/asn1/x_name.c | |||
| @@ -214,7 +214,9 @@ static int x509_name_ex_d2i(ASN1_VALUE **val, | |||
| 214 | *val = nm.a; | 214 | *val = nm.a; |
| 215 | *in = p; | 215 | *in = p; |
| 216 | return ret; | 216 | return ret; |
| 217 | err: | 217 | err: |
| 218 | if (nm.x != NULL) | ||
| 219 | X509_NAME_free(nm.x); | ||
| 218 | ASN1err(ASN1_F_X509_NAME_EX_D2I, ERR_R_NESTED_ASN1_ERROR); | 220 | ASN1err(ASN1_F_X509_NAME_EX_D2I, ERR_R_NESTED_ASN1_ERROR); |
| 219 | return 0; | 221 | return 0; |
| 220 | } | 222 | } |
| @@ -464,7 +466,8 @@ static int asn1_string_canon(ASN1_STRING *out, ASN1_STRING *in) | |||
| 464 | } | 466 | } |
| 465 | else | 467 | else |
| 466 | { | 468 | { |
| 467 | *to++ = tolower(*from++); | 469 | *to++ = tolower(*from); |
| 470 | from++; | ||
| 468 | i++; | 471 | i++; |
| 469 | } | 472 | } |
| 470 | } | 473 | } |
diff --git a/src/lib/libcrypto/asn1/x_x509.c b/src/lib/libcrypto/asn1/x_x509.c index dafd3cc921..de3df9eb51 100644 --- a/src/lib/libcrypto/asn1/x_x509.c +++ b/src/lib/libcrypto/asn1/x_x509.c | |||
| @@ -63,7 +63,7 @@ | |||
| 63 | #include <openssl/x509.h> | 63 | #include <openssl/x509.h> |
| 64 | #include <openssl/x509v3.h> | 64 | #include <openssl/x509v3.h> |
| 65 | 65 | ||
| 66 | ASN1_SEQUENCE(X509_CINF) = { | 66 | ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = { |
| 67 | ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0), | 67 | ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0), |
| 68 | ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER), | 68 | ASN1_SIMPLE(X509_CINF, serialNumber, ASN1_INTEGER), |
| 69 | ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR), | 69 | ASN1_SIMPLE(X509_CINF, signature, X509_ALGOR), |
| @@ -74,7 +74,7 @@ ASN1_SEQUENCE(X509_CINF) = { | |||
| 74 | ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1), | 74 | ASN1_IMP_OPT(X509_CINF, issuerUID, ASN1_BIT_STRING, 1), |
| 75 | ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2), | 75 | ASN1_IMP_OPT(X509_CINF, subjectUID, ASN1_BIT_STRING, 2), |
| 76 | ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3) | 76 | ASN1_EXP_SEQUENCE_OF_OPT(X509_CINF, extensions, X509_EXTENSION, 3) |
| 77 | } ASN1_SEQUENCE_END(X509_CINF) | 77 | } ASN1_SEQUENCE_END_enc(X509_CINF, X509_CINF) |
| 78 | 78 | ||
| 79 | IMPLEMENT_ASN1_FUNCTIONS(X509_CINF) | 79 | IMPLEMENT_ASN1_FUNCTIONS(X509_CINF) |
| 80 | /* X509 top level structure needs a bit of customisation */ | 80 | /* X509 top level structure needs a bit of customisation */ |
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c index 12b0a53a81..d47310d650 100644 --- a/src/lib/libcrypto/bio/b_sock.c +++ b/src/lib/libcrypto/bio/b_sock.c | |||
| @@ -551,7 +551,30 @@ int BIO_socket_ioctl(int fd, long type, void *arg) | |||
| 551 | #ifdef __DJGPP__ | 551 | #ifdef __DJGPP__ |
| 552 | i=ioctlsocket(fd,type,(char *)arg); | 552 | i=ioctlsocket(fd,type,(char *)arg); |
| 553 | #else | 553 | #else |
| 554 | i=ioctlsocket(fd,type,arg); | 554 | # if defined(OPENSSL_SYS_VMS) |
| 555 | /* 2011-02-18 SMS. | ||
| 556 | * VMS ioctl() can't tolerate a 64-bit "void *arg", but we | ||
| 557 | * observe that all the consumers pass in an "unsigned long *", | ||
| 558 | * so we arrange a local copy with a short pointer, and use | ||
| 559 | * that, instead. | ||
| 560 | */ | ||
| 561 | # if __INITIAL_POINTER_SIZE == 64 | ||
| 562 | # define ARG arg_32p | ||
| 563 | # pragma pointer_size save | ||
| 564 | # pragma pointer_size 32 | ||
| 565 | unsigned long arg_32; | ||
| 566 | unsigned long *arg_32p; | ||
| 567 | # pragma pointer_size restore | ||
| 568 | arg_32p = &arg_32; | ||
| 569 | arg_32 = *((unsigned long *) arg); | ||
| 570 | # else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 571 | # define ARG arg | ||
| 572 | # endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 573 | # else /* defined(OPENSSL_SYS_VMS) */ | ||
| 574 | # define ARG arg | ||
| 575 | # endif /* defined(OPENSSL_SYS_VMS) [else] */ | ||
| 576 | |||
| 577 | i=ioctlsocket(fd,type,ARG); | ||
| 555 | #endif /* __DJGPP__ */ | 578 | #endif /* __DJGPP__ */ |
| 556 | if (i < 0) | 579 | if (i < 0) |
| 557 | SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error()); | 580 | SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error()); |
| @@ -660,6 +683,7 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 660 | * note that commonly IPv6 wildchard socket can service | 683 | * note that commonly IPv6 wildchard socket can service |
| 661 | * IPv4 connections just as well... */ | 684 | * IPv4 connections just as well... */ |
| 662 | memset(&hint,0,sizeof(hint)); | 685 | memset(&hint,0,sizeof(hint)); |
| 686 | hint.ai_flags = AI_PASSIVE; | ||
| 663 | if (h) | 687 | if (h) |
| 664 | { | 688 | { |
| 665 | if (strchr(h,':')) | 689 | if (strchr(h,':')) |
| @@ -672,7 +696,10 @@ int BIO_get_accept_socket(char *host, int bind_mode) | |||
| 672 | #endif | 696 | #endif |
| 673 | } | 697 | } |
| 674 | else if (h[0]=='*' && h[1]=='\0') | 698 | else if (h[0]=='*' && h[1]=='\0') |
| 699 | { | ||
| 700 | hint.ai_family = AF_INET; | ||
| 675 | h=NULL; | 701 | h=NULL; |
| 702 | } | ||
| 676 | } | 703 | } |
| 677 | 704 | ||
| 678 | if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break; | 705 | if ((*p_getaddrinfo.f)(h,p,&hint,&res)) break; |
diff --git a/src/lib/libcrypto/bio/bf_nbio.c b/src/lib/libcrypto/bio/bf_nbio.c index c72a23c2e1..028616c064 100644 --- a/src/lib/libcrypto/bio/bf_nbio.c +++ b/src/lib/libcrypto/bio/bf_nbio.c | |||
| @@ -125,7 +125,6 @@ static int nbiof_free(BIO *a) | |||
| 125 | 125 | ||
| 126 | static int nbiof_read(BIO *b, char *out, int outl) | 126 | static int nbiof_read(BIO *b, char *out, int outl) |
| 127 | { | 127 | { |
| 128 | NBIO_TEST *nt; | ||
| 129 | int ret=0; | 128 | int ret=0; |
| 130 | #if 1 | 129 | #if 1 |
| 131 | int num; | 130 | int num; |
| @@ -134,7 +133,6 @@ static int nbiof_read(BIO *b, char *out, int outl) | |||
| 134 | 133 | ||
| 135 | if (out == NULL) return(0); | 134 | if (out == NULL) return(0); |
| 136 | if (b->next_bio == NULL) return(0); | 135 | if (b->next_bio == NULL) return(0); |
| 137 | nt=(NBIO_TEST *)b->ptr; | ||
| 138 | 136 | ||
| 139 | BIO_clear_retry_flags(b); | 137 | BIO_clear_retry_flags(b); |
| 140 | #if 1 | 138 | #if 1 |
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index 77f4de9c32..e12bc3a2ca 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c | |||
| @@ -110,7 +110,7 @@ int BIO_set(BIO *bio, BIO_METHOD *method) | |||
| 110 | 110 | ||
| 111 | int BIO_free(BIO *a) | 111 | int BIO_free(BIO *a) |
| 112 | { | 112 | { |
| 113 | int ret=0,i; | 113 | int i; |
| 114 | 114 | ||
| 115 | if (a == NULL) return(0); | 115 | if (a == NULL) return(0); |
| 116 | 116 | ||
| @@ -133,7 +133,7 @@ int BIO_free(BIO *a) | |||
| 133 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data); | 133 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data); |
| 134 | 134 | ||
| 135 | if ((a->method == NULL) || (a->method->destroy == NULL)) return(1); | 135 | if ((a->method == NULL) || (a->method->destroy == NULL)) return(1); |
| 136 | ret=a->method->destroy(a); | 136 | a->method->destroy(a); |
| 137 | OPENSSL_free(a); | 137 | OPENSSL_free(a); |
| 138 | return(1); | 138 | return(1); |
| 139 | } | 139 | } |
diff --git a/src/lib/libcrypto/bio/bss_acpt.c b/src/lib/libcrypto/bio/bss_acpt.c index 826f761143..5d49e1a72b 100644 --- a/src/lib/libcrypto/bio/bss_acpt.c +++ b/src/lib/libcrypto/bio/bss_acpt.c | |||
| @@ -340,7 +340,6 @@ static int acpt_write(BIO *b, const char *in, int inl) | |||
| 340 | 340 | ||
| 341 | static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr) | 341 | static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr) |
| 342 | { | 342 | { |
| 343 | BIO *dbio; | ||
| 344 | int *ip; | 343 | int *ip; |
| 345 | long ret=1; | 344 | long ret=1; |
| 346 | BIO_ACCEPT *data; | 345 | BIO_ACCEPT *data; |
| @@ -437,8 +436,8 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 437 | ret=(long)data->bind_mode; | 436 | ret=(long)data->bind_mode; |
| 438 | break; | 437 | break; |
| 439 | case BIO_CTRL_DUP: | 438 | case BIO_CTRL_DUP: |
| 440 | dbio=(BIO *)ptr; | 439 | /* dbio=(BIO *)ptr; |
| 441 | /* if (data->param_port) EAY EAY | 440 | if (data->param_port) EAY EAY |
| 442 | BIO_set_port(dbio,data->param_port); | 441 | BIO_set_port(dbio,data->param_port); |
| 443 | if (data->param_hostname) | 442 | if (data->param_hostname) |
| 444 | BIO_set_hostname(dbio,data->param_hostname); | 443 | BIO_set_hostname(dbio,data->param_hostname); |
diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c index eb7e365467..71ebe987b6 100644 --- a/src/lib/libcrypto/bio/bss_dgram.c +++ b/src/lib/libcrypto/bio/bss_dgram.c | |||
| @@ -57,7 +57,6 @@ | |||
| 57 | * | 57 | * |
| 58 | */ | 58 | */ |
| 59 | 59 | ||
| 60 | #ifndef OPENSSL_NO_DGRAM | ||
| 61 | 60 | ||
| 62 | #include <stdio.h> | 61 | #include <stdio.h> |
| 63 | #include <errno.h> | 62 | #include <errno.h> |
| @@ -65,6 +64,7 @@ | |||
| 65 | #include "cryptlib.h" | 64 | #include "cryptlib.h" |
| 66 | 65 | ||
| 67 | #include <openssl/bio.h> | 66 | #include <openssl/bio.h> |
| 67 | #ifndef OPENSSL_NO_DGRAM | ||
| 68 | 68 | ||
| 69 | #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) | 69 | #if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) |
| 70 | #include <sys/timeb.h> | 70 | #include <sys/timeb.h> |
| @@ -308,7 +308,6 @@ static int dgram_read(BIO *b, char *out, int outl) | |||
| 308 | OPENSSL_assert(sa.len.s<=sizeof(sa.peer)); | 308 | OPENSSL_assert(sa.len.s<=sizeof(sa.peer)); |
| 309 | sa.len.i = (int)sa.len.s; | 309 | sa.len.i = (int)sa.len.s; |
| 310 | } | 310 | } |
| 311 | dgram_reset_rcv_timeout(b); | ||
| 312 | 311 | ||
| 313 | if ( ! data->connected && ret >= 0) | 312 | if ( ! data->connected && ret >= 0) |
| 314 | BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, &sa.peer); | 313 | BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, &sa.peer); |
| @@ -322,6 +321,8 @@ static int dgram_read(BIO *b, char *out, int outl) | |||
| 322 | data->_errno = get_last_socket_error(); | 321 | data->_errno = get_last_socket_error(); |
| 323 | } | 322 | } |
| 324 | } | 323 | } |
| 324 | |||
| 325 | dgram_reset_rcv_timeout(b); | ||
| 325 | } | 326 | } |
| 326 | return(ret); | 327 | return(ret); |
| 327 | } | 328 | } |
| @@ -340,7 +341,7 @@ static int dgram_write(BIO *b, const char *in, int inl) | |||
| 340 | 341 | ||
| 341 | if (data->peer.sa.sa_family == AF_INET) | 342 | if (data->peer.sa.sa_family == AF_INET) |
| 342 | peerlen = sizeof(data->peer.sa_in); | 343 | peerlen = sizeof(data->peer.sa_in); |
| 343 | #if OPENSSL_USE_IVP6 | 344 | #if OPENSSL_USE_IPV6 |
| 344 | else if (data->peer.sa.sa_family == AF_INET6) | 345 | else if (data->peer.sa.sa_family == AF_INET6) |
| 345 | peerlen = sizeof(data->peer.sa_in6); | 346 | peerlen = sizeof(data->peer.sa_in6); |
| 346 | #endif | 347 | #endif |
| @@ -745,9 +746,13 @@ static int BIO_dgram_should_retry(int i) | |||
| 745 | { | 746 | { |
| 746 | err=get_last_socket_error(); | 747 | err=get_last_socket_error(); |
| 747 | 748 | ||
| 748 | #if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ | 749 | #if defined(OPENSSL_SYS_WINDOWS) |
| 749 | if ((i == -1) && (err == 0)) | 750 | /* If the socket return value (i) is -1 |
| 750 | return(1); | 751 | * and err is unexpectedly 0 at this point, |
| 752 | * the error code was overwritten by | ||
| 753 | * another system call before this error | ||
| 754 | * handling is called. | ||
| 755 | */ | ||
| 751 | #endif | 756 | #endif |
| 752 | 757 | ||
| 753 | return(BIO_dgram_non_fatal_error(err)); | 758 | return(BIO_dgram_non_fatal_error(err)); |
| @@ -810,7 +815,6 @@ int BIO_dgram_non_fatal_error(int err) | |||
| 810 | } | 815 | } |
| 811 | return(0); | 816 | return(0); |
| 812 | } | 817 | } |
| 813 | #endif | ||
| 814 | 818 | ||
| 815 | static void get_current_time(struct timeval *t) | 819 | static void get_current_time(struct timeval *t) |
| 816 | { | 820 | { |
| @@ -828,3 +832,5 @@ static void get_current_time(struct timeval *t) | |||
| 828 | gettimeofday(t, NULL); | 832 | gettimeofday(t, NULL); |
| 829 | #endif | 833 | #endif |
| 830 | } | 834 | } |
| 835 | |||
| 836 | #endif | ||
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c index 8bfa0bcd97..b954fe7ebc 100644 --- a/src/lib/libcrypto/bio/bss_file.c +++ b/src/lib/libcrypto/bio/bss_file.c | |||
| @@ -123,6 +123,7 @@ BIO *BIO_new_file(const char *filename, const char *mode) | |||
| 123 | 123 | ||
| 124 | #if defined(_WIN32) && defined(CP_UTF8) | 124 | #if defined(_WIN32) && defined(CP_UTF8) |
| 125 | int sz, len_0 = (int)strlen(filename)+1; | 125 | int sz, len_0 = (int)strlen(filename)+1; |
| 126 | DWORD flags; | ||
| 126 | 127 | ||
| 127 | /* | 128 | /* |
| 128 | * Basically there are three cases to cover: a) filename is | 129 | * Basically there are three cases to cover: a) filename is |
| @@ -136,17 +137,22 @@ BIO *BIO_new_file(const char *filename, const char *mode) | |||
| 136 | * ERROR_NO_UNICODE_TRANSLATION, in which case we fall | 137 | * ERROR_NO_UNICODE_TRANSLATION, in which case we fall |
| 137 | * back to fopen... | 138 | * back to fopen... |
| 138 | */ | 139 | */ |
| 139 | if ((sz=MultiByteToWideChar(CP_UTF8,MB_ERR_INVALID_CHARS, | 140 | if ((sz=MultiByteToWideChar(CP_UTF8,(flags=MB_ERR_INVALID_CHARS), |
| 141 | filename,len_0,NULL,0))>0 || | ||
| 142 | (GetLastError()==ERROR_INVALID_FLAGS && | ||
| 143 | (sz=MultiByteToWideChar(CP_UTF8,(flags=0), | ||
| 140 | filename,len_0,NULL,0))>0) | 144 | filename,len_0,NULL,0))>0) |
| 145 | ) | ||
| 141 | { | 146 | { |
| 142 | WCHAR wmode[8]; | 147 | WCHAR wmode[8]; |
| 143 | WCHAR *wfilename = _alloca(sz*sizeof(WCHAR)); | 148 | WCHAR *wfilename = _alloca(sz*sizeof(WCHAR)); |
| 144 | 149 | ||
| 145 | if (MultiByteToWideChar(CP_UTF8,MB_ERR_INVALID_CHARS, | 150 | if (MultiByteToWideChar(CP_UTF8,flags, |
| 146 | filename,len_0,wfilename,sz) && | 151 | filename,len_0,wfilename,sz) && |
| 147 | MultiByteToWideChar(CP_UTF8,0,mode,strlen(mode)+1, | 152 | MultiByteToWideChar(CP_UTF8,0,mode,strlen(mode)+1, |
| 148 | wmode,sizeof(wmode)/sizeof(wmode[0])) && | 153 | wmode,sizeof(wmode)/sizeof(wmode[0])) && |
| 149 | (file=_wfopen(wfilename,wmode))==NULL && errno==ENOENT | 154 | (file=_wfopen(wfilename,wmode))==NULL && |
| 155 | (errno==ENOENT || errno==EBADF) | ||
| 150 | ) /* UTF-8 decode succeeded, but no file, filename | 156 | ) /* UTF-8 decode succeeded, but no file, filename |
| 151 | * could still have been locale-ized... */ | 157 | * could still have been locale-ized... */ |
| 152 | file = fopen(filename,mode); | 158 | file = fopen(filename,mode); |
diff --git a/src/lib/libcrypto/bio/bss_log.c b/src/lib/libcrypto/bio/bss_log.c index 7ead044b37..b7dce5c1a2 100644 --- a/src/lib/libcrypto/bio/bss_log.c +++ b/src/lib/libcrypto/bio/bss_log.c | |||
| @@ -75,6 +75,15 @@ | |||
| 75 | # include <descrip.h> | 75 | # include <descrip.h> |
| 76 | # include <lib$routines.h> | 76 | # include <lib$routines.h> |
| 77 | # include <starlet.h> | 77 | # include <starlet.h> |
| 78 | /* Some compiler options may mask the declaration of "_malloc32". */ | ||
| 79 | # if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE | ||
| 80 | # if __INITIAL_POINTER_SIZE == 64 | ||
| 81 | # pragma pointer_size save | ||
| 82 | # pragma pointer_size 32 | ||
| 83 | void * _malloc32 (__size_t); | ||
| 84 | # pragma pointer_size restore | ||
| 85 | # endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 86 | # endif /* __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE */ | ||
| 78 | #elif defined(__ultrix) | 87 | #elif defined(__ultrix) |
| 79 | # include <sys/syslog.h> | 88 | # include <sys/syslog.h> |
| 80 | #elif defined(OPENSSL_SYS_NETWARE) | 89 | #elif defined(OPENSSL_SYS_NETWARE) |
| @@ -300,7 +309,24 @@ static void xopenlog(BIO* bp, char* name, int level) | |||
| 300 | static void xsyslog(BIO *bp, int priority, const char *string) | 309 | static void xsyslog(BIO *bp, int priority, const char *string) |
| 301 | { | 310 | { |
| 302 | struct dsc$descriptor_s opc_dsc; | 311 | struct dsc$descriptor_s opc_dsc; |
| 312 | |||
| 313 | /* Arrange 32-bit pointer to opcdef buffer and malloc(), if needed. */ | ||
| 314 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 315 | # pragma pointer_size save | ||
| 316 | # pragma pointer_size 32 | ||
| 317 | # define OPCDEF_TYPE __char_ptr32 | ||
| 318 | # define OPCDEF_MALLOC _malloc32 | ||
| 319 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 320 | # define OPCDEF_TYPE char * | ||
| 321 | # define OPCDEF_MALLOC OPENSSL_malloc | ||
| 322 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 323 | |||
| 303 | struct opcdef *opcdef_p; | 324 | struct opcdef *opcdef_p; |
| 325 | |||
| 326 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 327 | # pragma pointer_size restore | ||
| 328 | #endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 329 | |||
| 304 | char buf[10240]; | 330 | char buf[10240]; |
| 305 | unsigned int len; | 331 | unsigned int len; |
| 306 | struct dsc$descriptor_s buf_dsc; | 332 | struct dsc$descriptor_s buf_dsc; |
| @@ -326,8 +352,8 @@ static void xsyslog(BIO *bp, int priority, const char *string) | |||
| 326 | 352 | ||
| 327 | lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string); | 353 | lib$sys_fao(&fao_cmd, &len, &buf_dsc, priority_tag, string); |
| 328 | 354 | ||
| 329 | /* we know there's an 8 byte header. That's documented */ | 355 | /* We know there's an 8-byte header. That's documented. */ |
| 330 | opcdef_p = (struct opcdef *) OPENSSL_malloc(8 + len); | 356 | opcdef_p = OPCDEF_MALLOC( 8+ len); |
| 331 | opcdef_p->opc$b_ms_type = OPC$_RQ_RQST; | 357 | opcdef_p->opc$b_ms_type = OPC$_RQ_RQST; |
| 332 | memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3); | 358 | memcpy(opcdef_p->opc$z_ms_target_classes, &VMS_OPC_target, 3); |
| 333 | opcdef_p->opc$l_ms_rqstid = 0; | 359 | opcdef_p->opc$l_ms_rqstid = 0; |
| @@ -335,7 +361,7 @@ static void xsyslog(BIO *bp, int priority, const char *string) | |||
| 335 | 361 | ||
| 336 | opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | 362 | opc_dsc.dsc$b_dtype = DSC$K_DTYPE_T; |
| 337 | opc_dsc.dsc$b_class = DSC$K_CLASS_S; | 363 | opc_dsc.dsc$b_class = DSC$K_CLASS_S; |
| 338 | opc_dsc.dsc$a_pointer = (char *)opcdef_p; | 364 | opc_dsc.dsc$a_pointer = (OPCDEF_TYPE) opcdef_p; |
| 339 | opc_dsc.dsc$w_length = len + 8; | 365 | opc_dsc.dsc$w_length = len + 8; |
| 340 | 366 | ||
| 341 | sys$sndopr(opc_dsc, 0); | 367 | sys$sndopr(opc_dsc, 0); |
diff --git a/src/lib/libcrypto/bn/bn.h b/src/lib/libcrypto/bn/bn.h index e484b7fc11..a0bc47837d 100644 --- a/src/lib/libcrypto/bn/bn.h +++ b/src/lib/libcrypto/bn/bn.h | |||
| @@ -253,6 +253,24 @@ extern "C" { | |||
| 253 | #define BN_HEX_FMT2 "%08X" | 253 | #define BN_HEX_FMT2 "%08X" |
| 254 | #endif | 254 | #endif |
| 255 | 255 | ||
| 256 | /* 2011-02-22 SMS. | ||
| 257 | * In various places, a size_t variable or a type cast to size_t was | ||
| 258 | * used to perform integer-only operations on pointers. This failed on | ||
| 259 | * VMS with 64-bit pointers (CC /POINTER_SIZE = 64) because size_t is | ||
| 260 | * still only 32 bits. What's needed in these cases is an integer type | ||
| 261 | * with the same size as a pointer, which size_t is not certain to be. | ||
| 262 | * The only fix here is VMS-specific. | ||
| 263 | */ | ||
| 264 | #if defined(OPENSSL_SYS_VMS) | ||
| 265 | # if __INITIAL_POINTER_SIZE == 64 | ||
| 266 | # define PTR_SIZE_INT long long | ||
| 267 | # else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 268 | # define PTR_SIZE_INT int | ||
| 269 | # endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 270 | #else /* defined(OPENSSL_SYS_VMS) */ | ||
| 271 | # define PTR_SIZE_INT size_t | ||
| 272 | #endif /* defined(OPENSSL_SYS_VMS) [else] */ | ||
| 273 | |||
| 256 | #define BN_DEFAULT_BITS 1280 | 274 | #define BN_DEFAULT_BITS 1280 |
| 257 | 275 | ||
| 258 | #define BN_FLG_MALLOCED 0x01 | 276 | #define BN_FLG_MALLOCED 0x01 |
diff --git a/src/lib/libcrypto/bn/bn_exp2.c b/src/lib/libcrypto/bn/bn_exp2.c index b3f43cec8c..bd0c34b91b 100644 --- a/src/lib/libcrypto/bn/bn_exp2.c +++ b/src/lib/libcrypto/bn/bn_exp2.c | |||
| @@ -301,7 +301,8 @@ int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1, | |||
| 301 | r_is_one = 0; | 301 | r_is_one = 0; |
| 302 | } | 302 | } |
| 303 | } | 303 | } |
| 304 | BN_from_montgomery(rr,r,mont,ctx); | 304 | if (!BN_from_montgomery(rr,r,mont,ctx)) |
| 305 | goto err; | ||
| 305 | ret=1; | 306 | ret=1; |
| 306 | err: | 307 | err: |
| 307 | if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont); | 308 | if ((in_mont == NULL) && (mont != NULL)) BN_MONT_CTX_free(mont); |
diff --git a/src/lib/libcrypto/bn/bn_gf2m.c b/src/lib/libcrypto/bn/bn_gf2m.c index 527b0fa15b..432a3aa338 100644 --- a/src/lib/libcrypto/bn/bn_gf2m.c +++ b/src/lib/libcrypto/bn/bn_gf2m.c | |||
| @@ -545,6 +545,7 @@ int BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | |||
| 545 | { | 545 | { |
| 546 | while (!BN_is_odd(u)) | 546 | while (!BN_is_odd(u)) |
| 547 | { | 547 | { |
| 548 | if (BN_is_zero(u)) goto err; | ||
| 548 | if (!BN_rshift1(u, u)) goto err; | 549 | if (!BN_rshift1(u, u)) goto err; |
| 549 | if (BN_is_odd(b)) | 550 | if (BN_is_odd(b)) |
| 550 | { | 551 | { |
diff --git a/src/lib/libcrypto/bn/bn_mont.c b/src/lib/libcrypto/bn/bn_mont.c index 7224637ab3..1a866880f5 100644 --- a/src/lib/libcrypto/bn/bn_mont.c +++ b/src/lib/libcrypto/bn/bn_mont.c | |||
| @@ -277,7 +277,7 @@ static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont) | |||
| 277 | m1|=m2; /* (al!=ri) */ | 277 | m1|=m2; /* (al!=ri) */ |
| 278 | m1|=(0-(size_t)v); /* (al!=ri || v) */ | 278 | m1|=(0-(size_t)v); /* (al!=ri || v) */ |
| 279 | m1&=~m2; /* (al!=ri || v) && !al>ri */ | 279 | m1&=~m2; /* (al!=ri || v) && !al>ri */ |
| 280 | nrp=(BN_ULONG *)(((size_t)rp&~m1)|((size_t)ap&m1)); | 280 | nrp=(BN_ULONG *)(((PTR_SIZE_INT)rp&~m1)|((PTR_SIZE_INT)ap&m1)); |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | /* 'i<ri' is chosen to eliminate dependency on input data, even | 283 | /* 'i<ri' is chosen to eliminate dependency on input data, even |
diff --git a/src/lib/libcrypto/bn/bn_mul.c b/src/lib/libcrypto/bn/bn_mul.c index a0e9ec3b46..12e5be80eb 100644 --- a/src/lib/libcrypto/bn/bn_mul.c +++ b/src/lib/libcrypto/bn/bn_mul.c | |||
| @@ -551,7 +551,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, | |||
| 551 | int tna, int tnb, BN_ULONG *t) | 551 | int tna, int tnb, BN_ULONG *t) |
| 552 | { | 552 | { |
| 553 | int i,j,n2=n*2; | 553 | int i,j,n2=n*2; |
| 554 | int c1,c2,neg,zero; | 554 | int c1,c2,neg; |
| 555 | BN_ULONG ln,lo,*p; | 555 | BN_ULONG ln,lo,*p; |
| 556 | 556 | ||
| 557 | # ifdef BN_COUNT | 557 | # ifdef BN_COUNT |
| @@ -567,7 +567,7 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, | |||
| 567 | /* r=(a[0]-a[1])*(b[1]-b[0]) */ | 567 | /* r=(a[0]-a[1])*(b[1]-b[0]) */ |
| 568 | c1=bn_cmp_part_words(a,&(a[n]),tna,n-tna); | 568 | c1=bn_cmp_part_words(a,&(a[n]),tna,n-tna); |
| 569 | c2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n); | 569 | c2=bn_cmp_part_words(&(b[n]),b,tnb,tnb-n); |
| 570 | zero=neg=0; | 570 | neg=0; |
| 571 | switch (c1*3+c2) | 571 | switch (c1*3+c2) |
| 572 | { | 572 | { |
| 573 | case -4: | 573 | case -4: |
| @@ -575,7 +575,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, | |||
| 575 | bn_sub_part_words(&(t[n]),b, &(b[n]),tnb,n-tnb); /* - */ | 575 | bn_sub_part_words(&(t[n]),b, &(b[n]),tnb,n-tnb); /* - */ |
| 576 | break; | 576 | break; |
| 577 | case -3: | 577 | case -3: |
| 578 | zero=1; | ||
| 579 | /* break; */ | 578 | /* break; */ |
| 580 | case -2: | 579 | case -2: |
| 581 | bn_sub_part_words(t, &(a[n]),a, tna,tna-n); /* - */ | 580 | bn_sub_part_words(t, &(a[n]),a, tna,tna-n); /* - */ |
| @@ -585,7 +584,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, | |||
| 585 | case -1: | 584 | case -1: |
| 586 | case 0: | 585 | case 0: |
| 587 | case 1: | 586 | case 1: |
| 588 | zero=1; | ||
| 589 | /* break; */ | 587 | /* break; */ |
| 590 | case 2: | 588 | case 2: |
| 591 | bn_sub_part_words(t, a, &(a[n]),tna,n-tna); /* + */ | 589 | bn_sub_part_words(t, a, &(a[n]),tna,n-tna); /* + */ |
| @@ -593,7 +591,6 @@ void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, | |||
| 593 | neg=1; | 591 | neg=1; |
| 594 | break; | 592 | break; |
| 595 | case 3: | 593 | case 3: |
| 596 | zero=1; | ||
| 597 | /* break; */ | 594 | /* break; */ |
| 598 | case 4: | 595 | case 4: |
| 599 | bn_sub_part_words(t, a, &(a[n]),tna,n-tna); | 596 | bn_sub_part_words(t, a, &(a[n]),tna,n-tna); |
| @@ -1012,7 +1009,6 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | |||
| 1012 | { | 1009 | { |
| 1013 | if (i >= -1 && i <= 1) | 1010 | if (i >= -1 && i <= 1) |
| 1014 | { | 1011 | { |
| 1015 | int sav_j =0; | ||
| 1016 | /* Find out the power of two lower or equal | 1012 | /* Find out the power of two lower or equal |
| 1017 | to the longest of the two numbers */ | 1013 | to the longest of the two numbers */ |
| 1018 | if (i >= 0) | 1014 | if (i >= 0) |
| @@ -1023,7 +1019,6 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) | |||
| 1023 | { | 1019 | { |
| 1024 | j = BN_num_bits_word((BN_ULONG)bl); | 1020 | j = BN_num_bits_word((BN_ULONG)bl); |
| 1025 | } | 1021 | } |
| 1026 | sav_j = j; | ||
| 1027 | j = 1<<(j-1); | 1022 | j = 1<<(j-1); |
| 1028 | assert(j <= al || j <= bl); | 1023 | assert(j <= al || j <= bl); |
| 1029 | k = j+j; | 1024 | k = j+j; |
diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c index 2ca5b01391..c6de032696 100644 --- a/src/lib/libcrypto/bn/bn_nist.c +++ b/src/lib/libcrypto/bn/bn_nist.c | |||
| @@ -354,7 +354,7 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 354 | buf[BN_NIST_192_TOP], | 354 | buf[BN_NIST_192_TOP], |
| 355 | c_d[BN_NIST_192_TOP], | 355 | c_d[BN_NIST_192_TOP], |
| 356 | *res; | 356 | *res; |
| 357 | size_t mask; | 357 | PTR_SIZE_INT mask; |
| 358 | static const BIGNUM _bignum_nist_p_192_sqr = { | 358 | static const BIGNUM _bignum_nist_p_192_sqr = { |
| 359 | (BN_ULONG *)_nist_p_192_sqr, | 359 | (BN_ULONG *)_nist_p_192_sqr, |
| 360 | sizeof(_nist_p_192_sqr)/sizeof(_nist_p_192_sqr[0]), | 360 | sizeof(_nist_p_192_sqr)/sizeof(_nist_p_192_sqr[0]), |
| @@ -405,9 +405,10 @@ int BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 405 | * 'tmp=result-modulus; if (!carry || !borrow) result=tmp;' | 405 | * 'tmp=result-modulus; if (!carry || !borrow) result=tmp;' |
| 406 | * this is what happens below, but without explicit if:-) a. | 406 | * this is what happens below, but without explicit if:-) a. |
| 407 | */ | 407 | */ |
| 408 | mask = 0-(size_t)bn_sub_words(c_d,r_d,_nist_p_192[0],BN_NIST_192_TOP); | 408 | mask = 0-(PTR_SIZE_INT)bn_sub_words(c_d,r_d,_nist_p_192[0],BN_NIST_192_TOP); |
| 409 | mask &= 0-(size_t)carry; | 409 | mask &= 0-(PTR_SIZE_INT)carry; |
| 410 | res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask)); | 410 | res = (BN_ULONG *) |
| 411 | (((PTR_SIZE_INT)c_d&~mask) | ((PTR_SIZE_INT)r_d&mask)); | ||
| 411 | nist_cp_bn(r_d, res, BN_NIST_192_TOP); | 412 | nist_cp_bn(r_d, res, BN_NIST_192_TOP); |
| 412 | r->top = BN_NIST_192_TOP; | 413 | r->top = BN_NIST_192_TOP; |
| 413 | bn_correct_top(r); | 414 | bn_correct_top(r); |
| @@ -438,8 +439,8 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 438 | buf[BN_NIST_224_TOP], | 439 | buf[BN_NIST_224_TOP], |
| 439 | c_d[BN_NIST_224_TOP], | 440 | c_d[BN_NIST_224_TOP], |
| 440 | *res; | 441 | *res; |
| 441 | size_t mask; | 442 | PTR_SIZE_INT mask; |
| 442 | union { bn_addsub_f f; size_t p; } u; | 443 | union { bn_addsub_f f; PTR_SIZE_INT p; } u; |
| 443 | static const BIGNUM _bignum_nist_p_224_sqr = { | 444 | static const BIGNUM _bignum_nist_p_224_sqr = { |
| 444 | (BN_ULONG *)_nist_p_224_sqr, | 445 | (BN_ULONG *)_nist_p_224_sqr, |
| 445 | sizeof(_nist_p_224_sqr)/sizeof(_nist_p_224_sqr[0]), | 446 | sizeof(_nist_p_224_sqr)/sizeof(_nist_p_224_sqr[0]), |
| @@ -510,16 +511,18 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 510 | * to be compared to the modulus and conditionally | 511 | * to be compared to the modulus and conditionally |
| 511 | * adjusted by *subtracting* the latter. */ | 512 | * adjusted by *subtracting* the latter. */ |
| 512 | carry = (int)bn_add_words(r_d,r_d,_nist_p_224[-carry-1],BN_NIST_224_TOP); | 513 | carry = (int)bn_add_words(r_d,r_d,_nist_p_224[-carry-1],BN_NIST_224_TOP); |
| 513 | mask = 0-(size_t)carry; | 514 | mask = 0-(PTR_SIZE_INT)carry; |
| 514 | u.p = ((size_t)bn_sub_words&mask) | ((size_t)bn_add_words&~mask); | 515 | u.p = ((PTR_SIZE_INT)bn_sub_words&mask) | |
| 516 | ((PTR_SIZE_INT)bn_add_words&~mask); | ||
| 515 | } | 517 | } |
| 516 | else | 518 | else |
| 517 | carry = 1; | 519 | carry = 1; |
| 518 | 520 | ||
| 519 | /* otherwise it's effectively same as in BN_nist_mod_192... */ | 521 | /* otherwise it's effectively same as in BN_nist_mod_192... */ |
| 520 | mask = 0-(size_t)(*u.f)(c_d,r_d,_nist_p_224[0],BN_NIST_224_TOP); | 522 | mask = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_224[0],BN_NIST_224_TOP); |
| 521 | mask &= 0-(size_t)carry; | 523 | mask &= 0-(PTR_SIZE_INT)carry; |
| 522 | res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask)); | 524 | res = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) | |
| 525 | ((PTR_SIZE_INT)r_d&mask)); | ||
| 523 | nist_cp_bn(r_d, res, BN_NIST_224_TOP); | 526 | nist_cp_bn(r_d, res, BN_NIST_224_TOP); |
| 524 | r->top = BN_NIST_224_TOP; | 527 | r->top = BN_NIST_224_TOP; |
| 525 | bn_correct_top(r); | 528 | bn_correct_top(r); |
| @@ -549,8 +552,8 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 549 | buf[BN_NIST_256_TOP], | 552 | buf[BN_NIST_256_TOP], |
| 550 | c_d[BN_NIST_256_TOP], | 553 | c_d[BN_NIST_256_TOP], |
| 551 | *res; | 554 | *res; |
| 552 | size_t mask; | 555 | PTR_SIZE_INT mask; |
| 553 | union { bn_addsub_f f; size_t p; } u; | 556 | union { bn_addsub_f f; PTR_SIZE_INT p; } u; |
| 554 | static const BIGNUM _bignum_nist_p_256_sqr = { | 557 | static const BIGNUM _bignum_nist_p_256_sqr = { |
| 555 | (BN_ULONG *)_nist_p_256_sqr, | 558 | (BN_ULONG *)_nist_p_256_sqr, |
| 556 | sizeof(_nist_p_256_sqr)/sizeof(_nist_p_256_sqr[0]), | 559 | sizeof(_nist_p_256_sqr)/sizeof(_nist_p_256_sqr[0]), |
| @@ -629,15 +632,17 @@ int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 629 | else if (carry < 0) | 632 | else if (carry < 0) |
| 630 | { | 633 | { |
| 631 | carry = (int)bn_add_words(r_d,r_d,_nist_p_256[-carry-1],BN_NIST_256_TOP); | 634 | carry = (int)bn_add_words(r_d,r_d,_nist_p_256[-carry-1],BN_NIST_256_TOP); |
| 632 | mask = 0-(size_t)carry; | 635 | mask = 0-(PTR_SIZE_INT)carry; |
| 633 | u.p = ((size_t)bn_sub_words&mask) | ((size_t)bn_add_words&~mask); | 636 | u.p = ((PTR_SIZE_INT)bn_sub_words&mask) | |
| 637 | ((PTR_SIZE_INT)bn_add_words&~mask); | ||
| 634 | } | 638 | } |
| 635 | else | 639 | else |
| 636 | carry = 1; | 640 | carry = 1; |
| 637 | 641 | ||
| 638 | mask = 0-(size_t)(*u.f)(c_d,r_d,_nist_p_256[0],BN_NIST_256_TOP); | 642 | mask = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_256[0],BN_NIST_256_TOP); |
| 639 | mask &= 0-(size_t)carry; | 643 | mask &= 0-(PTR_SIZE_INT)carry; |
| 640 | res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask)); | 644 | res = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) | |
| 645 | ((PTR_SIZE_INT)r_d&mask)); | ||
| 641 | nist_cp_bn(r_d, res, BN_NIST_256_TOP); | 646 | nist_cp_bn(r_d, res, BN_NIST_256_TOP); |
| 642 | r->top = BN_NIST_256_TOP; | 647 | r->top = BN_NIST_256_TOP; |
| 643 | bn_correct_top(r); | 648 | bn_correct_top(r); |
| @@ -671,8 +676,8 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 671 | buf[BN_NIST_384_TOP], | 676 | buf[BN_NIST_384_TOP], |
| 672 | c_d[BN_NIST_384_TOP], | 677 | c_d[BN_NIST_384_TOP], |
| 673 | *res; | 678 | *res; |
| 674 | size_t mask; | 679 | PTR_SIZE_INT mask; |
| 675 | union { bn_addsub_f f; size_t p; } u; | 680 | union { bn_addsub_f f; PTR_SIZE_INT p; } u; |
| 676 | static const BIGNUM _bignum_nist_p_384_sqr = { | 681 | static const BIGNUM _bignum_nist_p_384_sqr = { |
| 677 | (BN_ULONG *)_nist_p_384_sqr, | 682 | (BN_ULONG *)_nist_p_384_sqr, |
| 678 | sizeof(_nist_p_384_sqr)/sizeof(_nist_p_384_sqr[0]), | 683 | sizeof(_nist_p_384_sqr)/sizeof(_nist_p_384_sqr[0]), |
| @@ -754,15 +759,17 @@ int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 754 | else if (carry < 0) | 759 | else if (carry < 0) |
| 755 | { | 760 | { |
| 756 | carry = (int)bn_add_words(r_d,r_d,_nist_p_384[-carry-1],BN_NIST_384_TOP); | 761 | carry = (int)bn_add_words(r_d,r_d,_nist_p_384[-carry-1],BN_NIST_384_TOP); |
| 757 | mask = 0-(size_t)carry; | 762 | mask = 0-(PTR_SIZE_INT)carry; |
| 758 | u.p = ((size_t)bn_sub_words&mask) | ((size_t)bn_add_words&~mask); | 763 | u.p = ((PTR_SIZE_INT)bn_sub_words&mask) | |
| 764 | ((PTR_SIZE_INT)bn_add_words&~mask); | ||
| 759 | } | 765 | } |
| 760 | else | 766 | else |
| 761 | carry = 1; | 767 | carry = 1; |
| 762 | 768 | ||
| 763 | mask = 0-(size_t)(*u.f)(c_d,r_d,_nist_p_384[0],BN_NIST_384_TOP); | 769 | mask = 0-(PTR_SIZE_INT)(*u.f)(c_d,r_d,_nist_p_384[0],BN_NIST_384_TOP); |
| 764 | mask &= 0-(size_t)carry; | 770 | mask &= 0-(PTR_SIZE_INT)carry; |
| 765 | res = (BN_ULONG *)(((size_t)c_d&~mask) | ((size_t)r_d&mask)); | 771 | res = (BN_ULONG *)(((PTR_SIZE_INT)c_d&~mask) | |
| 772 | ((PTR_SIZE_INT)r_d&mask)); | ||
| 766 | nist_cp_bn(r_d, res, BN_NIST_384_TOP); | 773 | nist_cp_bn(r_d, res, BN_NIST_384_TOP); |
| 767 | r->top = BN_NIST_384_TOP; | 774 | r->top = BN_NIST_384_TOP; |
| 768 | bn_correct_top(r); | 775 | bn_correct_top(r); |
| @@ -781,7 +788,7 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 781 | BN_ULONG *r_d, *a_d = a->d, | 788 | BN_ULONG *r_d, *a_d = a->d, |
| 782 | t_d[BN_NIST_521_TOP], | 789 | t_d[BN_NIST_521_TOP], |
| 783 | val,tmp,*res; | 790 | val,tmp,*res; |
| 784 | size_t mask; | 791 | PTR_SIZE_INT mask; |
| 785 | static const BIGNUM _bignum_nist_p_521_sqr = { | 792 | static const BIGNUM _bignum_nist_p_521_sqr = { |
| 786 | (BN_ULONG *)_nist_p_521_sqr, | 793 | (BN_ULONG *)_nist_p_521_sqr, |
| 787 | sizeof(_nist_p_521_sqr)/sizeof(_nist_p_521_sqr[0]), | 794 | sizeof(_nist_p_521_sqr)/sizeof(_nist_p_521_sqr[0]), |
| @@ -826,8 +833,9 @@ int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *field, | |||
| 826 | r_d[i] &= BN_NIST_521_TOP_MASK; | 833 | r_d[i] &= BN_NIST_521_TOP_MASK; |
| 827 | 834 | ||
| 828 | bn_add_words(r_d,r_d,t_d,BN_NIST_521_TOP); | 835 | bn_add_words(r_d,r_d,t_d,BN_NIST_521_TOP); |
| 829 | mask = 0-(size_t)bn_sub_words(t_d,r_d,_nist_p_521,BN_NIST_521_TOP); | 836 | mask = 0-(PTR_SIZE_INT)bn_sub_words(t_d,r_d,_nist_p_521,BN_NIST_521_TOP); |
| 830 | res = (BN_ULONG *)(((size_t)t_d&~mask) | ((size_t)r_d&mask)); | 837 | res = (BN_ULONG *)(((PTR_SIZE_INT)t_d&~mask) | |
| 838 | ((PTR_SIZE_INT)r_d&mask)); | ||
| 831 | nist_cp_bn(r_d,res,BN_NIST_521_TOP); | 839 | nist_cp_bn(r_d,res,BN_NIST_521_TOP); |
| 832 | r->top = BN_NIST_521_TOP; | 840 | r->top = BN_NIST_521_TOP; |
| 833 | bn_correct_top(r); | 841 | bn_correct_top(r); |
diff --git a/src/lib/libcrypto/comp/c_rle.c b/src/lib/libcrypto/comp/c_rle.c index efd366fa22..18bceae51e 100644 --- a/src/lib/libcrypto/comp/c_rle.c +++ b/src/lib/libcrypto/comp/c_rle.c | |||
| @@ -46,7 +46,7 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, | |||
| 46 | { | 46 | { |
| 47 | int i; | 47 | int i; |
| 48 | 48 | ||
| 49 | if (olen < (ilen-1)) | 49 | if (ilen == 0 || olen < (ilen-1)) |
| 50 | { | 50 | { |
| 51 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ | 51 | /* ZZZZZZZZZZZZZZZZZZZZZZ */ |
| 52 | return(-1); | 52 | return(-1); |
| @@ -59,4 +59,3 @@ static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, | |||
| 59 | } | 59 | } |
| 60 | return(ilen-1); | 60 | return(ilen-1); |
| 61 | } | 61 | } |
| 62 | |||
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c index 22617e5fa1..f5fcbb9f6b 100644 --- a/src/lib/libcrypto/conf/conf_api.c +++ b/src/lib/libcrypto/conf/conf_api.c | |||
| @@ -64,6 +64,7 @@ | |||
| 64 | #endif | 64 | #endif |
| 65 | 65 | ||
| 66 | #include <assert.h> | 66 | #include <assert.h> |
| 67 | #include <stdlib.h> | ||
| 67 | #include <string.h> | 68 | #include <string.h> |
| 68 | #include <openssl/conf.h> | 69 | #include <openssl/conf.h> |
| 69 | #include <openssl/conf_api.h> | 70 | #include <openssl/conf_api.h> |
| @@ -285,7 +286,7 @@ CONF_VALUE *_CONF_new_section(CONF *conf, const char *section) | |||
| 285 | v->value=(char *)sk; | 286 | v->value=(char *)sk; |
| 286 | 287 | ||
| 287 | vv=lh_CONF_VALUE_insert(conf->data,v); | 288 | vv=lh_CONF_VALUE_insert(conf->data,v); |
| 288 | assert(vv == NULL); | 289 | OPENSSL_assert(vv == NULL); |
| 289 | ok=1; | 290 | ok=1; |
| 290 | err: | 291 | err: |
| 291 | if (!ok) | 292 | if (!ok) |
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c index 0b571b0394..cf951320af 100644 --- a/src/lib/libcrypto/conf/conf_def.c +++ b/src/lib/libcrypto/conf/conf_def.c | |||
| @@ -213,13 +213,12 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) | |||
| 213 | int bufnum=0,i,ii; | 213 | int bufnum=0,i,ii; |
| 214 | BUF_MEM *buff=NULL; | 214 | BUF_MEM *buff=NULL; |
| 215 | char *s,*p,*end; | 215 | char *s,*p,*end; |
| 216 | int again,n; | 216 | int again; |
| 217 | long eline=0; | 217 | long eline=0; |
| 218 | char btmp[DECIMAL_SIZE(eline)+1]; | 218 | char btmp[DECIMAL_SIZE(eline)+1]; |
| 219 | CONF_VALUE *v=NULL,*tv; | 219 | CONF_VALUE *v=NULL,*tv; |
| 220 | CONF_VALUE *sv=NULL; | 220 | CONF_VALUE *sv=NULL; |
| 221 | char *section=NULL,*buf; | 221 | char *section=NULL,*buf; |
| 222 | STACK_OF(CONF_VALUE) *section_sk=NULL,*ts; | ||
| 223 | char *start,*psection,*pname; | 222 | char *start,*psection,*pname; |
| 224 | void *h = (void *)(conf->data); | 223 | void *h = (void *)(conf->data); |
| 225 | 224 | ||
| @@ -250,7 +249,6 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) | |||
| 250 | CONF_R_UNABLE_TO_CREATE_NEW_SECTION); | 249 | CONF_R_UNABLE_TO_CREATE_NEW_SECTION); |
| 251 | goto err; | 250 | goto err; |
| 252 | } | 251 | } |
| 253 | section_sk=(STACK_OF(CONF_VALUE) *)sv->value; | ||
| 254 | 252 | ||
| 255 | bufnum=0; | 253 | bufnum=0; |
| 256 | again=0; | 254 | again=0; |
| @@ -309,7 +307,6 @@ static int def_load_bio(CONF *conf, BIO *in, long *line) | |||
| 309 | buf=buff->data; | 307 | buf=buff->data; |
| 310 | 308 | ||
| 311 | clear_comments(conf, buf); | 309 | clear_comments(conf, buf); |
| 312 | n=strlen(buf); | ||
| 313 | s=eat_ws(conf, buf); | 310 | s=eat_ws(conf, buf); |
| 314 | if (IS_EOF(conf,*s)) continue; /* blank line */ | 311 | if (IS_EOF(conf,*s)) continue; /* blank line */ |
| 315 | if (*s == '[') | 312 | if (*s == '[') |
| @@ -343,7 +340,6 @@ again: | |||
| 343 | CONF_R_UNABLE_TO_CREATE_NEW_SECTION); | 340 | CONF_R_UNABLE_TO_CREATE_NEW_SECTION); |
| 344 | goto err; | 341 | goto err; |
| 345 | } | 342 | } |
| 346 | section_sk=(STACK_OF(CONF_VALUE) *)sv->value; | ||
| 347 | continue; | 343 | continue; |
| 348 | } | 344 | } |
| 349 | else | 345 | else |
| @@ -406,13 +402,9 @@ again: | |||
| 406 | CONF_R_UNABLE_TO_CREATE_NEW_SECTION); | 402 | CONF_R_UNABLE_TO_CREATE_NEW_SECTION); |
| 407 | goto err; | 403 | goto err; |
| 408 | } | 404 | } |
| 409 | ts=(STACK_OF(CONF_VALUE) *)tv->value; | ||
| 410 | } | 405 | } |
| 411 | else | 406 | else |
| 412 | { | ||
| 413 | tv=sv; | 407 | tv=sv; |
| 414 | ts=section_sk; | ||
| 415 | } | ||
| 416 | #if 1 | 408 | #if 1 |
| 417 | if (_CONF_add_string(conf, tv, v) == 0) | 409 | if (_CONF_add_string(conf, tv, v) == 0) |
| 418 | { | 410 | { |
| @@ -465,9 +457,6 @@ err: | |||
| 465 | 457 | ||
| 466 | static void clear_comments(CONF *conf, char *p) | 458 | static void clear_comments(CONF *conf, char *p) |
| 467 | { | 459 | { |
| 468 | char *to; | ||
| 469 | |||
| 470 | to=p; | ||
| 471 | for (;;) | 460 | for (;;) |
| 472 | { | 461 | { |
| 473 | if (IS_FCOMMENT(conf,*p)) | 462 | if (IS_FCOMMENT(conf,*p)) |
diff --git a/src/lib/libcrypto/cryptlib.c b/src/lib/libcrypto/cryptlib.c index b4449b86d6..24fe123e14 100644 --- a/src/lib/libcrypto/cryptlib.c +++ b/src/lib/libcrypto/cryptlib.c | |||
| @@ -731,7 +731,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, | |||
| 731 | case DLL_THREAD_ATTACH: | 731 | case DLL_THREAD_ATTACH: |
| 732 | break; | 732 | break; |
| 733 | case DLL_THREAD_DETACH: | 733 | case DLL_THREAD_DETACH: |
| 734 | ERR_remove_state(0); | ||
| 735 | break; | 734 | break; |
| 736 | case DLL_PROCESS_DETACH: | 735 | case DLL_PROCESS_DETACH: |
| 737 | break; | 736 | break; |
| @@ -743,6 +742,16 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, | |||
| 743 | #if defined(_WIN32) && !defined(__CYGWIN__) | 742 | #if defined(_WIN32) && !defined(__CYGWIN__) |
| 744 | #include <tchar.h> | 743 | #include <tchar.h> |
| 745 | #include <signal.h> | 744 | #include <signal.h> |
| 745 | #ifdef __WATCOMC__ | ||
| 746 | #if defined(_UNICODE) || defined(__UNICODE__) | ||
| 747 | #define _vsntprintf _vsnwprintf | ||
| 748 | #else | ||
| 749 | #define _vsntprintf _vsnprintf | ||
| 750 | #endif | ||
| 751 | #endif | ||
| 752 | #ifdef _MSC_VER | ||
| 753 | #define alloca _alloca | ||
| 754 | #endif | ||
| 746 | 755 | ||
| 747 | #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 | 756 | #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333 |
| 748 | int OPENSSL_isservice(void) | 757 | int OPENSSL_isservice(void) |
| @@ -773,11 +782,7 @@ int OPENSSL_isservice(void) | |||
| 773 | 782 | ||
| 774 | if (len>512) return -1; /* paranoia */ | 783 | if (len>512) return -1; /* paranoia */ |
| 775 | len++,len&=~1; /* paranoia */ | 784 | len++,len&=~1; /* paranoia */ |
| 776 | #ifdef _MSC_VER | ||
| 777 | name=(WCHAR *)_alloca(len+sizeof(WCHAR)); | ||
| 778 | #else | ||
| 779 | name=(WCHAR *)alloca(len+sizeof(WCHAR)); | 785 | name=(WCHAR *)alloca(len+sizeof(WCHAR)); |
| 780 | #endif | ||
| 781 | if (!GetUserObjectInformationW (h,UOI_NAME,name,len,&len)) | 786 | if (!GetUserObjectInformationW (h,UOI_NAME,name,len,&len)) |
| 782 | return -1; | 787 | return -1; |
| 783 | 788 | ||
| @@ -822,11 +827,7 @@ void OPENSSL_showfatal (const char *fmta,...) | |||
| 822 | size_t len_0=strlen(fmta)+1,i; | 827 | size_t len_0=strlen(fmta)+1,i; |
| 823 | WCHAR *fmtw; | 828 | WCHAR *fmtw; |
| 824 | 829 | ||
| 825 | #ifdef _MSC_VER | 830 | fmtw = (WCHAR *)alloca(len_0*sizeof(WCHAR)); |
| 826 | fmtw = (WCHAR *)_alloca (len_0*sizeof(WCHAR)); | ||
| 827 | #else | ||
| 828 | fmtw = (WCHAR *)alloca (len_0*sizeof(WCHAR)); | ||
| 829 | #endif | ||
| 830 | if (fmtw == NULL) { fmt=(const TCHAR *)L"no stack?"; break; } | 831 | if (fmtw == NULL) { fmt=(const TCHAR *)L"no stack?"; break; } |
| 831 | 832 | ||
| 832 | #ifndef OPENSSL_NO_MULTIBYTE | 833 | #ifndef OPENSSL_NO_MULTIBYTE |
diff --git a/src/lib/libcrypto/crypto-lib.com b/src/lib/libcrypto/crypto-lib.com index a4b6635091..a29c0afd93 100644 --- a/src/lib/libcrypto/crypto-lib.com +++ b/src/lib/libcrypto/crypto-lib.com | |||
| @@ -47,11 +47,33 @@ $! P6, if defined, sets a choice of crypto methods to compile. | |||
| 47 | $! WARNING: this should only be done to recompile some part of an already | 47 | $! WARNING: this should only be done to recompile some part of an already |
| 48 | $! fully compiled library. | 48 | $! fully compiled library. |
| 49 | $! | 49 | $! |
| 50 | $! P7, if defined, specifies the C pointer size. Ignored on VAX. | ||
| 51 | $! ("64=ARGV" gives more efficient code with HP C V7.3 or newer.) | ||
| 52 | $! Supported values are: | ||
| 53 | $! | ||
| 54 | $! "" Compile with default (/NOPOINTER_SIZE) | ||
| 55 | $! 32 Compile with /POINTER_SIZE=32 (SHORT) | ||
| 56 | $! 64 Compile with /POINTER_SIZE=64[=ARGV] (LONG[=ARGV]). | ||
| 57 | $! (Automatically select ARGV if compiler supports it.) | ||
| 58 | $! 64= Compile with /POINTER_SIZE=64 (LONG). | ||
| 59 | $! 64=ARGV Compile with /POINTER_SIZE=64=ARGV (LONG=ARGV). | ||
| 60 | $! | ||
| 61 | $! P8, if defined, specifies a directory where ZLIB files (zlib.h, | ||
| 62 | $! libz.olb) may be found. Optionally, a non-default object library | ||
| 63 | $! name may be included ("dev:[dir]libz_64.olb", for example). | ||
| 64 | $! | ||
| 65 | $! | ||
| 66 | $! Announce/identify. | ||
| 67 | $! | ||
| 68 | $ proc = f$environment( "procedure") | ||
| 69 | $ write sys$output "@@@ "+ - | ||
| 70 | f$parse( proc, , , "name")+ f$parse( proc, , , "type") | ||
| 50 | $! | 71 | $! |
| 51 | $! Define A TCP/IP Library That We Will Need To Link To. | 72 | $! Define A TCP/IP Library That We Will Need To Link To. |
| 52 | $! (That Is, If We Need To Link To One.) | 73 | $! (That Is, If We Need To Link To One.) |
| 53 | $! | 74 | $! |
| 54 | $ TCPIP_LIB = "" | 75 | $ TCPIP_LIB = "" |
| 76 | $ ZLIB_LIB = "" | ||
| 55 | $! | 77 | $! |
| 56 | $! Check Which Architecture We Are Using. | 78 | $! Check Which Architecture We Are Using. |
| 57 | $! | 79 | $! |
| @@ -75,6 +97,11 @@ $! End The Architecture Check. | |||
| 75 | $! | 97 | $! |
| 76 | $ ENDIF | 98 | $ ENDIF |
| 77 | $! | 99 | $! |
| 100 | $ ARCHD = ARCH | ||
| 101 | $ LIB32 = "32" | ||
| 102 | $ OPT_FILE = "" | ||
| 103 | $ POINTER_SIZE = "" | ||
| 104 | $! | ||
| 78 | $! Define The Different Encryption Types. | 105 | $! Define The Different Encryption Types. |
| 79 | $! NOTE: Some might think this list ugly. However, it's made this way to | 106 | $! NOTE: Some might think this list ugly. However, it's made this way to |
| 80 | $! reflect the SDIRS variable in [-]Makefile.org as closely as possible, | 107 | $! reflect the SDIRS variable in [-]Makefile.org as closely as possible, |
| @@ -91,17 +118,29 @@ $ ENCRYPT_TYPES = "Basic,"+ - | |||
| 91 | "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ - | 118 | "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ - |
| 92 | "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ - | 119 | "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ - |
| 93 | "STORE,CMS,PQUEUE,TS,JPAKE" | 120 | "STORE,CMS,PQUEUE,TS,JPAKE" |
| 94 | $! Define The OBJ Directory. | ||
| 95 | $! | 121 | $! |
| 96 | $ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO] | 122 | $! Check To Make Sure We Have Valid Command Line Parameters. |
| 123 | $! | ||
| 124 | $ GOSUB CHECK_OPTIONS | ||
| 97 | $! | 125 | $! |
| 98 | $! Define The EXE Directory. | 126 | $! Define The OBJ and EXE Directories. |
| 99 | $! | 127 | $! |
| 100 | $ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO] | 128 | $ OBJ_DIR := SYS$DISK:[-.'ARCHD'.OBJ.CRYPTO] |
| 129 | $ EXE_DIR := SYS$DISK:[-.'ARCHD'.EXE.CRYPTO] | ||
| 101 | $! | 130 | $! |
| 102 | $! Check To Make Sure We Have Valid Command Line Parameters. | 131 | $! Specify the destination directory in any /MAP option. |
| 103 | $! | 132 | $! |
| 104 | $ GOSUB CHECK_OPTIONS | 133 | $ if (LINKMAP .eqs. "MAP") |
| 134 | $ then | ||
| 135 | $ LINKMAP = LINKMAP+ "=''EXE_DIR'" | ||
| 136 | $ endif | ||
| 137 | $! | ||
| 138 | $! Add the location prefix to the linker options file name. | ||
| 139 | $! | ||
| 140 | $ if (OPT_FILE .nes. "") | ||
| 141 | $ then | ||
| 142 | $ OPT_FILE = EXE_DIR+ OPT_FILE | ||
| 143 | $ endif | ||
| 105 | $! | 144 | $! |
| 106 | $! Initialise logical names and such | 145 | $! Initialise logical names and such |
| 107 | $! | 146 | $! |
| @@ -109,7 +148,7 @@ $ GOSUB INITIALISE | |||
| 109 | $! | 148 | $! |
| 110 | $! Tell The User What Kind of Machine We Run On. | 149 | $! Tell The User What Kind of Machine We Run On. |
| 111 | $! | 150 | $! |
| 112 | $ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine." | 151 | $ WRITE SYS$OUTPUT "Host system architecture: ''ARCHD'" |
| 113 | $! | 152 | $! |
| 114 | $! | 153 | $! |
| 115 | $! Check To See If The Architecture Specific OBJ Directory Exists. | 154 | $! Check To See If The Architecture Specific OBJ Directory Exists. |
| @@ -140,11 +179,11 @@ $ ENDIF | |||
| 140 | $! | 179 | $! |
| 141 | $! Define The Library Name. | 180 | $! Define The Library Name. |
| 142 | $! | 181 | $! |
| 143 | $ LIB_NAME := 'EXE_DIR'LIBCRYPTO.OLB | 182 | $ LIB_NAME := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB |
| 144 | $! | 183 | $! |
| 145 | $! Define The CRYPTO-LIB We Are To Use. | 184 | $! Define The CRYPTO-LIB We Are To Use. |
| 146 | $! | 185 | $! |
| 147 | $ CRYPTO_LIB := 'EXE_DIR'LIBCRYPTO.OLB | 186 | $ CRYPTO_LIB := 'EXE_DIR'SSL_LIBCRYPTO'LIB32'.OLB |
| 148 | $! | 187 | $! |
| 149 | $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library... | 188 | $! Check To See If We Already Have A "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" Library... |
| 150 | $! | 189 | $! |
| @@ -193,7 +232,7 @@ $ LIB_CAST = "c_skey,c_ecb,c_enc,c_cfb64,c_ofb64" | |||
| 193 | $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ - | 232 | $ LIB_CAMELLIA = "camellia,cmll_misc,cmll_ecb,cmll_cbc,cmll_ofb,"+ - |
| 194 | "cmll_cfb,cmll_ctr" | 233 | "cmll_cfb,cmll_ctr" |
| 195 | $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb" | 234 | $ LIB_SEED = "seed,seed_ecb,seed_cbc,seed_cfb,seed_ofb" |
| 196 | $ LIB_MODES = "cbc128,ctr128,cfb128,ofb128" | 235 | $ LIB_MODES = "cbc128,ctr128,cts128,cfb128,ofb128" |
| 197 | $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper" | 236 | $ LIB_BN_ASM = "[.asm]vms.mar,vms-helper" |
| 198 | $ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN - | 237 | $ IF F$TRNLNM("OPENSSL_NO_ASM") .OR. ARCH .NES. "VAX" THEN - |
| 199 | LIB_BN_ASM = "bn_asm" | 238 | LIB_BN_ASM = "bn_asm" |
| @@ -301,15 +340,23 @@ $ LIB_JPAKE = "jpake,jpake_err" | |||
| 301 | $! | 340 | $! |
| 302 | $! Setup exceptional compilations | 341 | $! Setup exceptional compilations |
| 303 | $! | 342 | $! |
| 304 | $ ! Add definitions for no threads on OpenVMS 7.1 and higher | 343 | $ CC3_SHOWN = 0 |
| 344 | $ CC4_SHOWN = 0 | ||
| 345 | $ CC5_SHOWN = 0 | ||
| 346 | $ CC6_SHOWN = 0 | ||
| 347 | $! | ||
| 348 | $! The following lists must have leading and trailing commas, and no | ||
| 349 | $! embedded spaces. (They are scanned for ",name,".) | ||
| 350 | $! | ||
| 351 | $ ! Add definitions for no threads on OpenVMS 7.1 and higher. | ||
| 305 | $ COMPILEWITH_CC3 = ",bss_rtcp," | 352 | $ COMPILEWITH_CC3 = ",bss_rtcp," |
| 306 | $ ! Disable the DOLLARID warning | 353 | $ ! Disable the DOLLARID warning. Not needed with /STANDARD=RELAXED. |
| 307 | $ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,o_dir" | 354 | $ COMPILEWITH_CC4 = "" !!! ",a_utctm,bss_log,o_time,o_dir," |
| 308 | $ ! Disable disjoint optimization | 355 | $ ! Disable disjoint optimization on VAX with DECC. |
| 309 | $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + - | 356 | $ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + - |
| 310 | "seed,sha_dgst,sha1dgst,rmd_dgst,bf_enc," | 357 | "seed,sha_dgst,sha1dgst,rmd_dgst,bf_enc," |
| 311 | $ ! Disable the MIXLINKAGE warning | 358 | $ ! Disable the MIXLINKAGE warning. |
| 312 | $ COMPILEWITH_CC6 = ",enc_read,set_key," | 359 | $ COMPILEWITH_CC6 = "" !!! ",enc_read,set_key," |
| 313 | $! | 360 | $! |
| 314 | $! Figure Out What Other Modules We Are To Build. | 361 | $! Figure Out What Other Modules We Are To Build. |
| 315 | $! | 362 | $! |
| @@ -515,31 +562,60 @@ $ WRITE SYS$OUTPUT "Compiling The ",FILE_NAME," File. (",BUILDALL,",",STATE," | |||
| 515 | $ ENDIF | 562 | $ ENDIF |
| 516 | $ IF (MODULE_NAME.NES."") | 563 | $ IF (MODULE_NAME.NES."") |
| 517 | $ THEN | 564 | $ THEN |
| 518 | $ WRITE SYS$OUTPUT " ",FILE_NAME,"" | 565 | $ WRITE SYS$OUTPUT " ",FILE_NAME,"" |
| 519 | $ ENDIF | 566 | $ ENDIF |
| 520 | $! | 567 | $! |
| 521 | $! Compile The File. | 568 | $! Compile The File. |
| 522 | $! | 569 | $! |
| 523 | $ ON ERROR THEN GOTO NEXT_FILE | 570 | $ ON ERROR THEN GOTO NEXT_FILE |
| 524 | $ FILE_NAME0 = F$ELEMENT(0,".",FILE_NAME) | 571 | $ FILE_NAME0 = ","+ F$ELEMENT(0,".",FILE_NAME)+ "," |
| 525 | $ IF FILE_NAME - ".mar" .NES. FILE_NAME | 572 | $ IF FILE_NAME - ".mar" .NES. FILE_NAME |
| 526 | $ THEN | 573 | $ THEN |
| 527 | $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | 574 | $ MACRO/OBJECT='OBJECT_FILE' 'SOURCE_FILE' |
| 528 | $ ELSE | 575 | $ ELSE |
| 529 | $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3 | 576 | $ IF COMPILEWITH_CC3 - FILE_NAME0 .NES. COMPILEWITH_CC3 |
| 530 | $ THEN | 577 | $ THEN |
| 578 | $ write sys$output " \Using special rule (3)" | ||
| 579 | $ if (.not. CC3_SHOWN) | ||
| 580 | $ then | ||
| 581 | $ CC3_SHOWN = 1 | ||
| 582 | $ x = " "+ CC3 | ||
| 583 | $ write /symbol sys$output x | ||
| 584 | $ endif | ||
| 531 | $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | 585 | $ CC3/OBJECT='OBJECT_FILE' 'SOURCE_FILE' |
| 532 | $ ELSE | 586 | $ ELSE |
| 533 | $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4 | 587 | $ IF COMPILEWITH_CC4 - FILE_NAME0 .NES. COMPILEWITH_CC4 |
| 534 | $ THEN | 588 | $ THEN |
| 589 | $ write /symbol sys$output " \Using special rule (4)" | ||
| 590 | $ if (.not. CC4_SHOWN) | ||
| 591 | $ then | ||
| 592 | $ CC4_SHOWN = 1 | ||
| 593 | $ x = " "+ CC4 | ||
| 594 | $ write /symbol sys$output x | ||
| 595 | $ endif | ||
| 535 | $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | 596 | $ CC4/OBJECT='OBJECT_FILE' 'SOURCE_FILE' |
| 536 | $ ELSE | 597 | $ ELSE |
| 537 | $ IF COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5 | 598 | $ IF CC5_DIFFERENT .AND. - |
| 599 | (COMPILEWITH_CC5 - FILE_NAME0 .NES. COMPILEWITH_CC5) | ||
| 538 | $ THEN | 600 | $ THEN |
| 601 | $ write sys$output " \Using special rule (5)" | ||
| 602 | $ if (.not. CC5_SHOWN) | ||
| 603 | $ then | ||
| 604 | $ CC5_SHOWN = 1 | ||
| 605 | $ x = " "+ CC5 | ||
| 606 | $ write /symbol sys$output x | ||
| 607 | $ endif | ||
| 539 | $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | 608 | $ CC5/OBJECT='OBJECT_FILE' 'SOURCE_FILE' |
| 540 | $ ELSE | 609 | $ ELSE |
| 541 | $ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6 | 610 | $ IF COMPILEWITH_CC6 - FILE_NAME0 .NES. COMPILEWITH_CC6 |
| 542 | $ THEN | 611 | $ THEN |
| 612 | $ write sys$output " \Using special rule (6)" | ||
| 613 | $ if (.not. CC6_SHOWN) | ||
| 614 | $ then | ||
| 615 | $ CC6_SHOWN = 1 | ||
| 616 | $ x = " "+ CC6 | ||
| 617 | $ write /symbol sys$output x | ||
| 618 | $ endif | ||
| 543 | $ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | 619 | $ CC6/OBJECT='OBJECT_FILE' 'SOURCE_FILE' |
| 544 | $ ELSE | 620 | $ ELSE |
| 545 | $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' | 621 | $ CC/OBJECT='OBJECT_FILE' 'SOURCE_FILE' |
| @@ -586,38 +662,22 @@ $! SHOW SYMBOL APPLICATION* | |||
| 586 | $! | 662 | $! |
| 587 | $! Tell the user what happens | 663 | $! Tell the user what happens |
| 588 | $! | 664 | $! |
| 589 | $ WRITE SYS$OUTPUT " ",APPLICATION,".exe" | 665 | $ WRITE SYS$OUTPUT " ",APPLICATION,".exe" |
| 590 | $! | 666 | $! |
| 591 | $! Link The Program. | 667 | $! Link The Program. |
| 592 | $! | 668 | $! |
| 593 | $ ON ERROR THEN GOTO NEXT_APPLICATION | 669 | $ ON ERROR THEN GOTO NEXT_APPLICATION |
| 594 | $! | 670 | $! |
| 595 | $! Check To See If We Are To Link With A Specific TCP/IP Library. | 671 | $! Link With A TCP/IP Library. |
| 596 | $! | 672 | $! |
| 597 | $ IF (TCPIP_LIB.NES."") | 673 | $ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' - |
| 598 | $ THEN | 674 | /EXE='EXE_DIR''APPLICATION'.EXE - |
| 675 | 'OBJ_DIR''APPLICATION_OBJECTS', - | ||
| 676 | 'CRYPTO_LIB'/LIBRARY - | ||
| 677 | 'TCPIP_LIB' - | ||
| 678 | 'ZLIB_LIB' - | ||
| 679 | ,'OPT_FILE' /OPTIONS | ||
| 599 | $! | 680 | $! |
| 600 | $! Link With A TCP/IP Library. | ||
| 601 | $! | ||
| 602 | $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE - | ||
| 603 | 'OBJ_DIR''APPLICATION_OBJECTS', - | ||
| 604 | 'CRYPTO_LIB'/LIBRARY, - | ||
| 605 | 'TCPIP_LIB','OPT_FILE'/OPTION | ||
| 606 | $! | ||
| 607 | $! Else... | ||
| 608 | $! | ||
| 609 | $ ELSE | ||
| 610 | $! | ||
| 611 | $! Don't Link With A TCP/IP Library. | ||
| 612 | $! | ||
| 613 | $ LINK/'DEBUGGER'/'TRACEBACK'/EXE='EXE_DIR''APPLICATION'.EXE - | ||
| 614 | 'OBJ_DIR''APPLICATION_OBJECTS',- | ||
| 615 | 'CRYPTO_LIB'/LIBRARY, - | ||
| 616 | 'OPT_FILE'/OPTION | ||
| 617 | $! | ||
| 618 | $! End The TCP/IP Library Check. | ||
| 619 | $! | ||
| 620 | $ ENDIF | ||
| 621 | $ GOTO NEXT_APPLICATION | 681 | $ GOTO NEXT_APPLICATION |
| 622 | $ APPLICATION_DONE: | 682 | $ APPLICATION_DONE: |
| 623 | $ ENDIF | 683 | $ ENDIF |
| @@ -656,7 +716,7 @@ $! | |||
| 656 | $ CREATE 'OPT_FILE' | 716 | $ CREATE 'OPT_FILE' |
| 657 | $DECK | 717 | $DECK |
| 658 | ! | 718 | ! |
| 659 | ! Default System Options File To Link Agianst | 719 | ! Default System Options File To Link Against |
| 660 | ! The Sharable VAX C Runtime Library. | 720 | ! The Sharable VAX C Runtime Library. |
| 661 | ! | 721 | ! |
| 662 | SYS$SHARE:VAXCRTL.EXE/SHARE | 722 | SYS$SHARE:VAXCRTL.EXE/SHARE |
| @@ -685,7 +745,7 @@ $! | |||
| 685 | $ CREATE 'OPT_FILE' | 745 | $ CREATE 'OPT_FILE' |
| 686 | $DECK | 746 | $DECK |
| 687 | ! | 747 | ! |
| 688 | ! Default System Options File To Link Agianst | 748 | ! Default System Options File To Link Against |
| 689 | ! The Sharable C Runtime Library. | 749 | ! The Sharable C Runtime Library. |
| 690 | ! | 750 | ! |
| 691 | GNU_CC:[000000]GCCLIB/LIBRARY | 751 | GNU_CC:[000000]GCCLIB/LIBRARY |
| @@ -720,7 +780,7 @@ $! | |||
| 720 | $ CREATE 'OPT_FILE' | 780 | $ CREATE 'OPT_FILE' |
| 721 | $DECK | 781 | $DECK |
| 722 | ! | 782 | ! |
| 723 | ! Default System Options File To Link Agianst | 783 | ! Default System Options File To Link Against |
| 724 | ! The Sharable DEC C Runtime Library. | 784 | ! The Sharable DEC C Runtime Library. |
| 725 | ! | 785 | ! |
| 726 | SYS$SHARE:DECC$SHR.EXE/SHARE | 786 | SYS$SHARE:DECC$SHR.EXE/SHARE |
| @@ -735,7 +795,7 @@ $! | |||
| 735 | $ CREATE 'OPT_FILE' | 795 | $ CREATE 'OPT_FILE' |
| 736 | $DECK | 796 | $DECK |
| 737 | ! | 797 | ! |
| 738 | ! Default System Options File For non-VAX To Link Agianst | 798 | ! Default System Options File For non-VAX To Link Against |
| 739 | ! The Sharable C Runtime Library. | 799 | ! The Sharable C Runtime Library. |
| 740 | ! | 800 | ! |
| 741 | SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE | 801 | SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE |
| @@ -756,7 +816,7 @@ $ ENDIF | |||
| 756 | $! | 816 | $! |
| 757 | $! Tell The User What Linker Option File We Are Using. | 817 | $! Tell The User What Linker Option File We Are Using. |
| 758 | $! | 818 | $! |
| 759 | $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." | 819 | $ WRITE SYS$OUTPUT "Using Linker Option File ",OPT_FILE,"." |
| 760 | $! | 820 | $! |
| 761 | $! Time To RETURN. | 821 | $! Time To RETURN. |
| 762 | $! | 822 | $! |
| @@ -803,8 +863,8 @@ $ WRITE SYS$OUTPUT " APPS : To Compile Just The [.xxx.EXE.CRYPTO]*.E | |||
| 803 | $ WRITE SYS$OUTPUT "" | 863 | $ WRITE SYS$OUTPUT "" |
| 804 | $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" | 864 | $ WRITE SYS$OUTPUT " Where 'xxx' Stands For:" |
| 805 | $ WRITE SYS$OUTPUT "" | 865 | $ WRITE SYS$OUTPUT "" |
| 806 | $ WRITE SYS$OUTPUT " ALPHA : Alpha Architecture." | 866 | $ WRITE SYS$OUTPUT " ALPHA[64]: Alpha Architecture." |
| 807 | $ WRITE SYS$OUTPUT " IA64 : IA64 Architecture." | 867 | $ WRITE SYS$OUTPUT " IA64[64] : IA64 Architecture." |
| 808 | $ WRITE SYS$OUTPUT " VAX : VAX Architecture." | 868 | $ WRITE SYS$OUTPUT " VAX : VAX Architecture." |
| 809 | $ WRITE SYS$OUTPUT "" | 869 | $ WRITE SYS$OUTPUT "" |
| 810 | $! | 870 | $! |
| @@ -825,15 +885,16 @@ $! | |||
| 825 | $ IF (P2.EQS."NODEBUG") | 885 | $ IF (P2.EQS."NODEBUG") |
| 826 | $ THEN | 886 | $ THEN |
| 827 | $! | 887 | $! |
| 828 | $! P2 Is NODEBUG, So Compile Without The Debugger Information. | 888 | $! P2 Is NODEBUG, So Compile Without The Debugger Information. |
| 829 | $! | 889 | $! |
| 830 | $ DEBUGGER = "NODEBUG" | 890 | $ DEBUGGER = "NODEBUG" |
| 831 | $ TRACEBACK = "NOTRACEBACK" | 891 | $ LINKMAP = "NOMAP" |
| 832 | $ GCC_OPTIMIZE = "OPTIMIZE" | 892 | $ TRACEBACK = "NOTRACEBACK" |
| 833 | $ CC_OPTIMIZE = "OPTIMIZE" | 893 | $ GCC_OPTIMIZE = "OPTIMIZE" |
| 834 | $ MACRO_OPTIMIZE = "OPTIMIZE" | 894 | $ CC_OPTIMIZE = "OPTIMIZE" |
| 835 | $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." | 895 | $ MACRO_OPTIMIZE = "OPTIMIZE" |
| 836 | $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." | 896 | $ WRITE SYS$OUTPUT "No Debugger Information Will Be Produced During Compile." |
| 897 | $ WRITE SYS$OUTPUT "Compiling With Compiler Optimization." | ||
| 837 | $ ELSE | 898 | $ ELSE |
| 838 | $! | 899 | $! |
| 839 | $! Check To See If We Are To Compile With Debugger Information. | 900 | $! Check To See If We Are To Compile With Debugger Information. |
| @@ -844,6 +905,7 @@ $! | |||
| 844 | $! Compile With Debugger Information. | 905 | $! Compile With Debugger Information. |
| 845 | $! | 906 | $! |
| 846 | $ DEBUGGER = "DEBUG" | 907 | $ DEBUGGER = "DEBUG" |
| 908 | $ LINKMAP = "MAP" | ||
| 847 | $ TRACEBACK = "TRACEBACK" | 909 | $ TRACEBACK = "TRACEBACK" |
| 848 | $ GCC_OPTIMIZE = "NOOPTIMIZE" | 910 | $ GCC_OPTIMIZE = "NOOPTIMIZE" |
| 849 | $ CC_OPTIMIZE = "NOOPTIMIZE" | 911 | $ CC_OPTIMIZE = "NOOPTIMIZE" |
| @@ -852,7 +914,7 @@ $ WRITE SYS$OUTPUT "Debugger Information Will Be Produced During Compile." | |||
| 852 | $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." | 914 | $ WRITE SYS$OUTPUT "Compiling Without Compiler Optimization." |
| 853 | $ ELSE | 915 | $ ELSE |
| 854 | $! | 916 | $! |
| 855 | $! They Entered An Invalid Option.. | 917 | $! They Entered An Invalid Option. |
| 856 | $! | 918 | $! |
| 857 | $ WRITE SYS$OUTPUT "" | 919 | $ WRITE SYS$OUTPUT "" |
| 858 | $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" | 920 | $ WRITE SYS$OUTPUT "The Option ",P2," Is Invalid. The Valid Options Are:" |
| @@ -907,6 +969,60 @@ $! End The P5 Check. | |||
| 907 | $! | 969 | $! |
| 908 | $ ENDIF | 970 | $ ENDIF |
| 909 | $! | 971 | $! |
| 972 | $! Check P7 (POINTER_SIZE). | ||
| 973 | $! | ||
| 974 | $ IF (P7 .NES. "") .AND. (ARCH .NES. "VAX") | ||
| 975 | $ THEN | ||
| 976 | $! | ||
| 977 | $ IF (P7 .EQS. "32") | ||
| 978 | $ THEN | ||
| 979 | $ POINTER_SIZE = " /POINTER_SIZE=32" | ||
| 980 | $ ELSE | ||
| 981 | $ POINTER_SIZE = F$EDIT( P7, "COLLAPSE, UPCASE") | ||
| 982 | $ IF ((POINTER_SIZE .EQS. "64") .OR. - | ||
| 983 | (POINTER_SIZE .EQS. "64=") .OR. - | ||
| 984 | (POINTER_SIZE .EQS. "64=ARGV")) | ||
| 985 | $ THEN | ||
| 986 | $ ARCHD = ARCH+ "_64" | ||
| 987 | $ LIB32 = "" | ||
| 988 | $ POINTER_SIZE = " /POINTER_SIZE=64" | ||
| 989 | $ ELSE | ||
| 990 | $! | ||
| 991 | $! Tell The User Entered An Invalid Option. | ||
| 992 | $! | ||
| 993 | $ WRITE SYS$OUTPUT "" | ||
| 994 | $ WRITE SYS$OUTPUT "The Option ", P7, - | ||
| 995 | " Is Invalid. The Valid Options Are:" | ||
| 996 | $ WRITE SYS$OUTPUT "" | ||
| 997 | $ WRITE SYS$OUTPUT - | ||
| 998 | " """" : Compile with default (short) pointers." | ||
| 999 | $ WRITE SYS$OUTPUT - | ||
| 1000 | " 32 : Compile with 32-bit (short) pointers." | ||
| 1001 | $ WRITE SYS$OUTPUT - | ||
| 1002 | " 64 : Compile with 64-bit (long) pointers (auto ARGV)." | ||
| 1003 | $ WRITE SYS$OUTPUT - | ||
| 1004 | " 64= : Compile with 64-bit (long) pointers (no ARGV)." | ||
| 1005 | $ WRITE SYS$OUTPUT - | ||
| 1006 | " 64=ARGV : Compile with 64-bit (long) pointers (ARGV)." | ||
| 1007 | $ WRITE SYS$OUTPUT "" | ||
| 1008 | $! | ||
| 1009 | $! Time To EXIT. | ||
| 1010 | $! | ||
| 1011 | $ EXIT | ||
| 1012 | $! | ||
| 1013 | $ ENDIF | ||
| 1014 | $! | ||
| 1015 | $ ENDIF | ||
| 1016 | $! | ||
| 1017 | $! End The P7 (POINTER_SIZE) Check. | ||
| 1018 | $! | ||
| 1019 | $ ENDIF | ||
| 1020 | $! | ||
| 1021 | $! Set basic C compiler /INCLUDE directories. | ||
| 1022 | $! | ||
| 1023 | $ CC_INCLUDES = "SYS$DISK:[.''ARCHD'],SYS$DISK:[],SYS$DISK:[-],"+ - | ||
| 1024 | "SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1]" | ||
| 1025 | $! | ||
| 910 | $! Check To See If P3 Is Blank. | 1026 | $! Check To See If P3 Is Blank. |
| 911 | $! | 1027 | $! |
| 912 | $ IF (P3.EQS."") | 1028 | $ IF (P3.EQS."") |
| @@ -1007,11 +1123,64 @@ $ CCDEFS = "TCPIP_TYPE_''P4',DSO_VMS" | |||
| 1007 | $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS | 1123 | $ IF F$TYPE(USER_CCDEFS) .NES. "" THEN CCDEFS = CCDEFS + "," + USER_CCDEFS |
| 1008 | $ CCEXTRAFLAGS = "" | 1124 | $ CCEXTRAFLAGS = "" |
| 1009 | $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS | 1125 | $ IF F$TYPE(USER_CCFLAGS) .NES. "" THEN CCEXTRAFLAGS = USER_CCFLAGS |
| 1010 | $ CCDISABLEWARNINGS = "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" | 1126 | $ CCDISABLEWARNINGS = "" !!! "LONGLONGTYPE,LONGLONGSUFX,FOUNDCR" |
| 1011 | $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - | 1127 | $ IF F$TYPE(USER_CCDISABLEWARNINGS) .NES. "" THEN - |
| 1012 | CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS | 1128 | CCDISABLEWARNINGS = CCDISABLEWARNINGS + "," + USER_CCDISABLEWARNINGS |
| 1013 | $! | 1129 | $! |
| 1014 | $! Check To See If The User Entered A Valid Paramter. | 1130 | $! Check To See If We Have A ZLIB Option. |
| 1131 | $! | ||
| 1132 | $ ZLIB = P8 | ||
| 1133 | $ IF (ZLIB .NES. "") | ||
| 1134 | $ THEN | ||
| 1135 | $! | ||
| 1136 | $! Check for expected ZLIB files. | ||
| 1137 | $! | ||
| 1138 | $ err = 0 | ||
| 1139 | $ file1 = f$parse( "zlib.h", ZLIB, , , "SYNTAX_ONLY") | ||
| 1140 | $ if (f$search( file1) .eqs. "") | ||
| 1141 | $ then | ||
| 1142 | $ WRITE SYS$OUTPUT "" | ||
| 1143 | $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." | ||
| 1144 | $ WRITE SYS$OUTPUT " Can't find header: ''file1'" | ||
| 1145 | $ err = 1 | ||
| 1146 | $ endif | ||
| 1147 | $ file1 = f$parse( "A.;", ZLIB)- "A.;" | ||
| 1148 | $! | ||
| 1149 | $ file2 = f$parse( ZLIB, "libz.olb", , , "SYNTAX_ONLY") | ||
| 1150 | $ if (f$search( file2) .eqs. "") | ||
| 1151 | $ then | ||
| 1152 | $ if (err .eq. 0) | ||
| 1153 | $ then | ||
| 1154 | $ WRITE SYS$OUTPUT "" | ||
| 1155 | $ WRITE SYS$OUTPUT "The Option ", ZLIB, " Is Invalid." | ||
| 1156 | $ endif | ||
| 1157 | $ WRITE SYS$OUTPUT " Can't find library: ''file2'" | ||
| 1158 | $ WRITE SYS$OUTPUT "" | ||
| 1159 | $ err = err+ 2 | ||
| 1160 | $ endif | ||
| 1161 | $ if (err .eq. 1) | ||
| 1162 | $ then | ||
| 1163 | $ WRITE SYS$OUTPUT "" | ||
| 1164 | $ endif | ||
| 1165 | $! | ||
| 1166 | $ if (err .ne. 0) | ||
| 1167 | $ then | ||
| 1168 | $ EXIT | ||
| 1169 | $ endif | ||
| 1170 | $! | ||
| 1171 | $ CCDEFS = """ZLIB=1"", "+ CCDEFS | ||
| 1172 | $ CC_INCLUDES = CC_INCLUDES+ ", "+ file1 | ||
| 1173 | $ ZLIB_LIB = ", ''file2' /library" | ||
| 1174 | $! | ||
| 1175 | $! Print info | ||
| 1176 | $! | ||
| 1177 | $ WRITE SYS$OUTPUT "ZLIB library spec: ", file2 | ||
| 1178 | $! | ||
| 1179 | $! End The ZLIB Check. | ||
| 1180 | $! | ||
| 1181 | $ ENDIF | ||
| 1182 | $! | ||
| 1183 | $! Check To See If The User Entered A Valid Parameter. | ||
| 1015 | $! | 1184 | $! |
| 1016 | $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") | 1185 | $ IF (P3.EQS."VAXC").OR.(P3.EQS."DECC").OR.(P3.EQS."GNUC") |
| 1017 | $ THEN | 1186 | $ THEN |
| @@ -1034,14 +1203,14 @@ $! | |||
| 1034 | $ CC = "CC" | 1203 | $ CC = "CC" |
| 1035 | $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - | 1204 | $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - |
| 1036 | THEN CC = "CC/DECC" | 1205 | THEN CC = "CC/DECC" |
| 1037 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + - | 1206 | $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ - |
| 1038 | "/NOLIST/PREFIX=ALL" + - | 1207 | "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + - |
| 1039 | "/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + - | 1208 | " /INCLUDE=(''CC_INCLUDES')"+ - |
| 1040 | CCEXTRAFLAGS | 1209 | CCEXTRAFLAGS |
| 1041 | $! | 1210 | $! |
| 1042 | $! Define The Linker Options File Name. | 1211 | $! Define The Linker Options File Name. |
| 1043 | $! | 1212 | $! |
| 1044 | $ OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT" | 1213 | $ OPT_FILE = "VAX_DECC_OPTIONS.OPT" |
| 1045 | $! | 1214 | $! |
| 1046 | $! End DECC Check. | 1215 | $! End DECC Check. |
| 1047 | $! | 1216 | $! |
| @@ -1070,7 +1239,7 @@ $ EXIT | |||
| 1070 | $ ENDIF | 1239 | $ ENDIF |
| 1071 | $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" | 1240 | $ IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC" |
| 1072 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | 1241 | $ CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - |
| 1073 | "/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + - | 1242 | "/INCLUDE=(''CC_INCLUDES')"+ - |
| 1074 | CCEXTRAFLAGS | 1243 | CCEXTRAFLAGS |
| 1075 | $ CCDEFS = """VAXC""," + CCDEFS | 1244 | $ CCDEFS = """VAXC""," + CCDEFS |
| 1076 | $! | 1245 | $! |
| @@ -1080,7 +1249,7 @@ $ DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB] | |||
| 1080 | $! | 1249 | $! |
| 1081 | $! Define The Linker Options File Name. | 1250 | $! Define The Linker Options File Name. |
| 1082 | $! | 1251 | $! |
| 1083 | $ OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT" | 1252 | $ OPT_FILE = "VAX_VAXC_OPTIONS.OPT" |
| 1084 | $! | 1253 | $! |
| 1085 | $! End VAXC Check | 1254 | $! End VAXC Check |
| 1086 | $! | 1255 | $! |
| @@ -1102,12 +1271,12 @@ $! | |||
| 1102 | $! Use GNU C... | 1271 | $! Use GNU C... |
| 1103 | $! | 1272 | $! |
| 1104 | $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - | 1273 | $ CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + - |
| 1105 | "/INCLUDE=(SYS$DISK:[],SYS$DISK:[._''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + - | 1274 | "/INCLUDE=(''CC_INCLUDES')"+ - |
| 1106 | CCEXTRAFLAGS | 1275 | CCEXTRAFLAGS |
| 1107 | $! | 1276 | $! |
| 1108 | $! Define The Linker Options File Name. | 1277 | $! Define The Linker Options File Name. |
| 1109 | $! | 1278 | $! |
| 1110 | $ OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT" | 1279 | $ OPT_FILE = "VAX_GNUC_OPTIONS.OPT" |
| 1111 | $! | 1280 | $! |
| 1112 | $! End The GNU C Check. | 1281 | $! End The GNU C Check. |
| 1113 | $! | 1282 | $! |
| @@ -1128,22 +1297,24 @@ $ CC6DISABLEWARNINGS = "MIXLINKAGE" | |||
| 1128 | $ ELSE | 1297 | $ ELSE |
| 1129 | $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" | 1298 | $ CC4DISABLEWARNINGS = CCDISABLEWARNINGS + ",DOLLARID" |
| 1130 | $ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE" | 1299 | $ CC6DISABLEWARNINGS = CCDISABLEWARNINGS + ",MIXLINKAGE" |
| 1131 | $ CCDISABLEWARNINGS = "/WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" | 1300 | $ CCDISABLEWARNINGS = " /WARNING=(DISABLE=(" + CCDISABLEWARNINGS + "))" |
| 1132 | $ ENDIF | 1301 | $ ENDIF |
| 1133 | $ CC4DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" | 1302 | $ CC4DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC4DISABLEWARNINGS + "))" |
| 1134 | $ CC6DISABLEWARNINGS = "/WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))" | 1303 | $ CC6DISABLEWARNINGS = " /WARNING=(DISABLE=(" + CC6DISABLEWARNINGS + "))" |
| 1135 | $ ELSE | 1304 | $ ELSE |
| 1136 | $ CCDISABLEWARNINGS = "" | 1305 | $ CCDISABLEWARNINGS = "" |
| 1137 | $ CC4DISABLEWARNINGS = "" | 1306 | $ CC4DISABLEWARNINGS = "" |
| 1138 | $ CC6DISABLEWARNINGS = "" | 1307 | $ CC6DISABLEWARNINGS = "" |
| 1139 | $ ENDIF | 1308 | $ ENDIF |
| 1140 | $ CC3 = CC + "/DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS | 1309 | $ CC3 = CC + " /DEFINE=(" + CCDEFS + ISSEVEN + ")" + CCDISABLEWARNINGS |
| 1141 | $ CC = CC + "/DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS | 1310 | $ CC = CC + " /DEFINE=(" + CCDEFS + ")" + CCDISABLEWARNINGS |
| 1142 | $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG" | 1311 | $ IF ARCH .EQS. "VAX" .AND. COMPILER .EQS. "DECC" .AND. P2 .NES. "DEBUG" |
| 1143 | $ THEN | 1312 | $ THEN |
| 1144 | $ CC5 = CC + "/OPTIMIZE=NODISJOINT" | 1313 | $ CC5 = CC + " /OPTIMIZE=NODISJOINT" |
| 1314 | $ CC5_DIFFERENT = 1 | ||
| 1145 | $ ELSE | 1315 | $ ELSE |
| 1146 | $ CC5 = CC + "/NOOPTIMIZE" | 1316 | $ CC5 = CC |
| 1317 | $ CC5_DIFFERENT = 0 | ||
| 1147 | $ ENDIF | 1318 | $ ENDIF |
| 1148 | $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS | 1319 | $ CC4 = CC - CCDISABLEWARNINGS + CC4DISABLEWARNINGS |
| 1149 | $ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS | 1320 | $ CC6 = CC - CCDISABLEWARNINGS + CC6DISABLEWARNINGS |
| @@ -1196,7 +1367,7 @@ $ THEN | |||
| 1196 | $! | 1367 | $! |
| 1197 | $! Set the library to use SOCKETSHR | 1368 | $! Set the library to use SOCKETSHR |
| 1198 | $! | 1369 | $! |
| 1199 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT/OPT" | 1370 | $ TCPIP_LIB = ",SYS$DISK:[-.VMS]SOCKETSHR_SHR.OPT /OPTIONS" |
| 1200 | $! | 1371 | $! |
| 1201 | $! Done with SOCKETSHR | 1372 | $! Done with SOCKETSHR |
| 1202 | $! | 1373 | $! |
| @@ -1222,13 +1393,13 @@ $ THEN | |||
| 1222 | $! | 1393 | $! |
| 1223 | $! Set the library to use UCX. | 1394 | $! Set the library to use UCX. |
| 1224 | $! | 1395 | $! |
| 1225 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT/OPT" | 1396 | $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC.OPT /OPTIONS" |
| 1226 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" | 1397 | $ IF F$TRNLNM("UCX$IPC_SHR") .NES. "" |
| 1227 | $ THEN | 1398 | $ THEN |
| 1228 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT/OPT" | 1399 | $ TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_DECC_LOG.OPT /OPTIONS" |
| 1229 | $ ELSE | 1400 | $ ELSE |
| 1230 | $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - | 1401 | $ IF COMPILER .NES. "DECC" .AND. ARCH .EQS. "VAX" THEN - |
| 1231 | TCPIP_LIB = "SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT/OPT" | 1402 | TCPIP_LIB = ",SYS$DISK:[-.VMS]UCX_SHR_VAXC.OPT /OPTIONS" |
| 1232 | $ ENDIF | 1403 | $ ENDIF |
| 1233 | $! | 1404 | $! |
| 1234 | $! Done with UCX | 1405 | $! Done with UCX |
| @@ -1242,7 +1413,7 @@ $ THEN | |||
| 1242 | $! | 1413 | $! |
| 1243 | $! Set the library to use TCPIP (post UCX). | 1414 | $! Set the library to use TCPIP (post UCX). |
| 1244 | $! | 1415 | $! |
| 1245 | $ TCPIP_LIB = "SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT/OPT" | 1416 | $ TCPIP_LIB = ",SYS$DISK:[-.VMS]TCPIP_SHR_DECC.OPT /OPTIONS" |
| 1246 | $! | 1417 | $! |
| 1247 | $! Done with TCPIP | 1418 | $! Done with TCPIP |
| 1248 | $! | 1419 | $! |
| @@ -1263,7 +1434,7 @@ $ ENDIF | |||
| 1263 | $! | 1434 | $! |
| 1264 | $! Print info | 1435 | $! Print info |
| 1265 | $! | 1436 | $! |
| 1266 | $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB | 1437 | $ WRITE SYS$OUTPUT "TCP/IP library spec: ", TCPIP_LIB- "," |
| 1267 | $! | 1438 | $! |
| 1268 | $! Else The User Entered An Invalid Argument. | 1439 | $! Else The User Entered An Invalid Argument. |
| 1269 | $! | 1440 | $! |
diff --git a/src/lib/libcrypto/dsa/dsa_gen.c b/src/lib/libcrypto/dsa/dsa_gen.c index 0fcd25f8b0..cb0b4538a4 100644 --- a/src/lib/libcrypto/dsa/dsa_gen.c +++ b/src/lib/libcrypto/dsa/dsa_gen.c | |||
| @@ -120,7 +120,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, | |||
| 120 | BIGNUM *r0,*W,*X,*c,*test; | 120 | BIGNUM *r0,*W,*X,*c,*test; |
| 121 | BIGNUM *g=NULL,*q=NULL,*p=NULL; | 121 | BIGNUM *g=NULL,*q=NULL,*p=NULL; |
| 122 | BN_MONT_CTX *mont=NULL; | 122 | BN_MONT_CTX *mont=NULL; |
| 123 | int i, k,n=0,b,m=0, qsize = qbits >> 3; | 123 | int i, k, n=0, m=0, qsize = qbits >> 3; |
| 124 | int counter=0; | 124 | int counter=0; |
| 125 | int r=0; | 125 | int r=0; |
| 126 | BN_CTX *ctx=NULL; | 126 | BN_CTX *ctx=NULL; |
| @@ -232,7 +232,6 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, | |||
| 232 | /* "offset = 2" */ | 232 | /* "offset = 2" */ |
| 233 | 233 | ||
| 234 | n=(bits-1)/160; | 234 | n=(bits-1)/160; |
| 235 | b=(bits-1)-n*160; | ||
| 236 | 235 | ||
| 237 | for (;;) | 236 | for (;;) |
| 238 | { | 237 | { |
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c index 4fead07e80..a3ddd7d281 100644 --- a/src/lib/libcrypto/dsa/dsa_ossl.c +++ b/src/lib/libcrypto/dsa/dsa_ossl.c | |||
| @@ -148,15 +148,6 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
| 148 | 148 | ||
| 149 | s=BN_new(); | 149 | s=BN_new(); |
| 150 | if (s == NULL) goto err; | 150 | if (s == NULL) goto err; |
| 151 | |||
| 152 | /* reject a excessive digest length (currently at most | ||
| 153 | * dsa-with-SHA256 is supported) */ | ||
| 154 | if (dlen > SHA256_DIGEST_LENGTH) | ||
| 155 | { | ||
| 156 | reason=DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE; | ||
| 157 | goto err; | ||
| 158 | } | ||
| 159 | |||
| 160 | ctx=BN_CTX_new(); | 151 | ctx=BN_CTX_new(); |
| 161 | if (ctx == NULL) goto err; | 152 | if (ctx == NULL) goto err; |
| 162 | 153 | ||
| @@ -185,7 +176,7 @@ static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | |||
| 185 | if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */ | 176 | if (!BN_mod_mul(&xr,dsa->priv_key,r,dsa->q,ctx)) goto err;/* s = xr */ |
| 186 | if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */ | 177 | if (!BN_add(s, &xr, &m)) goto err; /* s = m + xr */ |
| 187 | if (BN_cmp(s,dsa->q) > 0) | 178 | if (BN_cmp(s,dsa->q) > 0) |
| 188 | BN_sub(s,s,dsa->q); | 179 | if (!BN_sub(s,s,dsa->q)) goto err; |
| 189 | if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err; | 180 | if (!BN_mod_mul(s,s,kinv,dsa->q,ctx)) goto err; |
| 190 | 181 | ||
| 191 | ret=DSA_SIG_new(); | 182 | ret=DSA_SIG_new(); |
| @@ -325,15 +316,6 @@ static int dsa_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, | |||
| 325 | DSAerr(DSA_F_DSA_DO_VERIFY,DSA_R_MODULUS_TOO_LARGE); | 316 | DSAerr(DSA_F_DSA_DO_VERIFY,DSA_R_MODULUS_TOO_LARGE); |
| 326 | return -1; | 317 | return -1; |
| 327 | } | 318 | } |
| 328 | |||
| 329 | /* reject a excessive digest length (currently at most | ||
| 330 | * dsa-with-SHA256 is supported) */ | ||
| 331 | if (dgst_len > SHA256_DIGEST_LENGTH) | ||
| 332 | { | ||
| 333 | DSAerr(DSA_F_DSA_DO_VERIFY,DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); | ||
| 334 | return -1; | ||
| 335 | } | ||
| 336 | |||
| 337 | BN_init(&u1); | 319 | BN_init(&u1); |
| 338 | BN_init(&u2); | 320 | BN_init(&u2); |
| 339 | BN_init(&t1); | 321 | BN_init(&t1); |
diff --git a/src/lib/libcrypto/dso/dso_dlfcn.c b/src/lib/libcrypto/dso/dso_dlfcn.c index 578a20d91d..e78004903c 100644 --- a/src/lib/libcrypto/dso/dso_dlfcn.c +++ b/src/lib/libcrypto/dso/dso_dlfcn.c | |||
| @@ -85,6 +85,7 @@ DSO_METHOD *DSO_METHOD_dlfcn(void) | |||
| 85 | # define HAVE_DLINFO 1 | 85 | # define HAVE_DLINFO 1 |
| 86 | # if defined(_AIX) || defined(__CYGWIN__) || \ | 86 | # if defined(_AIX) || defined(__CYGWIN__) || \ |
| 87 | defined(__SCO_VERSION__) || defined(_SCO_ELF) || \ | 87 | defined(__SCO_VERSION__) || defined(_SCO_ELF) || \ |
| 88 | (defined(__osf__) && !defined(RTLD_NEXT)) || \ | ||
| 88 | (defined(__OpenBSD__) && (!defined(__ELF__) || !defined(RTLD_SELF))) | 89 | (defined(__OpenBSD__) && (!defined(__ELF__) || !defined(RTLD_SELF))) |
| 89 | # undef HAVE_DLINFO | 90 | # undef HAVE_DLINFO |
| 90 | # endif | 91 | # endif |
diff --git a/src/lib/libcrypto/dso/dso_vms.c b/src/lib/libcrypto/dso/dso_vms.c index 321512772a..eee20d14f1 100644 --- a/src/lib/libcrypto/dso/dso_vms.c +++ b/src/lib/libcrypto/dso/dso_vms.c | |||
| @@ -68,8 +68,20 @@ | |||
| 68 | #include <stsdef.h> | 68 | #include <stsdef.h> |
| 69 | #include <descrip.h> | 69 | #include <descrip.h> |
| 70 | #include <starlet.h> | 70 | #include <starlet.h> |
| 71 | #include "vms_rms.h" | ||
| 71 | #endif | 72 | #endif |
| 72 | 73 | ||
| 74 | /* Some compiler options may mask the declaration of "_malloc32". */ | ||
| 75 | #if __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE | ||
| 76 | # if __INITIAL_POINTER_SIZE == 64 | ||
| 77 | # pragma pointer_size save | ||
| 78 | # pragma pointer_size 32 | ||
| 79 | void * _malloc32 (__size_t); | ||
| 80 | # pragma pointer_size restore | ||
| 81 | # endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 82 | #endif /* __INITIAL_POINTER_SIZE && defined _ANSI_C_SOURCE */ | ||
| 83 | |||
| 84 | |||
| 73 | #ifndef OPENSSL_SYS_VMS | 85 | #ifndef OPENSSL_SYS_VMS |
| 74 | DSO_METHOD *DSO_METHOD_vms(void) | 86 | DSO_METHOD *DSO_METHOD_vms(void) |
| 75 | { | 87 | { |
| @@ -121,14 +133,13 @@ typedef struct dso_internal_st | |||
| 121 | /* This should contain the name only, no directory, | 133 | /* This should contain the name only, no directory, |
| 122 | * no extension, nothing but a name. */ | 134 | * no extension, nothing but a name. */ |
| 123 | struct dsc$descriptor_s filename_dsc; | 135 | struct dsc$descriptor_s filename_dsc; |
| 124 | char filename[FILENAME_MAX+1]; | 136 | char filename[ NAMX_MAXRSS+ 1]; |
| 125 | /* This contains whatever is not in filename, if needed. | 137 | /* This contains whatever is not in filename, if needed. |
| 126 | * Normally not defined. */ | 138 | * Normally not defined. */ |
| 127 | struct dsc$descriptor_s imagename_dsc; | 139 | struct dsc$descriptor_s imagename_dsc; |
| 128 | char imagename[FILENAME_MAX+1]; | 140 | char imagename[ NAMX_MAXRSS+ 1]; |
| 129 | } DSO_VMS_INTERNAL; | 141 | } DSO_VMS_INTERNAL; |
| 130 | 142 | ||
| 131 | |||
| 132 | DSO_METHOD *DSO_METHOD_vms(void) | 143 | DSO_METHOD *DSO_METHOD_vms(void) |
| 133 | { | 144 | { |
| 134 | return(&dso_meth_vms); | 145 | return(&dso_meth_vms); |
| @@ -139,7 +150,22 @@ static int vms_load(DSO *dso) | |||
| 139 | void *ptr = NULL; | 150 | void *ptr = NULL; |
| 140 | /* See applicable comments in dso_dl.c */ | 151 | /* See applicable comments in dso_dl.c */ |
| 141 | char *filename = DSO_convert_filename(dso, NULL); | 152 | char *filename = DSO_convert_filename(dso, NULL); |
| 142 | DSO_VMS_INTERNAL *p; | 153 | |
| 154 | /* Ensure 32-bit pointer for "p", and appropriate malloc() function. */ | ||
| 155 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 156 | # define DSO_MALLOC _malloc32 | ||
| 157 | # pragma pointer_size save | ||
| 158 | # pragma pointer_size 32 | ||
| 159 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 160 | # define DSO_MALLOC OPENSSL_malloc | ||
| 161 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 162 | |||
| 163 | DSO_VMS_INTERNAL *p = NULL; | ||
| 164 | |||
| 165 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 166 | # pragma pointer_size restore | ||
| 167 | #endif /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 168 | |||
| 143 | const char *sp1, *sp2; /* Search result */ | 169 | const char *sp1, *sp2; /* Search result */ |
| 144 | 170 | ||
| 145 | if(filename == NULL) | 171 | if(filename == NULL) |
| @@ -192,7 +218,7 @@ static int vms_load(DSO *dso) | |||
| 192 | goto err; | 218 | goto err; |
| 193 | } | 219 | } |
| 194 | 220 | ||
| 195 | p = (DSO_VMS_INTERNAL *)OPENSSL_malloc(sizeof(DSO_VMS_INTERNAL)); | 221 | p = DSO_MALLOC(sizeof(DSO_VMS_INTERNAL)); |
| 196 | if(p == NULL) | 222 | if(p == NULL) |
| 197 | { | 223 | { |
| 198 | DSOerr(DSO_F_VMS_LOAD,ERR_R_MALLOC_FAILURE); | 224 | DSOerr(DSO_F_VMS_LOAD,ERR_R_MALLOC_FAILURE); |
| @@ -290,18 +316,38 @@ void vms_bind_sym(DSO *dso, const char *symname, void **sym) | |||
| 290 | int flags = 0; | 316 | int flags = 0; |
| 291 | #endif | 317 | #endif |
| 292 | struct dsc$descriptor_s symname_dsc; | 318 | struct dsc$descriptor_s symname_dsc; |
| 293 | *sym = NULL; | ||
| 294 | 319 | ||
| 295 | symname_dsc.dsc$w_length = strlen(symname); | 320 | /* Arrange 32-bit pointer to (copied) string storage, if needed. */ |
| 296 | symname_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | 321 | #if __INITIAL_POINTER_SIZE == 64 |
| 297 | symname_dsc.dsc$b_class = DSC$K_CLASS_S; | 322 | # define SYMNAME symname_32p |
| 298 | symname_dsc.dsc$a_pointer = (char *)symname; /* The cast is needed */ | 323 | # pragma pointer_size save |
| 324 | # pragma pointer_size 32 | ||
| 325 | char *symname_32p; | ||
| 326 | # pragma pointer_size restore | ||
| 327 | char symname_32[ NAMX_MAXRSS+ 1]; | ||
| 328 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 329 | # define SYMNAME ((char *) symname) | ||
| 330 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 331 | |||
| 332 | *sym = NULL; | ||
| 299 | 333 | ||
| 300 | if((dso == NULL) || (symname == NULL)) | 334 | if((dso == NULL) || (symname == NULL)) |
| 301 | { | 335 | { |
| 302 | DSOerr(DSO_F_VMS_BIND_SYM,ERR_R_PASSED_NULL_PARAMETER); | 336 | DSOerr(DSO_F_VMS_BIND_SYM,ERR_R_PASSED_NULL_PARAMETER); |
| 303 | return; | 337 | return; |
| 304 | } | 338 | } |
| 339 | |||
| 340 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 341 | /* Copy the symbol name to storage with a 32-bit pointer. */ | ||
| 342 | symname_32p = symname_32; | ||
| 343 | strcpy( symname_32p, symname); | ||
| 344 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 345 | |||
| 346 | symname_dsc.dsc$w_length = strlen(SYMNAME); | ||
| 347 | symname_dsc.dsc$b_dtype = DSC$K_DTYPE_T; | ||
| 348 | symname_dsc.dsc$b_class = DSC$K_CLASS_S; | ||
| 349 | symname_dsc.dsc$a_pointer = SYMNAME; | ||
| 350 | |||
| 305 | if(sk_void_num(dso->meth_data) < 1) | 351 | if(sk_void_num(dso->meth_data) < 1) |
| 306 | { | 352 | { |
| 307 | DSOerr(DSO_F_VMS_BIND_SYM,DSO_R_STACK_ERROR); | 353 | DSOerr(DSO_F_VMS_BIND_SYM,DSO_R_STACK_ERROR); |
| @@ -372,64 +418,60 @@ static DSO_FUNC_TYPE vms_bind_func(DSO *dso, const char *symname) | |||
| 372 | return sym; | 418 | return sym; |
| 373 | } | 419 | } |
| 374 | 420 | ||
| 421 | |||
| 375 | static char *vms_merger(DSO *dso, const char *filespec1, const char *filespec2) | 422 | static char *vms_merger(DSO *dso, const char *filespec1, const char *filespec2) |
| 376 | { | 423 | { |
| 377 | int status; | 424 | int status; |
| 378 | int filespec1len, filespec2len; | 425 | int filespec1len, filespec2len; |
| 379 | struct FAB fab; | 426 | struct FAB fab; |
| 380 | #ifdef NAML$C_MAXRSS | 427 | struct NAMX_STRUCT nam; |
| 381 | struct NAML nam; | 428 | char esa[ NAMX_MAXRSS+ 1]; |
| 382 | char esa[NAML$C_MAXRSS]; | ||
| 383 | #else | ||
| 384 | struct NAM nam; | ||
| 385 | char esa[NAM$C_MAXRSS]; | ||
| 386 | #endif | ||
| 387 | char *merged; | 429 | char *merged; |
| 388 | 430 | ||
| 431 | /* Arrange 32-bit pointer to (copied) string storage, if needed. */ | ||
| 432 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 433 | # define FILESPEC1 filespec1_32p; | ||
| 434 | # define FILESPEC2 filespec2_32p; | ||
| 435 | # pragma pointer_size save | ||
| 436 | # pragma pointer_size 32 | ||
| 437 | char *filespec1_32p; | ||
| 438 | char *filespec2_32p; | ||
| 439 | # pragma pointer_size restore | ||
| 440 | char filespec1_32[ NAMX_MAXRSS+ 1]; | ||
| 441 | char filespec2_32[ NAMX_MAXRSS+ 1]; | ||
| 442 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 443 | # define FILESPEC1 ((char *) filespec1) | ||
| 444 | # define FILESPEC2 ((char *) filespec2) | ||
| 445 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 446 | |||
| 389 | if (!filespec1) filespec1 = ""; | 447 | if (!filespec1) filespec1 = ""; |
| 390 | if (!filespec2) filespec2 = ""; | 448 | if (!filespec2) filespec2 = ""; |
| 391 | filespec1len = strlen(filespec1); | 449 | filespec1len = strlen(filespec1); |
| 392 | filespec2len = strlen(filespec2); | 450 | filespec2len = strlen(filespec2); |
| 393 | 451 | ||
| 452 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 453 | /* Copy the file names to storage with a 32-bit pointer. */ | ||
| 454 | filespec1_32p = filespec1_32; | ||
| 455 | filespec2_32p = filespec2_32; | ||
| 456 | strcpy( filespec1_32p, filespec1); | ||
| 457 | strcpy( filespec2_32p, filespec2); | ||
| 458 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 459 | |||
| 394 | fab = cc$rms_fab; | 460 | fab = cc$rms_fab; |
| 395 | #ifdef NAML$C_MAXRSS | 461 | nam = CC_RMS_NAMX; |
| 396 | nam = cc$rms_naml; | ||
| 397 | #else | ||
| 398 | nam = cc$rms_nam; | ||
| 399 | #endif | ||
| 400 | 462 | ||
| 401 | fab.fab$l_fna = (char *)filespec1; | 463 | FAB_OR_NAML( fab, nam).FAB_OR_NAML_FNA = FILESPEC1; |
| 402 | fab.fab$b_fns = filespec1len; | 464 | FAB_OR_NAML( fab, nam).FAB_OR_NAML_FNS = filespec1len; |
| 403 | fab.fab$l_dna = (char *)filespec2; | 465 | FAB_OR_NAML( fab, nam).FAB_OR_NAML_DNA = FILESPEC2; |
| 404 | fab.fab$b_dns = filespec2len; | 466 | FAB_OR_NAML( fab, nam).FAB_OR_NAML_DNS = filespec2len; |
| 405 | #ifdef NAML$C_MAXRSS | 467 | NAMX_DNA_FNA_SET( fab) |
| 406 | if (filespec1len > NAM$C_MAXRSS) | 468 | |
| 407 | { | 469 | nam.NAMX_ESA = esa; |
| 408 | fab.fab$l_fna = 0; | 470 | nam.NAMX_ESS = NAMX_MAXRSS; |
| 409 | fab.fab$b_fns = 0; | 471 | nam.NAMX_NOP = NAM$M_SYNCHK | NAM$M_PWD; |
| 410 | nam.naml$l_long_filename = (char *)filespec1; | 472 | SET_NAMX_NO_SHORT_UPCASE( nam); |
| 411 | nam.naml$l_long_filename_size = filespec1len; | 473 | |
| 412 | } | 474 | fab.FAB_NAMX = &nam; |
| 413 | if (filespec2len > NAM$C_MAXRSS) | ||
| 414 | { | ||
| 415 | fab.fab$l_dna = 0; | ||
| 416 | fab.fab$b_dns = 0; | ||
| 417 | nam.naml$l_long_defname = (char *)filespec2; | ||
| 418 | nam.naml$l_long_defname_size = filespec2len; | ||
| 419 | } | ||
| 420 | nam.naml$l_esa = esa; | ||
| 421 | nam.naml$b_ess = NAM$C_MAXRSS; | ||
| 422 | nam.naml$l_long_expand = esa; | ||
| 423 | nam.naml$l_long_expand_alloc = sizeof(esa); | ||
| 424 | nam.naml$b_nop = NAM$M_SYNCHK | NAM$M_PWD; | ||
| 425 | nam.naml$v_no_short_upcase = 1; | ||
| 426 | fab.fab$l_naml = &nam; | ||
| 427 | #else | ||
| 428 | nam.nam$l_esa = esa; | ||
| 429 | nam.nam$b_ess = NAM$C_MAXRSS; | ||
| 430 | nam.nam$b_nop = NAM$M_SYNCHK | NAM$M_PWD; | ||
| 431 | fab.fab$l_nam = &nam; | ||
| 432 | #endif | ||
| 433 | 475 | ||
| 434 | status = sys$parse(&fab, 0, 0); | 476 | status = sys$parse(&fab, 0, 0); |
| 435 | 477 | ||
| @@ -460,33 +502,12 @@ static char *vms_merger(DSO *dso, const char *filespec1, const char *filespec2) | |||
| 460 | } | 502 | } |
| 461 | return(NULL); | 503 | return(NULL); |
| 462 | } | 504 | } |
| 463 | #ifdef NAML$C_MAXRSS | 505 | |
| 464 | if (nam.naml$l_long_expand_size) | 506 | merged = OPENSSL_malloc( nam.NAMX_ESL+ 1); |
| 465 | { | ||
| 466 | merged = OPENSSL_malloc(nam.naml$l_long_expand_size + 1); | ||
| 467 | if(!merged) | ||
| 468 | goto malloc_err; | ||
| 469 | strncpy(merged, nam.naml$l_long_expand, | ||
| 470 | nam.naml$l_long_expand_size); | ||
| 471 | merged[nam.naml$l_long_expand_size] = '\0'; | ||
| 472 | } | ||
| 473 | else | ||
| 474 | { | ||
| 475 | merged = OPENSSL_malloc(nam.naml$b_esl + 1); | ||
| 476 | if(!merged) | ||
| 477 | goto malloc_err; | ||
| 478 | strncpy(merged, nam.naml$l_esa, | ||
| 479 | nam.naml$b_esl); | ||
| 480 | merged[nam.naml$b_esl] = '\0'; | ||
| 481 | } | ||
| 482 | #else | ||
| 483 | merged = OPENSSL_malloc(nam.nam$b_esl + 1); | ||
| 484 | if(!merged) | 507 | if(!merged) |
| 485 | goto malloc_err; | 508 | goto malloc_err; |
| 486 | strncpy(merged, nam.nam$l_esa, | 509 | strncpy( merged, nam.NAMX_ESA, nam.NAMX_ESL); |
| 487 | nam.nam$b_esl); | 510 | merged[ nam.NAMX_ESL] = '\0'; |
| 488 | merged[nam.nam$b_esl] = '\0'; | ||
| 489 | #endif | ||
| 490 | return(merged); | 511 | return(merged); |
| 491 | malloc_err: | 512 | malloc_err: |
| 492 | DSOerr(DSO_F_VMS_MERGER, | 513 | DSOerr(DSO_F_VMS_MERGER, |
diff --git a/src/lib/libcrypto/ec/ec2_smpl.c b/src/lib/libcrypto/ec/ec2_smpl.c index cf357b462a..af94458ca7 100644 --- a/src/lib/libcrypto/ec/ec2_smpl.c +++ b/src/lib/libcrypto/ec/ec2_smpl.c | |||
| @@ -937,6 +937,9 @@ int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT | |||
| 937 | { | 937 | { |
| 938 | return EC_POINT_is_at_infinity(group, b) ? 0 : 1; | 938 | return EC_POINT_is_at_infinity(group, b) ? 0 : 1; |
| 939 | } | 939 | } |
| 940 | |||
| 941 | if (EC_POINT_is_at_infinity(group, b)) | ||
| 942 | return 1; | ||
| 940 | 943 | ||
| 941 | if (a->Z_is_one && b->Z_is_one) | 944 | if (a->Z_is_one && b->Z_is_one) |
| 942 | { | 945 | { |
diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c index f05df5332e..19f21675fb 100644 --- a/src/lib/libcrypto/ec/ec_mult.c +++ b/src/lib/libcrypto/ec/ec_mult.c | |||
| @@ -169,11 +169,13 @@ static void ec_pre_comp_clear_free(void *pre_) | |||
| 169 | EC_POINT **p; | 169 | EC_POINT **p; |
| 170 | 170 | ||
| 171 | for (p = pre->points; *p != NULL; p++) | 171 | for (p = pre->points; *p != NULL; p++) |
| 172 | { | ||
| 172 | EC_POINT_clear_free(*p); | 173 | EC_POINT_clear_free(*p); |
| 173 | OPENSSL_cleanse(pre->points, sizeof pre->points); | 174 | OPENSSL_cleanse(p, sizeof *p); |
| 175 | } | ||
| 174 | OPENSSL_free(pre->points); | 176 | OPENSSL_free(pre->points); |
| 175 | } | 177 | } |
| 176 | OPENSSL_cleanse(pre, sizeof pre); | 178 | OPENSSL_cleanse(pre, sizeof *pre); |
| 177 | OPENSSL_free(pre); | 179 | OPENSSL_free(pre); |
| 178 | } | 180 | } |
| 179 | 181 | ||
diff --git a/src/lib/libcrypto/ec/ecp_smpl.c b/src/lib/libcrypto/ec/ecp_smpl.c index 4d26f8bdf6..66a92e2a90 100644 --- a/src/lib/libcrypto/ec/ecp_smpl.c +++ b/src/lib/libcrypto/ec/ecp_smpl.c | |||
| @@ -1406,6 +1406,9 @@ int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT * | |||
| 1406 | { | 1406 | { |
| 1407 | return EC_POINT_is_at_infinity(group, b) ? 0 : 1; | 1407 | return EC_POINT_is_at_infinity(group, b) ? 0 : 1; |
| 1408 | } | 1408 | } |
| 1409 | |||
| 1410 | if (EC_POINT_is_at_infinity(group, b)) | ||
| 1411 | return 1; | ||
| 1409 | 1412 | ||
| 1410 | if (a->Z_is_one && b->Z_is_one) | 1413 | if (a->Z_is_one && b->Z_is_one) |
| 1411 | { | 1414 | { |
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h index 8ad11b15d7..9d73abac8e 100644 --- a/src/lib/libcrypto/engine/engine.h +++ b/src/lib/libcrypto/engine/engine.h | |||
| @@ -678,6 +678,7 @@ typedef struct st_dynamic_fns { | |||
| 678 | * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ | 678 | * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ |
| 679 | typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); | 679 | typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); |
| 680 | #define IMPLEMENT_DYNAMIC_CHECK_FN() \ | 680 | #define IMPLEMENT_DYNAMIC_CHECK_FN() \ |
| 681 | OPENSSL_EXPORT unsigned long v_check(unsigned long v); \ | ||
| 681 | OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ | 682 | OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ |
| 682 | if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ | 683 | if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ |
| 683 | return 0; } | 684 | return 0; } |
| @@ -701,6 +702,8 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, | |||
| 701 | const dynamic_fns *fns); | 702 | const dynamic_fns *fns); |
| 702 | #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ | 703 | #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ |
| 703 | OPENSSL_EXPORT \ | 704 | OPENSSL_EXPORT \ |
| 705 | int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ | ||
| 706 | OPENSSL_EXPORT \ | ||
| 704 | int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ | 707 | int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ |
| 705 | if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ | 708 | if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ |
| 706 | if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ | 709 | if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ |
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c index b42c747249..28546a84bc 100644 --- a/src/lib/libcrypto/evp/encode.c +++ b/src/lib/libcrypto/evp/encode.c | |||
| @@ -235,7 +235,7 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) | |||
| 235 | int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, | 235 | int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, |
| 236 | const unsigned char *in, int inl) | 236 | const unsigned char *in, int inl) |
| 237 | { | 237 | { |
| 238 | int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl; | 238 | int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,exp_nl; |
| 239 | unsigned char *d; | 239 | unsigned char *d; |
| 240 | 240 | ||
| 241 | n=ctx->num; | 241 | n=ctx->num; |
| @@ -319,7 +319,6 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, | |||
| 319 | * lines. We process the line and then need to | 319 | * lines. We process the line and then need to |
| 320 | * accept the '\n' */ | 320 | * accept the '\n' */ |
| 321 | if ((v != B64_EOF) && (n >= 64)) exp_nl=1; | 321 | if ((v != B64_EOF) && (n >= 64)) exp_nl=1; |
| 322 | tmp2=v; | ||
| 323 | if (n > 0) | 322 | if (n > 0) |
| 324 | { | 323 | { |
| 325 | v=EVP_DecodeBlock(out,d,n); | 324 | v=EVP_DecodeBlock(out,d,n); |
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c index bead6a2170..c268d25cb4 100644 --- a/src/lib/libcrypto/evp/evp_enc.c +++ b/src/lib/libcrypto/evp/evp_enc.c | |||
| @@ -204,6 +204,7 @@ skip_to_init: | |||
| 204 | case EVP_CIPH_OFB_MODE: | 204 | case EVP_CIPH_OFB_MODE: |
| 205 | 205 | ||
| 206 | ctx->num = 0; | 206 | ctx->num = 0; |
| 207 | /* fall-through */ | ||
| 207 | 208 | ||
| 208 | case EVP_CIPH_CBC_MODE: | 209 | case EVP_CIPH_CBC_MODE: |
| 209 | 210 | ||
diff --git a/src/lib/libcrypto/evp/evp_test.c b/src/lib/libcrypto/evp/evp_test.c index 902efac975..55c7cdfdcc 100644 --- a/src/lib/libcrypto/evp/evp_test.c +++ b/src/lib/libcrypto/evp/evp_test.c | |||
| @@ -435,6 +435,7 @@ int main(int argc,char **argv) | |||
| 435 | EXIT(3); | 435 | EXIT(3); |
| 436 | } | 436 | } |
| 437 | } | 437 | } |
| 438 | fclose(f); | ||
| 438 | 439 | ||
| 439 | #ifndef OPENSSL_NO_ENGINE | 440 | #ifndef OPENSSL_NO_ENGINE |
| 440 | ENGINE_cleanup(); | 441 | ENGINE_cleanup(); |
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index 1916c61699..e26ccd0d08 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c | |||
| @@ -411,7 +411,10 @@ void EVP_PKEY_free(EVP_PKEY *x) | |||
| 411 | static void EVP_PKEY_free_it(EVP_PKEY *x) | 411 | static void EVP_PKEY_free_it(EVP_PKEY *x) |
| 412 | { | 412 | { |
| 413 | if (x->ameth && x->ameth->pkey_free) | 413 | if (x->ameth && x->ameth->pkey_free) |
| 414 | { | ||
| 414 | x->ameth->pkey_free(x); | 415 | x->ameth->pkey_free(x); |
| 416 | x->pkey.ptr = NULL; | ||
| 417 | } | ||
| 415 | #ifndef OPENSSL_NO_ENGINE | 418 | #ifndef OPENSSL_NO_ENGINE |
| 416 | if (x->engine) | 419 | if (x->engine) |
| 417 | { | 420 | { |
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c index 8df6d48a7e..bb893f5bde 100644 --- a/src/lib/libcrypto/evp/p_sign.c +++ b/src/lib/libcrypto/evp/p_sign.c | |||
| @@ -81,7 +81,7 @@ int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, | |||
| 81 | unsigned char m[EVP_MAX_MD_SIZE]; | 81 | unsigned char m[EVP_MAX_MD_SIZE]; |
| 82 | unsigned int m_len; | 82 | unsigned int m_len; |
| 83 | int i,ok=0,v; | 83 | int i,ok=0,v; |
| 84 | MS_STATIC EVP_MD_CTX tmp_ctx; | 84 | EVP_MD_CTX tmp_ctx; |
| 85 | 85 | ||
| 86 | *siglen=0; | 86 | *siglen=0; |
| 87 | EVP_MD_CTX_init(&tmp_ctx); | 87 | EVP_MD_CTX_init(&tmp_ctx); |
diff --git a/src/lib/libcrypto/evp/p_verify.c b/src/lib/libcrypto/evp/p_verify.c index 8db46412f3..41d4b67130 100644 --- a/src/lib/libcrypto/evp/p_verify.c +++ b/src/lib/libcrypto/evp/p_verify.c | |||
| @@ -68,7 +68,7 @@ int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, | |||
| 68 | unsigned char m[EVP_MAX_MD_SIZE]; | 68 | unsigned char m[EVP_MAX_MD_SIZE]; |
| 69 | unsigned int m_len; | 69 | unsigned int m_len; |
| 70 | int i,ok=0,v; | 70 | int i,ok=0,v; |
| 71 | MS_STATIC EVP_MD_CTX tmp_ctx; | 71 | EVP_MD_CTX tmp_ctx; |
| 72 | 72 | ||
| 73 | EVP_MD_CTX_init(&tmp_ctx); | 73 | EVP_MD_CTX_init(&tmp_ctx); |
| 74 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); | 74 | EVP_MD_CTX_copy_ex(&tmp_ctx,ctx); |
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c index 45015fe754..6c98fc43a3 100644 --- a/src/lib/libcrypto/hmac/hmac.c +++ b/src/lib/libcrypto/hmac/hmac.c | |||
| @@ -138,12 +138,9 @@ int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len) | |||
| 138 | 138 | ||
| 139 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) | 139 | int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len) |
| 140 | { | 140 | { |
| 141 | int j; | ||
| 142 | unsigned int i; | 141 | unsigned int i; |
| 143 | unsigned char buf[EVP_MAX_MD_SIZE]; | 142 | unsigned char buf[EVP_MAX_MD_SIZE]; |
| 144 | 143 | ||
| 145 | j=EVP_MD_block_size(ctx->md); | ||
| 146 | |||
| 147 | if (!EVP_DigestFinal_ex(&ctx->md_ctx,buf,&i)) | 144 | if (!EVP_DigestFinal_ex(&ctx->md_ctx,buf,&i)) |
| 148 | goto err; | 145 | goto err; |
| 149 | if (!EVP_MD_CTX_copy_ex(&ctx->md_ctx,&ctx->o_ctx)) | 146 | if (!EVP_MD_CTX_copy_ex(&ctx->md_ctx,&ctx->o_ctx)) |
diff --git a/src/lib/libcrypto/md32_common.h b/src/lib/libcrypto/md32_common.h index 1cb783944e..bb7381952a 100644 --- a/src/lib/libcrypto/md32_common.h +++ b/src/lib/libcrypto/md32_common.h | |||
| @@ -165,7 +165,7 @@ | |||
| 165 | asm ( \ | 165 | asm ( \ |
| 166 | "roll %1,%0" \ | 166 | "roll %1,%0" \ |
| 167 | : "=r"(ret) \ | 167 | : "=r"(ret) \ |
| 168 | : "I"(n), "0"(a) \ | 168 | : "I"(n), "0"((unsigned int)(a)) \ |
| 169 | : "cc"); \ | 169 | : "cc"); \ |
| 170 | ret; \ | 170 | ret; \ |
| 171 | }) | 171 | }) |
| @@ -383,6 +383,7 @@ int HASH_FINAL (unsigned char *md, HASH_CTX *c) | |||
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | #ifndef MD32_REG_T | 385 | #ifndef MD32_REG_T |
| 386 | #if defined(__alpha) || defined(__sparcv9) || defined(__mips) | ||
| 386 | #define MD32_REG_T long | 387 | #define MD32_REG_T long |
| 387 | /* | 388 | /* |
| 388 | * This comment was originaly written for MD5, which is why it | 389 | * This comment was originaly written for MD5, which is why it |
| @@ -400,9 +401,15 @@ int HASH_FINAL (unsigned char *md, HASH_CTX *c) | |||
| 400 | * Well, to be honest it should say that this *prevents* | 401 | * Well, to be honest it should say that this *prevents* |
| 401 | * performance degradation. | 402 | * performance degradation. |
| 402 | * <appro@fy.chalmers.se> | 403 | * <appro@fy.chalmers.se> |
| 403 | * Apparently there're LP64 compilers that generate better | 404 | */ |
| 404 | * code if A-D are declared int. Most notably GCC-x86_64 | 405 | #else |
| 405 | * generates better code. | 406 | /* |
| 407 | * Above is not absolute and there are LP64 compilers that | ||
| 408 | * generate better code if MD32_REG_T is defined int. The above | ||
| 409 | * pre-processor condition reflects the circumstances under which | ||
| 410 | * the conclusion was made and is subject to further extension. | ||
| 406 | * <appro@fy.chalmers.se> | 411 | * <appro@fy.chalmers.se> |
| 407 | */ | 412 | */ |
| 413 | #define MD32_REG_T int | ||
| 414 | #endif | ||
| 408 | #endif | 415 | #endif |
diff --git a/src/lib/libcrypto/o_time.c b/src/lib/libcrypto/o_time.c index eecbdd19f0..9030fdef7a 100644 --- a/src/lib/libcrypto/o_time.c +++ b/src/lib/libcrypto/o_time.c | |||
| @@ -64,12 +64,18 @@ | |||
| 64 | #include "o_time.h" | 64 | #include "o_time.h" |
| 65 | 65 | ||
| 66 | #ifdef OPENSSL_SYS_VMS | 66 | #ifdef OPENSSL_SYS_VMS |
| 67 | # include <libdtdef.h> | 67 | # if __CRTL_VER >= 70000000 && \ |
| 68 | # include <lib$routines.h> | 68 | (defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE) |
| 69 | # include <lnmdef.h> | 69 | # define VMS_GMTIME_OK |
| 70 | # include <starlet.h> | 70 | # endif |
| 71 | # include <descrip.h> | 71 | # ifndef VMS_GMTIME_OK |
| 72 | # include <stdlib.h> | 72 | # include <libdtdef.h> |
| 73 | # include <lib$routines.h> | ||
| 74 | # include <lnmdef.h> | ||
| 75 | # include <starlet.h> | ||
| 76 | # include <descrip.h> | ||
| 77 | # include <stdlib.h> | ||
| 78 | # endif /* ndef VMS_GMTIME_OK */ | ||
| 73 | #endif | 79 | #endif |
| 74 | 80 | ||
| 75 | struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) | 81 | struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) |
| @@ -81,7 +87,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) | |||
| 81 | so we don't even look at the return value */ | 87 | so we don't even look at the return value */ |
| 82 | gmtime_r(timer,result); | 88 | gmtime_r(timer,result); |
| 83 | ts = result; | 89 | ts = result; |
| 84 | #elif !defined(OPENSSL_SYS_VMS) | 90 | #elif !defined(OPENSSL_SYS_VMS) || defined(VMS_GMTIME_OK) |
| 85 | ts = gmtime(timer); | 91 | ts = gmtime(timer); |
| 86 | if (ts == NULL) | 92 | if (ts == NULL) |
| 87 | return NULL; | 93 | return NULL; |
| @@ -89,7 +95,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) | |||
| 89 | memcpy(result, ts, sizeof(struct tm)); | 95 | memcpy(result, ts, sizeof(struct tm)); |
| 90 | ts = result; | 96 | ts = result; |
| 91 | #endif | 97 | #endif |
| 92 | #ifdef OPENSSL_SYS_VMS | 98 | #if defined( OPENSSL_SYS_VMS) && !defined( VMS_GMTIME_OK) |
| 93 | if (ts == NULL) | 99 | if (ts == NULL) |
| 94 | { | 100 | { |
| 95 | static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL"); | 101 | static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL"); |
diff --git a/src/lib/libcrypto/ocsp/ocsp_ht.c b/src/lib/libcrypto/ocsp/ocsp_ht.c index 12bbfcffd1..af5fc16691 100644 --- a/src/lib/libcrypto/ocsp/ocsp_ht.c +++ b/src/lib/libcrypto/ocsp/ocsp_ht.c | |||
| @@ -397,11 +397,12 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx) | |||
| 397 | 397 | ||
| 398 | 398 | ||
| 399 | case OHS_ASN1_HEADER: | 399 | case OHS_ASN1_HEADER: |
| 400 | /* Now reading ASN1 header: can read at least 6 bytes which | 400 | /* Now reading ASN1 header: can read at least 2 bytes which |
| 401 | * is more than enough for any valid ASN1 SEQUENCE header | 401 | * is enough for ASN1 SEQUENCE header and either length field |
| 402 | * or at least the length of the length field. | ||
| 402 | */ | 403 | */ |
| 403 | n = BIO_get_mem_data(rctx->mem, &p); | 404 | n = BIO_get_mem_data(rctx->mem, &p); |
| 404 | if (n < 6) | 405 | if (n < 2) |
| 405 | goto next_io; | 406 | goto next_io; |
| 406 | 407 | ||
| 407 | /* Check it is an ASN1 SEQUENCE */ | 408 | /* Check it is an ASN1 SEQUENCE */ |
| @@ -414,6 +415,11 @@ int OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx) | |||
| 414 | /* Check out length field */ | 415 | /* Check out length field */ |
| 415 | if (*p & 0x80) | 416 | if (*p & 0x80) |
| 416 | { | 417 | { |
| 418 | /* If MSB set on initial length octet we can now | ||
| 419 | * always read 6 octets: make sure we have them. | ||
| 420 | */ | ||
| 421 | if (n < 6) | ||
| 422 | goto next_io; | ||
| 417 | n = *p & 0x7F; | 423 | n = *p & 0x7F; |
| 418 | /* Not NDEF or excessive length */ | 424 | /* Not NDEF or excessive length */ |
| 419 | if (!n || (n > 4)) | 425 | if (!n || (n > 4)) |
diff --git a/src/lib/libcrypto/ocsp/ocsp_lib.c b/src/lib/libcrypto/ocsp/ocsp_lib.c index 36905d76cd..e92b86c060 100644 --- a/src/lib/libcrypto/ocsp/ocsp_lib.c +++ b/src/lib/libcrypto/ocsp/ocsp_lib.c | |||
| @@ -170,14 +170,14 @@ int OCSP_parse_url(char *url, char **phost, char **pport, char **ppath, int *pss | |||
| 170 | 170 | ||
| 171 | char *host, *port; | 171 | char *host, *port; |
| 172 | 172 | ||
| 173 | /* dup the buffer since we are going to mess with it */ | ||
| 174 | buf = BUF_strdup(url); | ||
| 175 | if (!buf) goto mem_err; | ||
| 176 | |||
| 177 | *phost = NULL; | 173 | *phost = NULL; |
| 178 | *pport = NULL; | 174 | *pport = NULL; |
| 179 | *ppath = NULL; | 175 | *ppath = NULL; |
| 180 | 176 | ||
| 177 | /* dup the buffer since we are going to mess with it */ | ||
| 178 | buf = BUF_strdup(url); | ||
| 179 | if (!buf) goto mem_err; | ||
| 180 | |||
| 181 | /* Check for initial colon */ | 181 | /* Check for initial colon */ |
| 182 | p = strchr(buf, ':'); | 182 | p = strchr(buf, ':'); |
| 183 | 183 | ||
diff --git a/src/lib/libcrypto/ocsp/ocsp_prn.c b/src/lib/libcrypto/ocsp/ocsp_prn.c index 1695c9c4ad..87608ff399 100644 --- a/src/lib/libcrypto/ocsp/ocsp_prn.c +++ b/src/lib/libcrypto/ocsp/ocsp_prn.c | |||
| @@ -182,7 +182,6 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags) | |||
| 182 | { | 182 | { |
| 183 | int i, ret = 0; | 183 | int i, ret = 0; |
| 184 | long l; | 184 | long l; |
| 185 | unsigned char *p; | ||
| 186 | OCSP_CERTID *cid = NULL; | 185 | OCSP_CERTID *cid = NULL; |
| 187 | OCSP_BASICRESP *br = NULL; | 186 | OCSP_BASICRESP *br = NULL; |
| 188 | OCSP_RESPID *rid = NULL; | 187 | OCSP_RESPID *rid = NULL; |
| @@ -207,7 +206,6 @@ int OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE* o, unsigned long flags) | |||
| 207 | return 1; | 206 | return 1; |
| 208 | } | 207 | } |
| 209 | 208 | ||
| 210 | p = ASN1_STRING_data(rb->response); | ||
| 211 | i = ASN1_STRING_length(rb->response); | 209 | i = ASN1_STRING_length(rb->response); |
| 212 | if (!(br = OCSP_response_get1_basic(o))) goto err; | 210 | if (!(br = OCSP_response_get1_basic(o))) goto err; |
| 213 | rd = br->tbsResponseData; | 211 | rd = br->tbsResponseData; |
diff --git a/src/lib/libcrypto/opensslv.h b/src/lib/libcrypto/opensslv.h index 2fb110fa0e..310a3387be 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 0x1000001fL | 28 | #define OPENSSL_VERSION_NUMBER 0x1000005fL |
| 29 | #ifdef OPENSSL_FIPS | 29 | #ifdef OPENSSL_FIPS |
| 30 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0a-fips 1 Jun 2010" | 30 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0e-fips 6 Sep 2011" |
| 31 | #else | 31 | #else |
| 32 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0a 1 Jun 2010" | 32 | #define OPENSSL_VERSION_TEXT "OpenSSL 1.0.0e 6 Sep 2011" |
| 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/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c index 42e4861bc1..cfc89a9921 100644 --- a/src/lib/libcrypto/pem/pem_lib.c +++ b/src/lib/libcrypto/pem/pem_lib.c | |||
| @@ -482,7 +482,6 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, | |||
| 482 | 482 | ||
| 483 | int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) | 483 | int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) |
| 484 | { | 484 | { |
| 485 | int o; | ||
| 486 | const EVP_CIPHER *enc=NULL; | 485 | const EVP_CIPHER *enc=NULL; |
| 487 | char *p,c; | 486 | char *p,c; |
| 488 | char **header_pp = &header; | 487 | char **header_pp = &header; |
| @@ -522,7 +521,6 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) | |||
| 522 | header++; | 521 | header++; |
| 523 | } | 522 | } |
| 524 | *header='\0'; | 523 | *header='\0'; |
| 525 | o=OBJ_sn2nid(p); | ||
| 526 | cipher->cipher=enc=EVP_get_cipherbyname(p); | 524 | cipher->cipher=enc=EVP_get_cipherbyname(p); |
| 527 | *header=c; | 525 | *header=c; |
| 528 | header++; | 526 | header++; |
diff --git a/src/lib/libcrypto/perlasm/cbc.pl b/src/lib/libcrypto/perlasm/cbc.pl index e43dc9ae15..6fc2510905 100644 --- a/src/lib/libcrypto/perlasm/cbc.pl +++ b/src/lib/libcrypto/perlasm/cbc.pl | |||
| @@ -158,7 +158,6 @@ sub cbc | |||
| 158 | &jmp_ptr($count); | 158 | &jmp_ptr($count); |
| 159 | 159 | ||
| 160 | &set_label("ej7"); | 160 | &set_label("ej7"); |
| 161 | &xor("edx", "edx") if $ppro; # ppro friendly | ||
| 162 | &movb(&HB("edx"), &BP(6,$in,"",0)); | 161 | &movb(&HB("edx"), &BP(6,$in,"",0)); |
| 163 | &shl("edx",8); | 162 | &shl("edx",8); |
| 164 | &set_label("ej6"); | 163 | &set_label("ej6"); |
| @@ -170,7 +169,6 @@ sub cbc | |||
| 170 | &jmp(&label("ejend")); | 169 | &jmp(&label("ejend")); |
| 171 | &set_label("ej3"); | 170 | &set_label("ej3"); |
| 172 | &movb(&HB("ecx"), &BP(2,$in,"",0)); | 171 | &movb(&HB("ecx"), &BP(2,$in,"",0)); |
| 173 | &xor("ecx", "ecx") if $ppro; # ppro friendly | ||
| 174 | &shl("ecx",8); | 172 | &shl("ecx",8); |
| 175 | &set_label("ej2"); | 173 | &set_label("ej2"); |
| 176 | &movb(&HB("ecx"), &BP(1,$in,"",0)); | 174 | &movb(&HB("ecx"), &BP(1,$in,"",0)); |
diff --git a/src/lib/libcrypto/perlasm/x86_64-xlate.pl b/src/lib/libcrypto/perlasm/x86_64-xlate.pl index d66ad24095..68b4c1ca80 100755 --- a/src/lib/libcrypto/perlasm/x86_64-xlate.pl +++ b/src/lib/libcrypto/perlasm/x86_64-xlate.pl | |||
| @@ -167,7 +167,7 @@ my %globals; | |||
| 167 | } elsif ($self->{op} =~ /^(pop|push)f/) { | 167 | } elsif ($self->{op} =~ /^(pop|push)f/) { |
| 168 | $self->{op} .= $self->{sz}; | 168 | $self->{op} .= $self->{sz}; |
| 169 | } elsif ($self->{op} eq "call" && $current_segment eq ".CRT\$XCU") { | 169 | } elsif ($self->{op} eq "call" && $current_segment eq ".CRT\$XCU") { |
| 170 | $self->{op} = "ALIGN\t8\n\tDQ"; | 170 | $self->{op} = "\tDQ"; |
| 171 | } | 171 | } |
| 172 | $self->{op}; | 172 | $self->{op}; |
| 173 | } | 173 | } |
| @@ -546,6 +546,8 @@ my %globals; | |||
| 546 | if ($line=~/\.([px])data/) { | 546 | if ($line=~/\.([px])data/) { |
| 547 | $v.=" rdata align="; | 547 | $v.=" rdata align="; |
| 548 | $v.=$1 eq "p"? 4 : 8; | 548 | $v.=$1 eq "p"? 4 : 8; |
| 549 | } elsif ($line=~/\.CRT\$/i) { | ||
| 550 | $v.=" rdata align=8"; | ||
| 549 | } | 551 | } |
| 550 | } else { | 552 | } else { |
| 551 | $v="$current_segment\tENDS\n" if ($current_segment); | 553 | $v="$current_segment\tENDS\n" if ($current_segment); |
| @@ -553,6 +555,8 @@ my %globals; | |||
| 553 | if ($line=~/\.([px])data/) { | 555 | if ($line=~/\.([px])data/) { |
| 554 | $v.=" READONLY"; | 556 | $v.=" READONLY"; |
| 555 | $v.=" ALIGN(".($1 eq "p" ? 4 : 8).")" if ($masm>=$masmref); | 557 | $v.=" ALIGN(".($1 eq "p" ? 4 : 8).")" if ($masm>=$masmref); |
| 558 | } elsif ($line=~/\.CRT\$/i) { | ||
| 559 | $v.=" READONLY DWORD"; | ||
| 556 | } | 560 | } |
| 557 | } | 561 | } |
| 558 | $current_segment = $line; | 562 | $current_segment = $line; |
diff --git a/src/lib/libcrypto/pkcs12/p12_key.c b/src/lib/libcrypto/pkcs12/p12_key.c index a29794bbbc..424203f648 100644 --- a/src/lib/libcrypto/pkcs12/p12_key.c +++ b/src/lib/libcrypto/pkcs12/p12_key.c | |||
| @@ -107,6 +107,7 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
| 107 | unsigned char *B, *D, *I, *p, *Ai; | 107 | unsigned char *B, *D, *I, *p, *Ai; |
| 108 | int Slen, Plen, Ilen, Ijlen; | 108 | int Slen, Plen, Ilen, Ijlen; |
| 109 | int i, j, u, v; | 109 | int i, j, u, v; |
| 110 | int ret = 0; | ||
| 110 | BIGNUM *Ij, *Bpl1; /* These hold Ij and B + 1 */ | 111 | BIGNUM *Ij, *Bpl1; /* These hold Ij and B + 1 */ |
| 111 | EVP_MD_CTX ctx; | 112 | EVP_MD_CTX ctx; |
| 112 | #ifdef DEBUG_KEYGEN | 113 | #ifdef DEBUG_KEYGEN |
| @@ -144,10 +145,8 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
| 144 | I = OPENSSL_malloc (Ilen); | 145 | I = OPENSSL_malloc (Ilen); |
| 145 | Ij = BN_new(); | 146 | Ij = BN_new(); |
| 146 | Bpl1 = BN_new(); | 147 | Bpl1 = BN_new(); |
| 147 | if (!D || !Ai || !B || !I || !Ij || !Bpl1) { | 148 | if (!D || !Ai || !B || !I || !Ij || !Bpl1) |
| 148 | PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_MALLOC_FAILURE); | 149 | goto err; |
| 149 | return 0; | ||
| 150 | } | ||
| 151 | for (i = 0; i < v; i++) D[i] = id; | 150 | for (i = 0; i < v; i++) D[i] = id; |
| 152 | p = I; | 151 | p = I; |
| 153 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; | 152 | for (i = 0; i < Slen; i++) *p++ = salt[i % saltlen]; |
| @@ -164,28 +163,22 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
| 164 | } | 163 | } |
| 165 | memcpy (out, Ai, min (n, u)); | 164 | memcpy (out, Ai, min (n, u)); |
| 166 | if (u >= n) { | 165 | if (u >= n) { |
| 167 | OPENSSL_free (Ai); | ||
| 168 | OPENSSL_free (B); | ||
| 169 | OPENSSL_free (D); | ||
| 170 | OPENSSL_free (I); | ||
| 171 | BN_free (Ij); | ||
| 172 | BN_free (Bpl1); | ||
| 173 | EVP_MD_CTX_cleanup(&ctx); | ||
| 174 | #ifdef DEBUG_KEYGEN | 166 | #ifdef DEBUG_KEYGEN |
| 175 | fprintf(stderr, "Output KEY (length %d)\n", tmpn); | 167 | fprintf(stderr, "Output KEY (length %d)\n", tmpn); |
| 176 | h__dump(tmpout, tmpn); | 168 | h__dump(tmpout, tmpn); |
| 177 | #endif | 169 | #endif |
| 178 | return 1; | 170 | ret = 1; |
| 171 | goto end; | ||
| 179 | } | 172 | } |
| 180 | n -= u; | 173 | n -= u; |
| 181 | out += u; | 174 | out += u; |
| 182 | for (j = 0; j < v; j++) B[j] = Ai[j % u]; | 175 | for (j = 0; j < v; j++) B[j] = Ai[j % u]; |
| 183 | /* Work out B + 1 first then can use B as tmp space */ | 176 | /* Work out B + 1 first then can use B as tmp space */ |
| 184 | BN_bin2bn (B, v, Bpl1); | 177 | if (!BN_bin2bn (B, v, Bpl1)) goto err; |
| 185 | BN_add_word (Bpl1, 1); | 178 | if (!BN_add_word (Bpl1, 1)) goto err; |
| 186 | for (j = 0; j < Ilen ; j+=v) { | 179 | for (j = 0; j < Ilen ; j+=v) { |
| 187 | BN_bin2bn (I + j, v, Ij); | 180 | if (!BN_bin2bn (I + j, v, Ij)) goto err; |
| 188 | BN_add (Ij, Ij, Bpl1); | 181 | if (!BN_add (Ij, Ij, Bpl1)) goto err; |
| 189 | BN_bn2bin (Ij, B); | 182 | BN_bn2bin (Ij, B); |
| 190 | Ijlen = BN_num_bytes (Ij); | 183 | Ijlen = BN_num_bytes (Ij); |
| 191 | /* If more than 2^(v*8) - 1 cut off MSB */ | 184 | /* If more than 2^(v*8) - 1 cut off MSB */ |
| @@ -201,6 +194,19 @@ int PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt, | |||
| 201 | } else BN_bn2bin (Ij, I + j); | 194 | } else BN_bn2bin (Ij, I + j); |
| 202 | } | 195 | } |
| 203 | } | 196 | } |
| 197 | |||
| 198 | err: | ||
| 199 | PKCS12err(PKCS12_F_PKCS12_KEY_GEN_UNI,ERR_R_MALLOC_FAILURE); | ||
| 200 | |||
| 201 | end: | ||
| 202 | OPENSSL_free (Ai); | ||
| 203 | OPENSSL_free (B); | ||
| 204 | OPENSSL_free (D); | ||
| 205 | OPENSSL_free (I); | ||
| 206 | BN_free (Ij); | ||
| 207 | BN_free (Bpl1); | ||
| 208 | EVP_MD_CTX_cleanup(&ctx); | ||
| 209 | return ret; | ||
| 204 | } | 210 | } |
| 205 | #ifdef DEBUG_KEYGEN | 211 | #ifdef DEBUG_KEYGEN |
| 206 | void h__dump (unsigned char *p, int len) | 212 | void h__dump (unsigned char *p, int len) |
diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c index 451de84489..3bf1a367bb 100644 --- a/src/lib/libcrypto/pkcs7/pk7_doit.c +++ b/src/lib/libcrypto/pkcs7/pk7_doit.c | |||
| @@ -422,7 +422,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
| 422 | X509_ALGOR *enc_alg=NULL; | 422 | X509_ALGOR *enc_alg=NULL; |
| 423 | STACK_OF(X509_ALGOR) *md_sk=NULL; | 423 | STACK_OF(X509_ALGOR) *md_sk=NULL; |
| 424 | STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL; | 424 | STACK_OF(PKCS7_RECIP_INFO) *rsk=NULL; |
| 425 | X509_ALGOR *xalg=NULL; | ||
| 426 | PKCS7_RECIP_INFO *ri=NULL; | 425 | PKCS7_RECIP_INFO *ri=NULL; |
| 427 | 426 | ||
| 428 | i=OBJ_obj2nid(p7->type); | 427 | i=OBJ_obj2nid(p7->type); |
| @@ -445,7 +444,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
| 445 | PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE); | 444 | PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE); |
| 446 | goto err; | 445 | goto err; |
| 447 | } | 446 | } |
| 448 | xalg=p7->d.signed_and_enveloped->enc_data->algorithm; | ||
| 449 | break; | 447 | break; |
| 450 | case NID_pkcs7_enveloped: | 448 | case NID_pkcs7_enveloped: |
| 451 | rsk=p7->d.enveloped->recipientinfo; | 449 | rsk=p7->d.enveloped->recipientinfo; |
| @@ -457,7 +455,6 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) | |||
| 457 | PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE); | 455 | PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CIPHER_TYPE); |
| 458 | goto err; | 456 | goto err; |
| 459 | } | 457 | } |
| 460 | xalg=p7->d.enveloped->enc_data->algorithm; | ||
| 461 | break; | 458 | break; |
| 462 | default: | 459 | default: |
| 463 | PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CONTENT_TYPE); | 460 | PKCS7err(PKCS7_F_PKCS7_DATADECODE,PKCS7_R_UNSUPPORTED_CONTENT_TYPE); |
diff --git a/src/lib/libcrypto/pkcs7/pk7_lib.c b/src/lib/libcrypto/pkcs7/pk7_lib.c index 3ca0952792..d411269b50 100644 --- a/src/lib/libcrypto/pkcs7/pk7_lib.c +++ b/src/lib/libcrypto/pkcs7/pk7_lib.c | |||
| @@ -591,7 +591,6 @@ X509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si) | |||
| 591 | int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher) | 591 | int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher) |
| 592 | { | 592 | { |
| 593 | int i; | 593 | int i; |
| 594 | ASN1_OBJECT *objtmp; | ||
| 595 | PKCS7_ENC_CONTENT *ec; | 594 | PKCS7_ENC_CONTENT *ec; |
| 596 | 595 | ||
| 597 | i=OBJ_obj2nid(p7->type); | 596 | i=OBJ_obj2nid(p7->type); |
| @@ -614,7 +613,6 @@ int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher) | |||
| 614 | PKCS7err(PKCS7_F_PKCS7_SET_CIPHER,PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER); | 613 | PKCS7err(PKCS7_F_PKCS7_SET_CIPHER,PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER); |
| 615 | return(0); | 614 | return(0); |
| 616 | } | 615 | } |
| 617 | objtmp = OBJ_nid2obj(i); | ||
| 618 | 616 | ||
| 619 | ec->cipher = cipher; | 617 | ec->cipher = cipher; |
| 620 | return 1; | 618 | return 1; |
diff --git a/src/lib/libcrypto/rand/md_rand.c b/src/lib/libcrypto/rand/md_rand.c index 88088ce73c..b2f04ff13e 100644 --- a/src/lib/libcrypto/rand/md_rand.c +++ b/src/lib/libcrypto/rand/md_rand.c | |||
| @@ -476,11 +476,14 @@ static int ssleay_rand_bytes(unsigned char *buf, int num) | |||
| 476 | MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c)); | 476 | MD_Update(&m,(unsigned char *)&(md_c[0]),sizeof(md_c)); |
| 477 | 477 | ||
| 478 | #ifndef PURIFY /* purify complains */ | 478 | #ifndef PURIFY /* purify complains */ |
| 479 | /* DO NOT REMOVE THE FOLLOWING CALL TO MD_Update()! */ | 479 | /* The following line uses the supplied buffer as a small |
| 480 | * source of entropy: since this buffer is often uninitialised | ||
| 481 | * it may cause programs such as purify or valgrind to | ||
| 482 | * complain. So for those builds it is not used: the removal | ||
| 483 | * of such a small source of entropy has negligible impact on | ||
| 484 | * security. | ||
| 485 | */ | ||
| 480 | MD_Update(&m,buf,j); | 486 | MD_Update(&m,buf,j); |
| 481 | /* We know that line may cause programs such as | ||
| 482 | purify and valgrind to complain about use of | ||
| 483 | uninitialized data. */ | ||
| 484 | #endif | 487 | #endif |
| 485 | 488 | ||
| 486 | k=(st_idx+MD_DIGEST_LENGTH/2)-st_num; | 489 | k=(st_idx+MD_DIGEST_LENGTH/2)-st_num; |
diff --git a/src/lib/libcrypto/rand/rand_vms.c b/src/lib/libcrypto/rand/rand_vms.c index 1267a3acae..0bfd8ff7e4 100644 --- a/src/lib/libcrypto/rand/rand_vms.c +++ b/src/lib/libcrypto/rand/rand_vms.c | |||
| @@ -69,6 +69,17 @@ | |||
| 69 | # pragma message disable DOLLARID | 69 | # pragma message disable DOLLARID |
| 70 | #endif | 70 | #endif |
| 71 | 71 | ||
| 72 | /* Use 32-bit pointers almost everywhere. Define the type to which to | ||
| 73 | * cast a pointer passed to an external function. | ||
| 74 | */ | ||
| 75 | #if __INITIAL_POINTER_SIZE == 64 | ||
| 76 | # define PTR_T __void_ptr64 | ||
| 77 | # pragma pointer_size save | ||
| 78 | # pragma pointer_size 32 | ||
| 79 | #else /* __INITIAL_POINTER_SIZE == 64 */ | ||
| 80 | # define PTR_T void * | ||
| 81 | #endif /* __INITIAL_POINTER_SIZE == 64 [else] */ | ||
| 82 | |||
| 72 | static struct items_data_st | 83 | static struct items_data_st |
| 73 | { | 84 | { |
| 74 | short length, code; /* length is amount of bytes */ | 85 | short length, code; /* length is amount of bytes */ |
| @@ -125,11 +136,12 @@ int RAND_poll(void) | |||
| 125 | { | 136 | { |
| 126 | if (status == SS$_NORMAL) | 137 | if (status == SS$_NORMAL) |
| 127 | { | 138 | { |
| 128 | RAND_add(data_buffer, total_length, total_length/2); | 139 | RAND_add( (PTR_T)data_buffer, total_length, |
| 140 | total_length/2); | ||
| 129 | } | 141 | } |
| 130 | } | 142 | } |
| 131 | sys$gettim(iosb); | 143 | sys$gettim(iosb); |
| 132 | RAND_add((unsigned char *)iosb, sizeof(iosb), sizeof(iosb)/2); | 144 | RAND_add( (PTR_T)iosb, sizeof(iosb), sizeof(iosb)/2); |
| 133 | return 1; | 145 | return 1; |
| 134 | } | 146 | } |
| 135 | 147 | ||
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index 4ed40b7b70..bc7d9c5804 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c | |||
| @@ -144,7 +144,9 @@ int RAND_load_file(const char *file, long bytes) | |||
| 144 | * I/O because we will waste system entropy. | 144 | * I/O because we will waste system entropy. |
| 145 | */ | 145 | */ |
| 146 | bytes = (bytes == -1) ? 2048 : bytes; /* ok, is 2048 enough? */ | 146 | bytes = (bytes == -1) ? 2048 : bytes; /* ok, is 2048 enough? */ |
| 147 | #ifndef OPENSSL_NO_SETVBUF_IONBF | ||
| 147 | setvbuf(in, NULL, _IONBF, 0); /* don't do buffered reads */ | 148 | setvbuf(in, NULL, _IONBF, 0); /* don't do buffered reads */ |
| 149 | #endif /* ndef OPENSSL_NO_SETVBUF_IONBF */ | ||
| 148 | } | 150 | } |
| 149 | #endif | 151 | #endif |
| 150 | for (;;) | 152 | for (;;) |
| @@ -269,7 +271,6 @@ err: | |||
| 269 | const char *RAND_file_name(char *buf, size_t size) | 271 | const char *RAND_file_name(char *buf, size_t size) |
| 270 | { | 272 | { |
| 271 | char *s=NULL; | 273 | char *s=NULL; |
| 272 | int ok = 0; | ||
| 273 | #ifdef __OpenBSD__ | 274 | #ifdef __OpenBSD__ |
| 274 | struct stat sb; | 275 | struct stat sb; |
| 275 | #endif | 276 | #endif |
| @@ -298,7 +299,6 @@ const char *RAND_file_name(char *buf, size_t size) | |||
| 298 | BUF_strlcat(buf,"/",size); | 299 | BUF_strlcat(buf,"/",size); |
| 299 | #endif | 300 | #endif |
| 300 | BUF_strlcat(buf,RFILE,size); | 301 | BUF_strlcat(buf,RFILE,size); |
| 301 | ok = 1; | ||
| 302 | } | 302 | } |
| 303 | else | 303 | else |
| 304 | buf[0] = '\0'; /* no file name */ | 304 | buf[0] = '\0'; /* no file name */ |
| @@ -312,7 +312,7 @@ const char *RAND_file_name(char *buf, size_t size) | |||
| 312 | * to something hopefully decent if that isn't available. | 312 | * to something hopefully decent if that isn't available. |
| 313 | */ | 313 | */ |
| 314 | 314 | ||
| 315 | if (!ok) | 315 | if (!buf[0]) |
| 316 | if (BUF_strlcpy(buf,"/dev/arandom",size) >= size) { | 316 | if (BUF_strlcpy(buf,"/dev/arandom",size) >= size) { |
| 317 | return(NULL); | 317 | return(NULL); |
| 318 | } | 318 | } |
diff --git a/src/lib/libcrypto/rsa/rsa_eay.c b/src/lib/libcrypto/rsa/rsa_eay.c index c5eaeeae6b..7c941885f0 100644 --- a/src/lib/libcrypto/rsa/rsa_eay.c +++ b/src/lib/libcrypto/rsa/rsa_eay.c | |||
| @@ -675,7 +675,7 @@ static int RSA_eay_public_decrypt(int flen, const unsigned char *from, | |||
| 675 | rsa->_method_mod_n)) goto err; | 675 | rsa->_method_mod_n)) goto err; |
| 676 | 676 | ||
| 677 | if ((padding == RSA_X931_PADDING) && ((ret->d[0] & 0xf) != 12)) | 677 | if ((padding == RSA_X931_PADDING) && ((ret->d[0] & 0xf) != 12)) |
| 678 | BN_sub(ret, rsa->n, ret); | 678 | if (!BN_sub(ret, rsa->n, ret)) goto err; |
| 679 | 679 | ||
| 680 | p=buf; | 680 | p=buf; |
| 681 | i=BN_bn2bin(ret,p); | 681 | i=BN_bn2bin(ret,p); |
diff --git a/src/lib/libcrypto/rsa/rsa_oaep.c b/src/lib/libcrypto/rsa/rsa_oaep.c index e238d10e5c..18d307ea9e 100644 --- a/src/lib/libcrypto/rsa/rsa_oaep.c +++ b/src/lib/libcrypto/rsa/rsa_oaep.c | |||
| @@ -189,34 +189,40 @@ int PKCS1_MGF1(unsigned char *mask, long len, | |||
| 189 | EVP_MD_CTX c; | 189 | EVP_MD_CTX c; |
| 190 | unsigned char md[EVP_MAX_MD_SIZE]; | 190 | unsigned char md[EVP_MAX_MD_SIZE]; |
| 191 | int mdlen; | 191 | int mdlen; |
| 192 | int rv = -1; | ||
| 192 | 193 | ||
| 193 | EVP_MD_CTX_init(&c); | 194 | EVP_MD_CTX_init(&c); |
| 194 | mdlen = EVP_MD_size(dgst); | 195 | mdlen = EVP_MD_size(dgst); |
| 195 | if (mdlen < 0) | 196 | if (mdlen < 0) |
| 196 | return -1; | 197 | goto err; |
| 197 | for (i = 0; outlen < len; i++) | 198 | for (i = 0; outlen < len; i++) |
| 198 | { | 199 | { |
| 199 | cnt[0] = (unsigned char)((i >> 24) & 255); | 200 | cnt[0] = (unsigned char)((i >> 24) & 255); |
| 200 | cnt[1] = (unsigned char)((i >> 16) & 255); | 201 | cnt[1] = (unsigned char)((i >> 16) & 255); |
| 201 | cnt[2] = (unsigned char)((i >> 8)) & 255; | 202 | cnt[2] = (unsigned char)((i >> 8)) & 255; |
| 202 | cnt[3] = (unsigned char)(i & 255); | 203 | cnt[3] = (unsigned char)(i & 255); |
| 203 | EVP_DigestInit_ex(&c,dgst, NULL); | 204 | if (!EVP_DigestInit_ex(&c,dgst, NULL) |
| 204 | EVP_DigestUpdate(&c, seed, seedlen); | 205 | || !EVP_DigestUpdate(&c, seed, seedlen) |
| 205 | EVP_DigestUpdate(&c, cnt, 4); | 206 | || !EVP_DigestUpdate(&c, cnt, 4)) |
| 207 | goto err; | ||
| 206 | if (outlen + mdlen <= len) | 208 | if (outlen + mdlen <= len) |
| 207 | { | 209 | { |
| 208 | EVP_DigestFinal_ex(&c, mask + outlen, NULL); | 210 | if (!EVP_DigestFinal_ex(&c, mask + outlen, NULL)) |
| 211 | goto err; | ||
| 209 | outlen += mdlen; | 212 | outlen += mdlen; |
| 210 | } | 213 | } |
| 211 | else | 214 | else |
| 212 | { | 215 | { |
| 213 | EVP_DigestFinal_ex(&c, md, NULL); | 216 | if (!EVP_DigestFinal_ex(&c, md, NULL)) |
| 217 | goto err; | ||
| 214 | memcpy(mask + outlen, md, len - outlen); | 218 | memcpy(mask + outlen, md, len - outlen); |
| 215 | outlen = len; | 219 | outlen = len; |
| 216 | } | 220 | } |
| 217 | } | 221 | } |
| 222 | rv = 0; | ||
| 223 | err: | ||
| 218 | EVP_MD_CTX_cleanup(&c); | 224 | EVP_MD_CTX_cleanup(&c); |
| 219 | return 0; | 225 | return rv; |
| 220 | } | 226 | } |
| 221 | 227 | ||
| 222 | static int MGF1(unsigned char *mask, long len, const unsigned char *seed, | 228 | static int MGF1(unsigned char *mask, long len, const unsigned char *seed, |
diff --git a/src/lib/libcrypto/stack/safestack.h b/src/lib/libcrypto/stack/safestack.h index 891cb84a51..3e76aa58f5 100644 --- a/src/lib/libcrypto/stack/safestack.h +++ b/src/lib/libcrypto/stack/safestack.h | |||
| @@ -179,7 +179,8 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
| 179 | sk_is_sorted(CHECKED_STACK_OF(type, st)) | 179 | sk_is_sorted(CHECKED_STACK_OF(type, st)) |
| 180 | 180 | ||
| 181 | #define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 181 | #define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
| 182 | (STACK_OF(type) *)d2i_ASN1_SET((STACK_OF(OPENSSL_BLOCK) **)CHECKED_STACK_OF(type, st), \ | 182 | (STACK_OF(type) *)d2i_ASN1_SET( \ |
| 183 | (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \ | ||
| 183 | pp, length, \ | 184 | pp, length, \ |
| 184 | CHECKED_D2I_OF(type, d2i_func), \ | 185 | CHECKED_D2I_OF(type, d2i_func), \ |
| 185 | CHECKED_SK_FREE_FUNC(type, free_func), \ | 186 | CHECKED_SK_FREE_FUNC(type, free_func), \ |
| @@ -2030,79 +2031,79 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void) | |||
| 2030 | #define sk_void_sort(st) SKM_sk_sort(void, (st)) | 2031 | #define sk_void_sort(st) SKM_sk_sort(void, (st)) |
| 2031 | #define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st)) | 2032 | #define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st)) |
| 2032 | 2033 | ||
| 2033 | #define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) | 2034 | #define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) |
| 2034 | #define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) | 2035 | #define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null()) |
| 2035 | #define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val)) | 2036 | #define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) |
| 2036 | #define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val)) | 2037 | #define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) |
| 2037 | #define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), i)) | 2038 | #define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_STACK_OF(OPENSSL_STRING, st), i)) |
| 2038 | #define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st) | 2039 | #define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st) |
| 2039 | #define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_SK_FREE_FUNC2(OPENSSL_BLOCK, free_func)) | 2040 | #define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_STRING, free_func)) |
| 2040 | #define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val), i) | 2041 | #define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val), i) |
| 2041 | #define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st) | 2042 | #define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st) |
| 2042 | #define sk_OPENSSL_BLOCK_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), i, CHECKED_PTR_OF(void, val)) | 2043 | #define sk_OPENSSL_STRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_STRING, st), i, CHECKED_PTR_OF(char, val)) |
| 2043 | #define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st)) | 2044 | #define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st)) |
| 2044 | #define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, val)) | 2045 | #define sk_OPENSSL_STRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val)) |
| 2045 | #define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val)) | 2046 | #define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val)) |
| 2046 | #define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i)) | 2047 | #define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i)) |
| 2047 | #define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_PTR_OF(void, ptr)) | 2048 | #define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, ptr)) |
| 2048 | #define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp) \ | 2049 | #define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \ |
| 2049 | ((int (*)(const void * const *,const void * const *)) \ | 2050 | ((int (*)(const char * const *,const char * const *)) \ |
| 2050 | sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_SK_CMP_FUNC(void, cmp))) | 2051 | sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_CMP_FUNC(char, cmp))) |
| 2051 | #define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st) | 2052 | #define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st) |
| 2052 | #define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st)) | 2053 | #define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st)) |
| 2053 | #define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_BLOCK), st)) | 2054 | #define sk_OPENSSL_STRING_pop(st) (char *)sk_pop(CHECKED_STACK_OF(OPENSSL_STRING, st)) |
| 2054 | #define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st)) | 2055 | #define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st)) |
| 2055 | #define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) | 2056 | #define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) |
| 2056 | 2057 | ||
| 2057 | 2058 | ||
| 2058 | #define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) | 2059 | #define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) |
| 2059 | #define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) | 2060 | #define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null()) |
| 2060 | #define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | 2061 | #define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) |
| 2061 | #define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | 2062 | #define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) |
| 2062 | #define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), i)) | 2063 | #define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i)) |
| 2063 | #define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) | 2064 | #define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st) |
| 2064 | #define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func)) | 2065 | #define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC2(OPENSSL_PSTRING, free_func)) |
| 2065 | #define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) | 2066 | #define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i) |
| 2066 | #define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) | 2067 | #define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st) |
| 2067 | #define sk_OPENSSL_PSTRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) | 2068 | #define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val)) |
| 2068 | #define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) | 2069 | #define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st)) |
| 2069 | #define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, val)) | 2070 | #define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val)) |
| 2070 | #define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) | 2071 | #define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val)) |
| 2071 | #define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) | 2072 | #define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i)) |
| 2072 | #define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) | 2073 | #define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr)) |
| 2073 | #define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ | 2074 | #define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp) \ |
| 2074 | ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ | 2075 | ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \ |
| 2075 | sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) | 2076 | sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp))) |
| 2076 | #define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) | 2077 | #define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st) |
| 2077 | #define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) | 2078 | #define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st)) |
| 2078 | #define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_PSTRING), st)) | 2079 | #define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st)) |
| 2079 | #define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) | 2080 | #define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st)) |
| 2080 | #define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) | 2081 | #define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st)) |
| 2081 | 2082 | ||
| 2082 | 2083 | ||
| 2083 | #define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp))) | 2084 | #define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp))) |
| 2084 | #define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null()) | 2085 | #define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null()) |
| 2085 | #define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) | 2086 | #define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) |
| 2086 | #define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) | 2087 | #define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) |
| 2087 | #define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i)) | 2088 | #define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i)) |
| 2088 | #define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st) | 2089 | #define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st) |
| 2089 | #define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_FREE_FUNC2(OPENSSL_STRING, free_func)) | 2090 | #define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_FREE_FUNC2(OPENSSL_BLOCK, free_func)) |
| 2090 | #define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val), i) | 2091 | #define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val), i) |
| 2091 | #define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st) | 2092 | #define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st) |
| 2092 | #define sk_OPENSSL_STRING_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), i, CHECKED_PTR_OF(char, val)) | 2093 | #define sk_OPENSSL_BLOCK_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i, CHECKED_PTR_OF(void, val)) |
| 2093 | #define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st)) | 2094 | #define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st)) |
| 2094 | #define sk_OPENSSL_STRING_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, val)) | 2095 | #define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val)) |
| 2095 | #define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val)) | 2096 | #define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val)) |
| 2096 | #define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i)) | 2097 | #define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i)) |
| 2097 | #define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_PTR_OF(char, ptr)) | 2098 | #define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, ptr)) |
| 2098 | #define sk_OPENSSL_STRING_set_cmp_func(st, cmp) \ | 2099 | #define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp) \ |
| 2099 | ((int (*)(const char * const *,const char * const *)) \ | 2100 | ((int (*)(const void * const *,const void * const *)) \ |
| 2100 | sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_SK_CMP_FUNC(char, cmp))) | 2101 | sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_CMP_FUNC(void, cmp))) |
| 2101 | #define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st) | 2102 | #define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st) |
| 2102 | #define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st)) | 2103 | #define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st)) |
| 2103 | #define sk_OPENSSL_STRING_pop(st) (char *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF(OPENSSL_STRING), st)) | 2104 | #define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop(CHECKED_STACK_OF(OPENSSL_BLOCK, st)) |
| 2104 | #define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st)) | 2105 | #define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st)) |
| 2105 | #define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st)) | 2106 | #define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st)) |
| 2106 | 2107 | ||
| 2107 | 2108 | ||
| 2108 | #define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ | 2109 | #define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ |
diff --git a/src/lib/libcrypto/util/cygwin.sh b/src/lib/libcrypto/util/cygwin.sh index a4f2e740b4..d6228521e6 100644 --- a/src/lib/libcrypto/util/cygwin.sh +++ b/src/lib/libcrypto/util/cygwin.sh | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #set -x | 8 | #set -x |
| 9 | 9 | ||
| 10 | CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5" | 10 | CONFIG_OPTIONS="--prefix=/usr shared zlib no-idea no-rc5" |
| 11 | INSTALL_PREFIX=/tmp/install | 11 | INSTALL_PREFIX=/tmp/install/INSTALL |
| 12 | 12 | ||
| 13 | VERSION= | 13 | VERSION= |
| 14 | SUBVERSION=$1 | 14 | SUBVERSION=$1 |
| @@ -124,8 +124,12 @@ strip usr/bin/*.exe usr/bin/*.dll usr/lib/engines/*.so | |||
| 124 | chmod u-w usr/lib/engines/*.so | 124 | chmod u-w usr/lib/engines/*.so |
| 125 | 125 | ||
| 126 | # Runtime package | 126 | # Runtime package |
| 127 | find etc usr/bin usr/lib/engines usr/share/doc usr/ssl/certs \ | 127 | tar cjf libopenssl${VERSION//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 \ |
| 128 | usr/ssl/man/man[157] usr/ssl/misc usr/ssl/openssl.cnf usr/ssl/private \ | 128 | usr/bin/cyg*dll |
| 129 | # Base package | ||
| 130 | find etc usr/bin/openssl.exe usr/bin/c_rehash usr/lib/engines usr/share/doc \ | ||
| 131 | usr/ssl/certs usr/ssl/man/man[157] usr/ssl/misc usr/ssl/openssl.cnf \ | ||
| 132 | usr/ssl/private \ | ||
| 129 | -empty -o \! -type d | | 133 | -empty -o \! -type d | |
| 130 | tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 - | 134 | tar cjfT openssl-${VERSION}-${SUBVERSION}.tar.bz2 - |
| 131 | # Development package | 135 | # Development package |
| @@ -135,6 +139,7 @@ tar cjfT openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 - | |||
| 135 | 139 | ||
| 136 | ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2 | 140 | ls -l openssl-${VERSION}-${SUBVERSION}.tar.bz2 |
| 137 | ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 | 141 | ls -l openssl-devel-${VERSION}-${SUBVERSION}.tar.bz2 |
| 142 | ls -l libopenssl${VERSION//[!0-9]/}-${VERSION}-${SUBVERSION}.tar.bz2 | ||
| 138 | 143 | ||
| 139 | cleanup | 144 | cleanup |
| 140 | 145 | ||
diff --git a/src/lib/libcrypto/util/libeay.num b/src/lib/libcrypto/util/libeay.num index c68047e955..1467ab6243 100644 --- a/src/lib/libcrypto/util/libeay.num +++ b/src/lib/libcrypto/util/libeay.num | |||
| @@ -4178,4 +4178,20 @@ UI_method_get_prompt_constructr 4550 EXIST:VMS:FUNCTION: | |||
| 4178 | UI_method_set_prompt_constructor 4551 EXIST:!VMS:FUNCTION: | 4178 | UI_method_set_prompt_constructor 4551 EXIST:!VMS:FUNCTION: |
| 4179 | UI_method_set_prompt_constructr 4551 EXIST:VMS:FUNCTION: | 4179 | UI_method_set_prompt_constructr 4551 EXIST:VMS:FUNCTION: |
| 4180 | EVP_read_pw_string_min 4552 EXIST::FUNCTION: | 4180 | EVP_read_pw_string_min 4552 EXIST::FUNCTION: |
| 4181 | ENGINE_load_aesni 4553 EXIST::FUNCTION:ENGINE | 4181 | CRYPTO_cts128_encrypt 4553 EXIST::FUNCTION: |
| 4182 | CRYPTO_cts128_decrypt_block 4554 EXIST::FUNCTION: | ||
| 4183 | CRYPTO_cfb128_1_encrypt 4555 EXIST::FUNCTION: | ||
| 4184 | CRYPTO_cbc128_encrypt 4556 EXIST::FUNCTION: | ||
| 4185 | CRYPTO_ctr128_encrypt 4557 EXIST::FUNCTION: | ||
| 4186 | CRYPTO_ofb128_encrypt 4558 EXIST::FUNCTION: | ||
| 4187 | CRYPTO_cts128_decrypt 4559 EXIST::FUNCTION: | ||
| 4188 | CRYPTO_cts128_encrypt_block 4560 EXIST::FUNCTION: | ||
| 4189 | CRYPTO_cbc128_decrypt 4561 EXIST::FUNCTION: | ||
| 4190 | CRYPTO_cfb128_encrypt 4562 EXIST::FUNCTION: | ||
| 4191 | CRYPTO_cfb128_8_encrypt 4563 EXIST::FUNCTION: | ||
| 4192 | OPENSSL_strcasecmp 4564 EXIST::FUNCTION: | ||
| 4193 | OPENSSL_memcmp 4565 EXIST::FUNCTION: | ||
| 4194 | OPENSSL_strncasecmp 4566 EXIST::FUNCTION: | ||
| 4195 | OPENSSL_gmtime 4567 EXIST::FUNCTION: | ||
| 4196 | OPENSSL_gmtime_adj 4568 EXIST::FUNCTION: | ||
| 4197 | ENGINE_load_aesni 4569 EXIST::FUNCTION:ENGINE | ||
diff --git a/src/lib/libcrypto/util/mk1mf.pl b/src/lib/libcrypto/util/mk1mf.pl index 780029a03f..1dcef2b8a2 100644 --- a/src/lib/libcrypto/util/mk1mf.pl +++ b/src/lib/libcrypto/util/mk1mf.pl | |||
| @@ -13,6 +13,7 @@ $banner="\t\@echo Building OpenSSL"; | |||
| 13 | 13 | ||
| 14 | my $no_static_engine = 1; | 14 | my $no_static_engine = 1; |
| 15 | my $engines = ""; | 15 | my $engines = ""; |
| 16 | my $otherlibs = ""; | ||
| 16 | local $zlib_opt = 0; # 0 = no zlib, 1 = static, 2 = dynamic | 17 | local $zlib_opt = 0; # 0 = no zlib, 1 = static, 2 = dynamic |
| 17 | local $zlib_lib = ""; | 18 | local $zlib_lib = ""; |
| 18 | local $perl_asm = 0; # 1 to autobuild asm files from perl scripts | 19 | local $perl_asm = 0; # 1 to autobuild asm files from perl scripts |
| @@ -266,6 +267,7 @@ $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; | |||
| 266 | $cflags.=" -DOPENSSL_NO_EC" if $no_ec; | 267 | $cflags.=" -DOPENSSL_NO_EC" if $no_ec; |
| 267 | $cflags.=" -DOPENSSL_NO_ECDSA" if $no_ecdsa; | 268 | $cflags.=" -DOPENSSL_NO_ECDSA" if $no_ecdsa; |
| 268 | $cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh; | 269 | $cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh; |
| 270 | $cflags.=" -DOPENSSL_NO_GOST" if $no_gost; | ||
| 269 | $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine; | 271 | $cflags.=" -DOPENSSL_NO_ENGINE" if $no_engine; |
| 270 | $cflags.=" -DOPENSSL_NO_HW" if $no_hw; | 272 | $cflags.=" -DOPENSSL_NO_HW" if $no_hw; |
| 271 | $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; | 273 | $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; |
| @@ -356,6 +358,12 @@ for (;;) | |||
| 356 | $lib=$val; | 358 | $lib=$val; |
| 357 | $lib =~ s/^.*\/([^\/]+)$/$1/; | 359 | $lib =~ s/^.*\/([^\/]+)$/$1/; |
| 358 | } | 360 | } |
| 361 | if ($key eq "LIBNAME" && $no_static_engine) | ||
| 362 | { | ||
| 363 | $lib=$val; | ||
| 364 | $lib =~ s/^.*\/([^\/]+)$/$1/; | ||
| 365 | $otherlibs .= " $lib"; | ||
| 366 | } | ||
| 359 | 367 | ||
| 360 | if ($key eq "EXHEADER") | 368 | if ($key eq "EXHEADER") |
| 361 | { $exheader.=&var_add($dir,$val, 1); } | 369 | { $exheader.=&var_add($dir,$val, 1); } |
| @@ -658,7 +666,7 @@ foreach (split(/\s+/,$test)) | |||
| 658 | $rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); | 666 | $rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); |
| 659 | } | 667 | } |
| 660 | 668 | ||
| 661 | $defs.=&do_defs("E_SHLIB",$engines,"\$(ENG_D)",$shlibp); | 669 | $defs.=&do_defs("E_SHLIB",$engines . $otherlibs,"\$(ENG_D)",$shlibp); |
| 662 | 670 | ||
| 663 | foreach (split(/\s+/,$engines)) | 671 | foreach (split(/\s+/,$engines)) |
| 664 | { | 672 | { |
| @@ -671,6 +679,14 @@ foreach (split(/\s+/,$engines)) | |||
| 671 | $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); | 679 | $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); |
| 672 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)"); | 680 | $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)"); |
| 673 | 681 | ||
| 682 | foreach (split(" ",$otherlibs)) | ||
| 683 | { | ||
| 684 | my $uc = $_; | ||
| 685 | $uc =~ tr /a-z/A-Z/; | ||
| 686 | $rules.= &do_lib_rule("\$(${uc}OBJ)","\$(ENG_D)$o$_$shlibp", "", $shlib, ""); | ||
| 687 | |||
| 688 | } | ||
| 689 | |||
| 674 | $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); | 690 | $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); |
| 675 | 691 | ||
| 676 | print $defs; | 692 | print $defs; |
| @@ -708,6 +724,7 @@ sub var_add | |||
| 708 | return("") if $no_dsa && $dir =~ /\/dsa/; | 724 | return("") if $no_dsa && $dir =~ /\/dsa/; |
| 709 | return("") if $no_dh && $dir =~ /\/dh/; | 725 | return("") if $no_dh && $dir =~ /\/dh/; |
| 710 | return("") if $no_ec && $dir =~ /\/ec/; | 726 | return("") if $no_ec && $dir =~ /\/ec/; |
| 727 | return("") if $no_gost && $dir =~ /\/ccgost/; | ||
| 711 | return("") if $no_cms && $dir =~ /\/cms/; | 728 | return("") if $no_cms && $dir =~ /\/cms/; |
| 712 | return("") if $no_jpake && $dir =~ /\/jpake/; | 729 | return("") if $no_jpake && $dir =~ /\/jpake/; |
| 713 | if ($no_des && $dir =~ /\/des/) | 730 | if ($no_des && $dir =~ /\/des/) |
| @@ -1047,6 +1064,7 @@ sub read_options | |||
| 1047 | "no-ec" => \$no_ec, | 1064 | "no-ec" => \$no_ec, |
| 1048 | "no-ecdsa" => \$no_ecdsa, | 1065 | "no-ecdsa" => \$no_ecdsa, |
| 1049 | "no-ecdh" => \$no_ecdh, | 1066 | "no-ecdh" => \$no_ecdh, |
| 1067 | "no-gost" => \$no_gost, | ||
| 1050 | "no-engine" => \$no_engine, | 1068 | "no-engine" => \$no_engine, |
| 1051 | "no-hw" => \$no_hw, | 1069 | "no-hw" => \$no_hw, |
| 1052 | "just-ssl" => | 1070 | "just-ssl" => |
diff --git a/src/lib/libcrypto/util/mkdef.pl b/src/lib/libcrypto/util/mkdef.pl index a4a17e3ae9..ab47329097 100644 --- a/src/lib/libcrypto/util/mkdef.pl +++ b/src/lib/libcrypto/util/mkdef.pl | |||
| @@ -257,6 +257,8 @@ $ssl.=" ssl/tls1.h"; | |||
| 257 | 257 | ||
| 258 | my $crypto ="crypto/crypto.h"; | 258 | my $crypto ="crypto/crypto.h"; |
| 259 | $crypto.=" crypto/o_dir.h"; | 259 | $crypto.=" crypto/o_dir.h"; |
| 260 | $crypto.=" crypto/o_str.h"; | ||
| 261 | $crypto.=" crypto/o_time.h"; | ||
| 260 | $crypto.=" crypto/des/des.h crypto/des/des_old.h" ; # unless $no_des; | 262 | $crypto.=" crypto/des/des.h crypto/des/des_old.h" ; # unless $no_des; |
| 261 | $crypto.=" crypto/idea/idea.h" ; # unless $no_idea; | 263 | $crypto.=" crypto/idea/idea.h" ; # unless $no_idea; |
| 262 | $crypto.=" crypto/rc4/rc4.h" ; # unless $no_rc4; | 264 | $crypto.=" crypto/rc4/rc4.h" ; # unless $no_rc4; |
| @@ -316,6 +318,7 @@ $crypto.=" crypto/krb5/krb5_asn.h"; | |||
| 316 | $crypto.=" crypto/pqueue/pqueue.h"; | 318 | $crypto.=" crypto/pqueue/pqueue.h"; |
| 317 | $crypto.=" crypto/cms/cms.h"; | 319 | $crypto.=" crypto/cms/cms.h"; |
| 318 | $crypto.=" crypto/jpake/jpake.h"; | 320 | $crypto.=" crypto/jpake/jpake.h"; |
| 321 | $crypto.=" crypto/modes/modes.h"; | ||
| 319 | 322 | ||
| 320 | my $symhacks="crypto/symhacks.h"; | 323 | my $symhacks="crypto/symhacks.h"; |
| 321 | 324 | ||
diff --git a/src/lib/libcrypto/util/mkerr.pl b/src/lib/libcrypto/util/mkerr.pl index 15b774f277..2c99467d34 100644 --- a/src/lib/libcrypto/util/mkerr.pl +++ b/src/lib/libcrypto/util/mkerr.pl | |||
| @@ -391,7 +391,7 @@ foreach $lib (keys %csrc) | |||
| 391 | } else { | 391 | } else { |
| 392 | push @out, | 392 | push @out, |
| 393 | "/* ====================================================================\n", | 393 | "/* ====================================================================\n", |
| 394 | " * Copyright (c) 2001-2010 The OpenSSL Project. All rights reserved.\n", | 394 | " * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved.\n", |
| 395 | " *\n", | 395 | " *\n", |
| 396 | " * Redistribution and use in source and binary forms, with or without\n", | 396 | " * Redistribution and use in source and binary forms, with or without\n", |
| 397 | " * modification, are permitted provided that the following conditions\n", | 397 | " * modification, are permitted provided that the following conditions\n", |
| @@ -576,7 +576,7 @@ EOF | |||
| 576 | print OUT <<"EOF"; | 576 | print OUT <<"EOF"; |
| 577 | /* $cfile */ | 577 | /* $cfile */ |
| 578 | /* ==================================================================== | 578 | /* ==================================================================== |
| 579 | * Copyright (c) 1999-2010 The OpenSSL Project. All rights reserved. | 579 | * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. |
| 580 | * | 580 | * |
| 581 | * Redistribution and use in source and binary forms, with or without | 581 | * Redistribution and use in source and binary forms, with or without |
| 582 | * modification, are permitted provided that the following conditions | 582 | * modification, are permitted provided that the following conditions |
diff --git a/src/lib/libcrypto/util/mkstack.pl b/src/lib/libcrypto/util/mkstack.pl index 6a43757c95..f708610a78 100644 --- a/src/lib/libcrypto/util/mkstack.pl +++ b/src/lib/libcrypto/util/mkstack.pl | |||
| @@ -104,25 +104,25 @@ EOF | |||
| 104 | 104 | ||
| 105 | #define sk_${t1}_new(cmp) ((STACK_OF($t1) *)sk_new(CHECKED_SK_CMP_FUNC($t2, cmp))) | 105 | #define sk_${t1}_new(cmp) ((STACK_OF($t1) *)sk_new(CHECKED_SK_CMP_FUNC($t2, cmp))) |
| 106 | #define sk_${t1}_new_null() ((STACK_OF($t1) *)sk_new_null()) | 106 | #define sk_${t1}_new_null() ((STACK_OF($t1) *)sk_new_null()) |
| 107 | #define sk_${t1}_push(st, val) sk_push(CHECKED_PTR_OF(STACK_OF($t1), st), CHECKED_PTR_OF($t2, val)) | 107 | #define sk_${t1}_push(st, val) sk_push(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val)) |
| 108 | #define sk_${t1}_find(st, val) sk_find(CHECKED_PTR_OF(STACK_OF($t1), st), CHECKED_PTR_OF($t2, val)) | 108 | #define sk_${t1}_find(st, val) sk_find(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val)) |
| 109 | #define sk_${t1}_value(st, i) (($t1)sk_value(CHECKED_PTR_OF(STACK_OF($t1), st), i)) | 109 | #define sk_${t1}_value(st, i) (($t1)sk_value(CHECKED_STACK_OF($t1, st), i)) |
| 110 | #define sk_${t1}_num(st) SKM_sk_num($t1, st) | 110 | #define sk_${t1}_num(st) SKM_sk_num($t1, st) |
| 111 | #define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_PTR_OF(STACK_OF($t1), st), CHECKED_SK_FREE_FUNC2($t1, free_func)) | 111 | #define sk_${t1}_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF($t1, st), CHECKED_SK_FREE_FUNC2($t1, free_func)) |
| 112 | #define sk_${t1}_insert(st, val, i) sk_insert(CHECKED_PTR_OF(STACK_OF($t1), st), CHECKED_PTR_OF($t2, val), i) | 112 | #define sk_${t1}_insert(st, val, i) sk_insert(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val), i) |
| 113 | #define sk_${t1}_free(st) SKM_sk_free(${t1}, st) | 113 | #define sk_${t1}_free(st) SKM_sk_free(${t1}, st) |
| 114 | #define sk_${t1}_set(st, i, val) sk_set((_STACK *)CHECKED_PTR_OF(STACK_OF($t1), st), i, CHECKED_PTR_OF($t2, val)) | 114 | #define sk_${t1}_set(st, i, val) sk_set(CHECKED_STACK_OF($t1, st), i, CHECKED_PTR_OF($t2, val)) |
| 115 | #define sk_${t1}_zero(st) SKM_sk_zero($t1, (st)) | 115 | #define sk_${t1}_zero(st) SKM_sk_zero($t1, (st)) |
| 116 | #define sk_${t1}_unshift(st, val) sk_unshift((_STACK *)CHECKED_PTR_OF(STACK_OF($t1), st), CHECKED_PTR_OF($t2, val)) | 116 | #define sk_${t1}_unshift(st, val) sk_unshift(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, val)) |
| 117 | #define sk_${t1}_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF($t1), st), CHECKED_CONST_PTR_OF($t2, val)) | 117 | #define sk_${t1}_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF($t1), st), CHECKED_CONST_PTR_OF($t2, val)) |
| 118 | #define sk_${t1}_delete(st, i) SKM_sk_delete($t1, (st), (i)) | 118 | #define sk_${t1}_delete(st, i) SKM_sk_delete($t1, (st), (i)) |
| 119 | #define sk_${t1}_delete_ptr(st, ptr) ($t1 *)sk_delete_ptr((_STACK *)CHECKED_PTR_OF(STACK_OF($t1), st), CHECKED_PTR_OF($t2, ptr)) | 119 | #define sk_${t1}_delete_ptr(st, ptr) ($t1 *)sk_delete_ptr(CHECKED_STACK_OF($t1, st), CHECKED_PTR_OF($t2, ptr)) |
| 120 | #define sk_${t1}_set_cmp_func(st, cmp) \\ | 120 | #define sk_${t1}_set_cmp_func(st, cmp) \\ |
| 121 | ((int (*)(const $t2 * const *,const $t2 * const *)) \\ | 121 | ((int (*)(const $t2 * const *,const $t2 * const *)) \\ |
| 122 | sk_set_cmp_func((_STACK *)CHECKED_PTR_OF(STACK_OF($t1), st), CHECKED_SK_CMP_FUNC($t2, cmp))) | 122 | sk_set_cmp_func(CHECKED_STACK_OF($t1, st), CHECKED_SK_CMP_FUNC($t2, cmp))) |
| 123 | #define sk_${t1}_dup(st) SKM_sk_dup($t1, st) | 123 | #define sk_${t1}_dup(st) SKM_sk_dup($t1, st) |
| 124 | #define sk_${t1}_shift(st) SKM_sk_shift($t1, (st)) | 124 | #define sk_${t1}_shift(st) SKM_sk_shift($t1, (st)) |
| 125 | #define sk_${t1}_pop(st) ($t2 *)sk_pop((_STACK *)CHECKED_PTR_OF(STACK_OF($t1), st)) | 125 | #define sk_${t1}_pop(st) ($t2 *)sk_pop(CHECKED_STACK_OF($t1, st)) |
| 126 | #define sk_${t1}_sort(st) SKM_sk_sort($t1, (st)) | 126 | #define sk_${t1}_sort(st) SKM_sk_sort($t1, (st)) |
| 127 | #define sk_${t1}_is_sorted(st) SKM_sk_is_sorted($t1, (st)) | 127 | #define sk_${t1}_is_sorted(st) SKM_sk_is_sorted($t1, (st)) |
| 128 | 128 | ||
diff --git a/src/lib/libcrypto/util/pl/VC-32.pl b/src/lib/libcrypto/util/pl/VC-32.pl index c3e29fda96..5f25fc41bf 100644 --- a/src/lib/libcrypto/util/pl/VC-32.pl +++ b/src/lib/libcrypto/util/pl/VC-32.pl | |||
| @@ -138,8 +138,8 @@ else | |||
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | # generate symbols.pdb unconditionally | 140 | # generate symbols.pdb unconditionally |
| 141 | $app_cflag.=" /Zi /Fd$tmp_def/app"; | 141 | $app_cflag.=" /Zi /Fd\$(TMP_D)/app"; |
| 142 | $lib_cflag.=" /Zi /Fd$tmp_def/lib"; | 142 | $lib_cflag.=" /Zi /Fd\$(TMP_D)/lib"; |
| 143 | $lflags.=" /debug"; | 143 | $lflags.=" /debug"; |
| 144 | 144 | ||
| 145 | $obj='.obj'; | 145 | $obj='.obj'; |
| @@ -195,7 +195,7 @@ if ($FLAVOR =~ /WIN64A/) { | |||
| 195 | my $ver=`nasm -v 2>NUL`; | 195 | my $ver=`nasm -v 2>NUL`; |
| 196 | my $vew=`nasmw -v 2>NUL`; | 196 | my $vew=`nasmw -v 2>NUL`; |
| 197 | # pick newest version | 197 | # pick newest version |
| 198 | $asm=($ver gt $vew?"nasm":"nasmw")." -f win32"; | 198 | $asm=($ver ge $vew?"nasm":"nasmw")." -f win32"; |
| 199 | $asmtype="win32n"; | 199 | $asmtype="win32n"; |
| 200 | $afile='-o '; | 200 | $afile='-o '; |
| 201 | } else { | 201 | } else { |
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h index 604f4fb27f..e6f8a40395 100644 --- a/src/lib/libcrypto/x509/x509.h +++ b/src/lib/libcrypto/x509/x509.h | |||
| @@ -258,6 +258,7 @@ typedef struct x509_cinf_st | |||
| 258 | ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ | 258 | ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ |
| 259 | ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ | 259 | ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ |
| 260 | STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ | 260 | STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ |
| 261 | ASN1_ENCODING enc; | ||
| 261 | } X509_CINF; | 262 | } X509_CINF; |
| 262 | 263 | ||
| 263 | /* This stuff is certificate "auxiliary info" | 264 | /* This stuff is certificate "auxiliary info" |
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index 87ebf62525..5a0b0249b4 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
| @@ -703,6 +703,7 @@ static int check_cert(X509_STORE_CTX *ctx) | |||
| 703 | x = sk_X509_value(ctx->chain, cnum); | 703 | x = sk_X509_value(ctx->chain, cnum); |
| 704 | ctx->current_cert = x; | 704 | ctx->current_cert = x; |
| 705 | ctx->current_issuer = NULL; | 705 | ctx->current_issuer = NULL; |
| 706 | ctx->current_crl_score = 0; | ||
| 706 | ctx->current_reasons = 0; | 707 | ctx->current_reasons = 0; |
| 707 | while (ctx->current_reasons != CRLDP_ALL_REASONS) | 708 | while (ctx->current_reasons != CRLDP_ALL_REASONS) |
| 708 | { | 709 | { |
| @@ -2015,6 +2016,9 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, | |||
| 2015 | ctx->error_depth=0; | 2016 | ctx->error_depth=0; |
| 2016 | ctx->current_cert=NULL; | 2017 | ctx->current_cert=NULL; |
| 2017 | ctx->current_issuer=NULL; | 2018 | ctx->current_issuer=NULL; |
| 2019 | ctx->current_crl=NULL; | ||
| 2020 | ctx->current_crl_score=0; | ||
| 2021 | ctx->current_reasons=0; | ||
| 2018 | ctx->tree = NULL; | 2022 | ctx->tree = NULL; |
| 2019 | ctx->parent = NULL; | 2023 | ctx->parent = NULL; |
| 2020 | 2024 | ||
| @@ -2034,7 +2038,7 @@ int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509, | |||
| 2034 | if (store) | 2038 | if (store) |
| 2035 | ret = X509_VERIFY_PARAM_inherit(ctx->param, store->param); | 2039 | ret = X509_VERIFY_PARAM_inherit(ctx->param, store->param); |
| 2036 | else | 2040 | else |
| 2037 | ctx->param->flags |= X509_VP_FLAG_DEFAULT|X509_VP_FLAG_ONCE; | 2041 | ctx->param->inh_flags |= X509_VP_FLAG_DEFAULT|X509_VP_FLAG_ONCE; |
| 2038 | 2042 | ||
| 2039 | if (store) | 2043 | if (store) |
| 2040 | { | 2044 | { |
diff --git a/src/lib/libcrypto/x509/x_all.c b/src/lib/libcrypto/x509/x_all.c index ebae30b701..8ec88c215a 100644 --- a/src/lib/libcrypto/x509/x_all.c +++ b/src/lib/libcrypto/x509/x_all.c | |||
| @@ -90,6 +90,7 @@ int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r) | |||
| 90 | 90 | ||
| 91 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) | 91 | int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) |
| 92 | { | 92 | { |
| 93 | x->cert_info->enc.modified = 1; | ||
| 93 | return(ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature, | 94 | return(ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature, |
| 94 | x->sig_alg, x->signature, x->cert_info,pkey,md)); | 95 | x->sig_alg, x->signature, x->cert_info,pkey,md)); |
| 95 | } | 96 | } |
diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c index 92f6b24556..bb9777348f 100644 --- a/src/lib/libcrypto/x509v3/pcy_tree.c +++ b/src/lib/libcrypto/x509v3/pcy_tree.c | |||
| @@ -341,9 +341,8 @@ static int tree_link_nodes(X509_POLICY_LEVEL *curr, | |||
| 341 | const X509_POLICY_CACHE *cache) | 341 | const X509_POLICY_CACHE *cache) |
| 342 | { | 342 | { |
| 343 | int i; | 343 | int i; |
| 344 | X509_POLICY_LEVEL *last; | ||
| 345 | X509_POLICY_DATA *data; | 344 | X509_POLICY_DATA *data; |
| 346 | last = curr - 1; | 345 | |
| 347 | for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) | 346 | for (i = 0; i < sk_X509_POLICY_DATA_num(cache->data); i++) |
| 348 | { | 347 | { |
| 349 | data = sk_X509_POLICY_DATA_value(cache->data, i); | 348 | data = sk_X509_POLICY_DATA_value(cache->data, i); |
diff --git a/src/lib/libcrypto/x509v3/v3_addr.c b/src/lib/libcrypto/x509v3/v3_addr.c index 9087d66e0a..0d70e8696d 100644 --- a/src/lib/libcrypto/x509v3/v3_addr.c +++ b/src/lib/libcrypto/x509v3/v3_addr.c | |||
| @@ -177,12 +177,18 @@ static int i2r_address(BIO *out, | |||
| 177 | unsigned char addr[ADDR_RAW_BUF_LEN]; | 177 | unsigned char addr[ADDR_RAW_BUF_LEN]; |
| 178 | int i, n; | 178 | int i, n; |
| 179 | 179 | ||
| 180 | if (bs->length < 0) | ||
| 181 | return 0; | ||
| 180 | switch (afi) { | 182 | switch (afi) { |
| 181 | case IANA_AFI_IPV4: | 183 | case IANA_AFI_IPV4: |
| 184 | if (bs->length > 4) | ||
| 185 | return 0; | ||
| 182 | addr_expand(addr, bs, 4, fill); | 186 | addr_expand(addr, bs, 4, fill); |
| 183 | BIO_printf(out, "%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]); | 187 | BIO_printf(out, "%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]); |
| 184 | break; | 188 | break; |
| 185 | case IANA_AFI_IPV6: | 189 | case IANA_AFI_IPV6: |
| 190 | if (bs->length > 16) | ||
| 191 | return 0; | ||
| 186 | addr_expand(addr, bs, 16, fill); | 192 | addr_expand(addr, bs, 16, fill); |
| 187 | for (n = 16; n > 1 && addr[n-1] == 0x00 && addr[n-2] == 0x00; n -= 2) | 193 | for (n = 16; n > 1 && addr[n-1] == 0x00 && addr[n-2] == 0x00; n -= 2) |
| 188 | ; | 194 | ; |
diff --git a/src/lib/libcrypto/x509v3/v3_asid.c b/src/lib/libcrypto/x509v3/v3_asid.c index 56702f86b9..3f434c0603 100644 --- a/src/lib/libcrypto/x509v3/v3_asid.c +++ b/src/lib/libcrypto/x509v3/v3_asid.c | |||
| @@ -61,7 +61,6 @@ | |||
| 61 | 61 | ||
| 62 | #include <stdio.h> | 62 | #include <stdio.h> |
| 63 | #include <string.h> | 63 | #include <string.h> |
| 64 | #include <assert.h> | ||
| 65 | #include "cryptlib.h" | 64 | #include "cryptlib.h" |
| 66 | #include <openssl/conf.h> | 65 | #include <openssl/conf.h> |
| 67 | #include <openssl/asn1.h> | 66 | #include <openssl/asn1.h> |
| @@ -172,11 +171,11 @@ static int ASIdOrRange_cmp(const ASIdOrRange * const *a_, | |||
| 172 | { | 171 | { |
| 173 | const ASIdOrRange *a = *a_, *b = *b_; | 172 | const ASIdOrRange *a = *a_, *b = *b_; |
| 174 | 173 | ||
| 175 | assert((a->type == ASIdOrRange_id && a->u.id != NULL) || | 174 | OPENSSL_assert((a->type == ASIdOrRange_id && a->u.id != NULL) || |
| 176 | (a->type == ASIdOrRange_range && a->u.range != NULL && | 175 | (a->type == ASIdOrRange_range && a->u.range != NULL && |
| 177 | a->u.range->min != NULL && a->u.range->max != NULL)); | 176 | a->u.range->min != NULL && a->u.range->max != NULL)); |
| 178 | 177 | ||
| 179 | assert((b->type == ASIdOrRange_id && b->u.id != NULL) || | 178 | OPENSSL_assert((b->type == ASIdOrRange_id && b->u.id != NULL) || |
| 180 | (b->type == ASIdOrRange_range && b->u.range != NULL && | 179 | (b->type == ASIdOrRange_range && b->u.range != NULL && |
| 181 | b->u.range->min != NULL && b->u.range->max != NULL)); | 180 | b->u.range->min != NULL && b->u.range->max != NULL)); |
| 182 | 181 | ||
| @@ -215,7 +214,7 @@ int v3_asid_add_inherit(ASIdentifiers *asid, int which) | |||
| 215 | if (*choice == NULL) { | 214 | if (*choice == NULL) { |
| 216 | if ((*choice = ASIdentifierChoice_new()) == NULL) | 215 | if ((*choice = ASIdentifierChoice_new()) == NULL) |
| 217 | return 0; | 216 | return 0; |
| 218 | assert((*choice)->u.inherit == NULL); | 217 | OPENSSL_assert((*choice)->u.inherit == NULL); |
| 219 | if (((*choice)->u.inherit = ASN1_NULL_new()) == NULL) | 218 | if (((*choice)->u.inherit = ASN1_NULL_new()) == NULL) |
| 220 | return 0; | 219 | return 0; |
| 221 | (*choice)->type = ASIdentifierChoice_inherit; | 220 | (*choice)->type = ASIdentifierChoice_inherit; |
| @@ -250,7 +249,7 @@ int v3_asid_add_id_or_range(ASIdentifiers *asid, | |||
| 250 | if (*choice == NULL) { | 249 | if (*choice == NULL) { |
| 251 | if ((*choice = ASIdentifierChoice_new()) == NULL) | 250 | if ((*choice = ASIdentifierChoice_new()) == NULL) |
| 252 | return 0; | 251 | return 0; |
| 253 | assert((*choice)->u.asIdsOrRanges == NULL); | 252 | OPENSSL_assert((*choice)->u.asIdsOrRanges == NULL); |
| 254 | (*choice)->u.asIdsOrRanges = sk_ASIdOrRange_new(ASIdOrRange_cmp); | 253 | (*choice)->u.asIdsOrRanges = sk_ASIdOrRange_new(ASIdOrRange_cmp); |
| 255 | if ((*choice)->u.asIdsOrRanges == NULL) | 254 | if ((*choice)->u.asIdsOrRanges == NULL) |
| 256 | return 0; | 255 | return 0; |
| @@ -286,7 +285,7 @@ static void extract_min_max(ASIdOrRange *aor, | |||
| 286 | ASN1_INTEGER **min, | 285 | ASN1_INTEGER **min, |
| 287 | ASN1_INTEGER **max) | 286 | ASN1_INTEGER **max) |
| 288 | { | 287 | { |
| 289 | assert(aor != NULL && min != NULL && max != NULL); | 288 | OPENSSL_assert(aor != NULL && min != NULL && max != NULL); |
| 290 | switch (aor->type) { | 289 | switch (aor->type) { |
| 291 | case ASIdOrRange_id: | 290 | case ASIdOrRange_id: |
| 292 | *min = aor->u.id; | 291 | *min = aor->u.id; |
| @@ -373,7 +372,7 @@ static int ASIdentifierChoice_is_canonical(ASIdentifierChoice *choice) | |||
| 373 | int v3_asid_is_canonical(ASIdentifiers *asid) | 372 | int v3_asid_is_canonical(ASIdentifiers *asid) |
| 374 | { | 373 | { |
| 375 | return (asid == NULL || | 374 | return (asid == NULL || |
| 376 | (ASIdentifierChoice_is_canonical(asid->asnum) || | 375 | (ASIdentifierChoice_is_canonical(asid->asnum) && |
| 377 | ASIdentifierChoice_is_canonical(asid->rdi))); | 376 | ASIdentifierChoice_is_canonical(asid->rdi))); |
| 378 | } | 377 | } |
| 379 | 378 | ||
| @@ -395,7 +394,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) | |||
| 395 | /* | 394 | /* |
| 396 | * We have a list. Sort it. | 395 | * We have a list. Sort it. |
| 397 | */ | 396 | */ |
| 398 | assert(choice->type == ASIdentifierChoice_asIdsOrRanges); | 397 | OPENSSL_assert(choice->type == ASIdentifierChoice_asIdsOrRanges); |
| 399 | sk_ASIdOrRange_sort(choice->u.asIdsOrRanges); | 398 | sk_ASIdOrRange_sort(choice->u.asIdsOrRanges); |
| 400 | 399 | ||
| 401 | /* | 400 | /* |
| @@ -413,7 +412,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) | |||
| 413 | /* | 412 | /* |
| 414 | * Make sure we're properly sorted (paranoia). | 413 | * Make sure we're properly sorted (paranoia). |
| 415 | */ | 414 | */ |
| 416 | assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0); | 415 | OPENSSL_assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0); |
| 417 | 416 | ||
| 418 | /* | 417 | /* |
| 419 | * Check for overlaps. | 418 | * Check for overlaps. |
| @@ -472,7 +471,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) | |||
| 472 | } | 471 | } |
| 473 | } | 472 | } |
| 474 | 473 | ||
| 475 | assert(ASIdentifierChoice_is_canonical(choice)); /* Paranoia */ | 474 | OPENSSL_assert(ASIdentifierChoice_is_canonical(choice)); /* Paranoia */ |
| 476 | 475 | ||
| 477 | ret = 1; | 476 | ret = 1; |
| 478 | 477 | ||
| @@ -709,9 +708,9 @@ static int v3_asid_validate_path_internal(X509_STORE_CTX *ctx, | |||
| 709 | int i, ret = 1, inherit_as = 0, inherit_rdi = 0; | 708 | int i, ret = 1, inherit_as = 0, inherit_rdi = 0; |
| 710 | X509 *x; | 709 | X509 *x; |
| 711 | 710 | ||
| 712 | assert(chain != NULL && sk_X509_num(chain) > 0); | 711 | OPENSSL_assert(chain != NULL && sk_X509_num(chain) > 0); |
| 713 | assert(ctx != NULL || ext != NULL); | 712 | OPENSSL_assert(ctx != NULL || ext != NULL); |
| 714 | assert(ctx == NULL || ctx->verify_cb != NULL); | 713 | OPENSSL_assert(ctx == NULL || ctx->verify_cb != NULL); |
| 715 | 714 | ||
| 716 | /* | 715 | /* |
| 717 | * Figure out where to start. If we don't have an extension to | 716 | * Figure out where to start. If we don't have an extension to |
| @@ -724,7 +723,7 @@ static int v3_asid_validate_path_internal(X509_STORE_CTX *ctx, | |||
| 724 | } else { | 723 | } else { |
| 725 | i = 0; | 724 | i = 0; |
| 726 | x = sk_X509_value(chain, i); | 725 | x = sk_X509_value(chain, i); |
| 727 | assert(x != NULL); | 726 | OPENSSL_assert(x != NULL); |
| 728 | if ((ext = x->rfc3779_asid) == NULL) | 727 | if ((ext = x->rfc3779_asid) == NULL) |
| 729 | goto done; | 728 | goto done; |
| 730 | } | 729 | } |
| @@ -757,7 +756,7 @@ static int v3_asid_validate_path_internal(X509_STORE_CTX *ctx, | |||
| 757 | */ | 756 | */ |
| 758 | for (i++; i < sk_X509_num(chain); i++) { | 757 | for (i++; i < sk_X509_num(chain); i++) { |
| 759 | x = sk_X509_value(chain, i); | 758 | x = sk_X509_value(chain, i); |
| 760 | assert(x != NULL); | 759 | OPENSSL_assert(x != NULL); |
| 761 | if (x->rfc3779_asid == NULL) { | 760 | if (x->rfc3779_asid == NULL) { |
| 762 | if (child_as != NULL || child_rdi != NULL) | 761 | if (child_as != NULL || child_rdi != NULL) |
| 763 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); | 762 | validation_err(X509_V_ERR_UNNESTED_RESOURCE); |
| @@ -800,7 +799,7 @@ static int v3_asid_validate_path_internal(X509_STORE_CTX *ctx, | |||
| 800 | /* | 799 | /* |
| 801 | * Trust anchor can't inherit. | 800 | * Trust anchor can't inherit. |
| 802 | */ | 801 | */ |
| 803 | assert(x != NULL); | 802 | OPENSSL_assert(x != NULL); |
| 804 | if (x->rfc3779_asid != NULL) { | 803 | if (x->rfc3779_asid != NULL) { |
| 805 | if (x->rfc3779_asid->asnum != NULL && | 804 | if (x->rfc3779_asid->asnum != NULL && |
| 806 | x->rfc3779_asid->asnum->type == ASIdentifierChoice_inherit) | 805 | x->rfc3779_asid->asnum->type == ASIdentifierChoice_inherit) |
