From 21f96e586351fc8b535353f2dea7c784e931d14a Mon Sep 17 00:00:00 2001 From: Gary Ching-Pang Lin Date: Tue, 19 Aug 2014 12:15:00 +0800 Subject: Update openssl to 0.9.8zb Also update to Tiano Cryptlib r15802 and remove the execute mode bits from the C and header files of openssl --- Cryptlib/OpenSSL/crypto/asn1/a_bitstr.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_bool.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_bytes.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_d2i_fp.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_digest.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_dup.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_enum.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_gentm.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_hdr.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_i2d_fp.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_int.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_mbstr.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_meth.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_object.c | 30 +++++++++++++++++++++--------- Cryptlib/OpenSSL/crypto/asn1/a_octet.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_print.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_set.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_sign.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_strex.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_strnid.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_time.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_type.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_utctm.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_utf8.c | 0 Cryptlib/OpenSSL/crypto/asn1/a_verify.c | 0 Cryptlib/OpenSSL/crypto/asn1/asn1_err.c | 0 Cryptlib/OpenSSL/crypto/asn1/asn1_gen.c | 0 Cryptlib/OpenSSL/crypto/asn1/asn1_lib.c | 3 +++ Cryptlib/OpenSSL/crypto/asn1/asn1_par.c | 0 Cryptlib/OpenSSL/crypto/asn1/asn_mime.c | 2 ++ Cryptlib/OpenSSL/crypto/asn1/asn_moid.c | 0 Cryptlib/OpenSSL/crypto/asn1/asn_pack.c | 12 ++++++++++-- Cryptlib/OpenSSL/crypto/asn1/d2i_pr.c | 0 Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c | 0 Cryptlib/OpenSSL/crypto/asn1/evp_asn1.c | 6 +++++- Cryptlib/OpenSSL/crypto/asn1/f_enum.c | 0 Cryptlib/OpenSSL/crypto/asn1/f_int.c | 0 Cryptlib/OpenSSL/crypto/asn1/f_string.c | 0 Cryptlib/OpenSSL/crypto/asn1/i2d_pr.c | 0 Cryptlib/OpenSSL/crypto/asn1/i2d_pu.c | 0 Cryptlib/OpenSSL/crypto/asn1/n_pkey.c | 0 Cryptlib/OpenSSL/crypto/asn1/nsseq.c | 0 Cryptlib/OpenSSL/crypto/asn1/p5_pbe.c | 0 Cryptlib/OpenSSL/crypto/asn1/p5_pbev2.c | 0 Cryptlib/OpenSSL/crypto/asn1/p8_pkey.c | 0 Cryptlib/OpenSSL/crypto/asn1/t_bitst.c | 0 Cryptlib/OpenSSL/crypto/asn1/t_crl.c | 0 Cryptlib/OpenSSL/crypto/asn1/t_pkey.c | 0 Cryptlib/OpenSSL/crypto/asn1/t_req.c | 0 Cryptlib/OpenSSL/crypto/asn1/t_spki.c | 0 Cryptlib/OpenSSL/crypto/asn1/t_x509.c | 2 ++ Cryptlib/OpenSSL/crypto/asn1/t_x509a.c | 0 Cryptlib/OpenSSL/crypto/asn1/tasn_dec.c | 0 Cryptlib/OpenSSL/crypto/asn1/tasn_enc.c | 7 ++++++- Cryptlib/OpenSSL/crypto/asn1/tasn_fre.c | 0 Cryptlib/OpenSSL/crypto/asn1/tasn_new.c | 0 Cryptlib/OpenSSL/crypto/asn1/tasn_typ.c | 0 Cryptlib/OpenSSL/crypto/asn1/tasn_utl.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_algor.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_attrib.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_bignum.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_crl.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_exten.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_info.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_long.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_name.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_pkey.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_pubkey.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_req.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_sig.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_spki.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_val.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_x509.c | 0 Cryptlib/OpenSSL/crypto/asn1/x_x509a.c | 0 74 files changed, 49 insertions(+), 13 deletions(-) mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_bitstr.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_bool.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_bytes.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_d2i_fp.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_digest.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_dup.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_enum.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_gentm.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_hdr.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_i2d_fp.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_int.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_mbstr.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_meth.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_object.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_octet.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_print.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_set.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_sign.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_strex.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_strnid.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_time.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_type.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_utctm.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_utf8.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/a_verify.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/asn1_err.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/asn1_gen.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/asn1_lib.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/asn1_par.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/asn_mime.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/asn_moid.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/asn_pack.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/d2i_pr.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/evp_asn1.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/f_enum.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/f_int.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/f_string.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/i2d_pr.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/i2d_pu.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/n_pkey.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/nsseq.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/p5_pbe.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/p5_pbev2.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/p8_pkey.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/t_bitst.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/t_crl.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/t_pkey.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/t_req.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/t_spki.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/t_x509.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/t_x509a.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/tasn_dec.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/tasn_enc.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/tasn_fre.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/tasn_new.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/tasn_typ.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/tasn_utl.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_algor.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_attrib.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_bignum.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_crl.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_exten.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_info.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_long.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_name.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_pkey.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_pubkey.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_req.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_sig.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_spki.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_val.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_x509.c mode change 100755 => 100644 Cryptlib/OpenSSL/crypto/asn1/x_x509a.c (limited to 'Cryptlib/OpenSSL/crypto/asn1') diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_bitstr.c b/Cryptlib/OpenSSL/crypto/asn1/a_bitstr.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_bool.c b/Cryptlib/OpenSSL/crypto/asn1/a_bool.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_bytes.c b/Cryptlib/OpenSSL/crypto/asn1/a_bytes.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_d2i_fp.c b/Cryptlib/OpenSSL/crypto/asn1/a_d2i_fp.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_digest.c b/Cryptlib/OpenSSL/crypto/asn1/a_digest.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_dup.c b/Cryptlib/OpenSSL/crypto/asn1/a_dup.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_enum.c b/Cryptlib/OpenSSL/crypto/asn1/a_enum.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_gentm.c b/Cryptlib/OpenSSL/crypto/asn1/a_gentm.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_hdr.c b/Cryptlib/OpenSSL/crypto/asn1/a_hdr.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_i2d_fp.c b/Cryptlib/OpenSSL/crypto/asn1/a_i2d_fp.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_int.c b/Cryptlib/OpenSSL/crypto/asn1/a_int.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_mbstr.c b/Cryptlib/OpenSSL/crypto/asn1/a_mbstr.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_meth.c b/Cryptlib/OpenSSL/crypto/asn1/a_meth.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_object.c b/Cryptlib/OpenSSL/crypto/asn1/a_object.c old mode 100755 new mode 100644 index 3ac2bc2a..e50501ad --- a/Cryptlib/OpenSSL/crypto/asn1/a_object.c +++ b/Cryptlib/OpenSSL/crypto/asn1/a_object.c @@ -285,16 +285,28 @@ err: ASN1_OBJECT_free(ret); return(NULL); } + ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, long len) { ASN1_OBJECT *ret=NULL; const unsigned char *p; - int i; - /* Sanity check OID encoding: can't have leading 0x80 in - * subidentifiers, see: X.690 8.19.2 + int i, length; + + /* Sanity check OID encoding. + * Need at least one content octet. + * MSB must be clear in the last octet. + * can't have leading 0x80 in subidentifiers, see: X.690 8.19.2 */ - for (i = 0, p = *pp; i < len; i++, p++) + if (len <= 0 || len > INT_MAX || pp == NULL || (p = *pp) == NULL || + p[len - 1] & 0x80) + { + ASN1err(ASN1_F_C2I_ASN1_OBJECT,ASN1_R_INVALID_OBJECT_ENCODING); + return NULL; + } + /* Now 0 < len <= INT_MAX, so the cast is safe. */ + length = (int)len; + for (i = 0; i < length; i++, p++) { if (*p == 0x80 && (!i || !(p[-1] & 0x80))) { @@ -313,20 +325,20 @@ ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, else ret=(*a); p= *pp; - if ((ret->data == NULL) || (ret->length < len)) + if ((ret->data == NULL) || (ret->length < length)) { if (ret->data != NULL) OPENSSL_free(ret->data); - ret->data=(unsigned char *)OPENSSL_malloc(len ? (int)len : 1); + ret->data=(unsigned char *)OPENSSL_malloc(length); ret->flags|=ASN1_OBJECT_FLAG_DYNAMIC_DATA; if (ret->data == NULL) { i=ERR_R_MALLOC_FAILURE; goto err; } } - memcpy(ret->data,p,(int)len); - ret->length=(int)len; + memcpy(ret->data,p,length); + ret->length=length; ret->sn=NULL; ret->ln=NULL; /* ret->flags=ASN1_OBJECT_FLAG_DYNAMIC; we know it is dynamic */ - p+=len; + p+=length; if (a != NULL) (*a)=ret; *pp=p; diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_octet.c b/Cryptlib/OpenSSL/crypto/asn1/a_octet.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_print.c b/Cryptlib/OpenSSL/crypto/asn1/a_print.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_set.c b/Cryptlib/OpenSSL/crypto/asn1/a_set.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_sign.c b/Cryptlib/OpenSSL/crypto/asn1/a_sign.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_strex.c b/Cryptlib/OpenSSL/crypto/asn1/a_strex.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_strnid.c b/Cryptlib/OpenSSL/crypto/asn1/a_strnid.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_time.c b/Cryptlib/OpenSSL/crypto/asn1/a_time.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_type.c b/Cryptlib/OpenSSL/crypto/asn1/a_type.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_utctm.c b/Cryptlib/OpenSSL/crypto/asn1/a_utctm.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_utf8.c b/Cryptlib/OpenSSL/crypto/asn1/a_utf8.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/a_verify.c b/Cryptlib/OpenSSL/crypto/asn1/a_verify.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/asn1_err.c b/Cryptlib/OpenSSL/crypto/asn1/asn1_err.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/asn1_gen.c b/Cryptlib/OpenSSL/crypto/asn1/asn1_gen.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/asn1_lib.c b/Cryptlib/OpenSSL/crypto/asn1/asn1_lib.c old mode 100755 new mode 100644 index 5af559ef..d3451557 --- a/Cryptlib/OpenSSL/crypto/asn1/asn1_lib.c +++ b/Cryptlib/OpenSSL/crypto/asn1/asn1_lib.c @@ -131,6 +131,9 @@ int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, *pclass=xclass; if (!asn1_get_length(&p,&inf,plength,(int)max)) goto err; + if (inf && !(ret & V_ASN1_CONSTRUCTED)) + goto err; + #if 0 fprintf(stderr,"p=%d + *plength=%ld > omax=%ld + *pp=%d (%d > %d)\n", (int)p,*plength,omax,(int)*pp,(int)(p+ *plength), diff --git a/Cryptlib/OpenSSL/crypto/asn1/asn1_par.c b/Cryptlib/OpenSSL/crypto/asn1/asn1_par.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/asn_mime.c b/Cryptlib/OpenSSL/crypto/asn1/asn_mime.c old mode 100755 new mode 100644 index ad8fbed9..095887f2 --- a/Cryptlib/OpenSSL/crypto/asn1/asn_mime.c +++ b/Cryptlib/OpenSSL/crypto/asn1/asn_mime.c @@ -595,6 +595,8 @@ static STACK_OF(MIME_HEADER) *mime_parse_hdr(BIO *bio) int len, state, save_state = 0; headers = sk_MIME_HEADER_new(mime_hdr_cmp); + if (!headers) + return NULL; while ((len = BIO_gets(bio, linebuf, MAX_SMLEN)) > 0) { /* If whitespace at line start then continuation line */ if(mhdr && isspace((unsigned char)linebuf[0])) state = MIME_NAME; diff --git a/Cryptlib/OpenSSL/crypto/asn1/asn_moid.c b/Cryptlib/OpenSSL/crypto/asn1/asn_moid.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/asn_pack.c b/Cryptlib/OpenSSL/crypto/asn1/asn_pack.c old mode 100755 new mode 100644 index f1a5a056..c373714b --- a/Cryptlib/OpenSSL/crypto/asn1/asn_pack.c +++ b/Cryptlib/OpenSSL/crypto/asn1/asn_pack.c @@ -134,15 +134,23 @@ ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d, ASN1_STRING **oct) if (!(octmp->length = i2d(obj, NULL))) { ASN1err(ASN1_F_ASN1_PACK_STRING,ASN1_R_ENCODE_ERROR); - return NULL; + goto err; } if (!(p = OPENSSL_malloc (octmp->length))) { ASN1err(ASN1_F_ASN1_PACK_STRING,ERR_R_MALLOC_FAILURE); - return NULL; + goto err; } octmp->data = p; i2d (obj, &p); return octmp; + err: + if (!oct || !*oct) + { + ASN1_STRING_free(octmp); + if (oct) + *oct = NULL; + } + return NULL; } #endif diff --git a/Cryptlib/OpenSSL/crypto/asn1/d2i_pr.c b/Cryptlib/OpenSSL/crypto/asn1/d2i_pr.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c b/Cryptlib/OpenSSL/crypto/asn1/d2i_pu.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/evp_asn1.c b/Cryptlib/OpenSSL/crypto/asn1/evp_asn1.c old mode 100755 new mode 100644 index f3d98048..1b944597 --- a/Cryptlib/OpenSSL/crypto/asn1/evp_asn1.c +++ b/Cryptlib/OpenSSL/crypto/asn1/evp_asn1.c @@ -66,7 +66,11 @@ int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len) ASN1_STRING *os; if ((os=M_ASN1_OCTET_STRING_new()) == NULL) return(0); - if (!M_ASN1_OCTET_STRING_set(os,data,len)) return(0); + if (!M_ASN1_OCTET_STRING_set(os,data,len)) + { + M_ASN1_OCTET_STRING_free(os); + return 0; + } ASN1_TYPE_set(a,V_ASN1_OCTET_STRING,os); return(1); } diff --git a/Cryptlib/OpenSSL/crypto/asn1/f_enum.c b/Cryptlib/OpenSSL/crypto/asn1/f_enum.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/f_int.c b/Cryptlib/OpenSSL/crypto/asn1/f_int.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/f_string.c b/Cryptlib/OpenSSL/crypto/asn1/f_string.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/i2d_pr.c b/Cryptlib/OpenSSL/crypto/asn1/i2d_pr.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/i2d_pu.c b/Cryptlib/OpenSSL/crypto/asn1/i2d_pu.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/n_pkey.c b/Cryptlib/OpenSSL/crypto/asn1/n_pkey.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/nsseq.c b/Cryptlib/OpenSSL/crypto/asn1/nsseq.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/p5_pbe.c b/Cryptlib/OpenSSL/crypto/asn1/p5_pbe.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/p5_pbev2.c b/Cryptlib/OpenSSL/crypto/asn1/p5_pbev2.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/p8_pkey.c b/Cryptlib/OpenSSL/crypto/asn1/p8_pkey.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_bitst.c b/Cryptlib/OpenSSL/crypto/asn1/t_bitst.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_crl.c b/Cryptlib/OpenSSL/crypto/asn1/t_crl.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_pkey.c b/Cryptlib/OpenSSL/crypto/asn1/t_pkey.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_req.c b/Cryptlib/OpenSSL/crypto/asn1/t_req.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_spki.c b/Cryptlib/OpenSSL/crypto/asn1/t_spki.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_x509.c b/Cryptlib/OpenSSL/crypto/asn1/t_x509.c old mode 100755 new mode 100644 index 6f295b4e..f9dad0e6 --- a/Cryptlib/OpenSSL/crypto/asn1/t_x509.c +++ b/Cryptlib/OpenSSL/crypto/asn1/t_x509.c @@ -465,6 +465,8 @@ int X509_NAME_print(BIO *bp, X509_NAME *name, int obase) l=80-2-obase; b=X509_NAME_oneline(name,NULL,0); + if (!b) + return 0; if (!*b) { OPENSSL_free(b); diff --git a/Cryptlib/OpenSSL/crypto/asn1/t_x509a.c b/Cryptlib/OpenSSL/crypto/asn1/t_x509a.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/tasn_dec.c b/Cryptlib/OpenSSL/crypto/asn1/tasn_dec.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/tasn_enc.c b/Cryptlib/OpenSSL/crypto/asn1/tasn_enc.c old mode 100755 new mode 100644 index 2721f904..b3687f9f --- a/Cryptlib/OpenSSL/crypto/asn1/tasn_enc.c +++ b/Cryptlib/OpenSSL/crypto/asn1/tasn_enc.c @@ -453,9 +453,14 @@ static int asn1_set_seq_out(STACK_OF(ASN1_VALUE) *sk, unsigned char **out, { derlst = OPENSSL_malloc(sk_ASN1_VALUE_num(sk) * sizeof(*derlst)); + if (!derlst) + return 0; tmpdat = OPENSSL_malloc(skcontlen); - if (!derlst || !tmpdat) + if (!tmpdat) + { + OPENSSL_free(derlst); return 0; + } } } /* If not sorting just output each item */ diff --git a/Cryptlib/OpenSSL/crypto/asn1/tasn_fre.c b/Cryptlib/OpenSSL/crypto/asn1/tasn_fre.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/tasn_new.c b/Cryptlib/OpenSSL/crypto/asn1/tasn_new.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/tasn_typ.c b/Cryptlib/OpenSSL/crypto/asn1/tasn_typ.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/tasn_utl.c b/Cryptlib/OpenSSL/crypto/asn1/tasn_utl.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_algor.c b/Cryptlib/OpenSSL/crypto/asn1/x_algor.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_attrib.c b/Cryptlib/OpenSSL/crypto/asn1/x_attrib.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_bignum.c b/Cryptlib/OpenSSL/crypto/asn1/x_bignum.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_crl.c b/Cryptlib/OpenSSL/crypto/asn1/x_crl.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_exten.c b/Cryptlib/OpenSSL/crypto/asn1/x_exten.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_info.c b/Cryptlib/OpenSSL/crypto/asn1/x_info.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_long.c b/Cryptlib/OpenSSL/crypto/asn1/x_long.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_name.c b/Cryptlib/OpenSSL/crypto/asn1/x_name.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_pkey.c b/Cryptlib/OpenSSL/crypto/asn1/x_pkey.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_pubkey.c b/Cryptlib/OpenSSL/crypto/asn1/x_pubkey.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_req.c b/Cryptlib/OpenSSL/crypto/asn1/x_req.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_sig.c b/Cryptlib/OpenSSL/crypto/asn1/x_sig.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_spki.c b/Cryptlib/OpenSSL/crypto/asn1/x_spki.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_val.c b/Cryptlib/OpenSSL/crypto/asn1/x_val.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_x509.c b/Cryptlib/OpenSSL/crypto/asn1/x_x509.c old mode 100755 new mode 100644 diff --git a/Cryptlib/OpenSSL/crypto/asn1/x_x509a.c b/Cryptlib/OpenSSL/crypto/asn1/x_x509a.c old mode 100755 new mode 100644 -- cgit v1.2.3