summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortedu <>2014-04-19 17:40:49 +0000
committertedu <>2014-04-19 17:40:49 +0000
commitdf8c8855c8bba769e21827771868e3f6372aa994 (patch)
tree3b6e34f49d5a7f31fa452bd643a9e446e64ab298
parentd20979fe2307d8f158be31f44f6ac32e1080edc2 (diff)
downloadopenbsd-df8c8855c8bba769e21827771868e3f6372aa994.tar.gz
openbsd-df8c8855c8bba769e21827771868e3f6372aa994.tar.bz2
openbsd-df8c8855c8bba769e21827771868e3f6372aa994.zip
another attempt at fixing stale x509 data. since we don't know where the
initial storage came from, we can't free it. just memset in the sequence case. probably ok beck
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/asn1/tasn_dec.c18
-rw-r--r--src/lib/libssl/src/crypto/asn1/tasn_dec.c18
2 files changed, 16 insertions, 20 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c
index 66f039806e..560b6f3d5f 100644
--- a/src/lib/libcrypto/asn1/tasn_dec.c
+++ b/src/lib/libcrypto/asn1/tasn_dec.c
@@ -172,12 +172,6 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
172 if (!pval) 172 if (!pval)
173 return 0; 173 return 0;
174 174
175 /* always start fresh */
176 if (0 && *pval) {
177 ASN1_item_ex_free(pval, it);
178 *pval = NULL;
179 }
180
181 if (aux && aux->asn1_cb) 175 if (aux && aux->asn1_cb)
182 asn1_cb = aux->asn1_cb; 176 asn1_cb = aux->asn1_cb;
183 else 177 else
@@ -388,10 +382,14 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
388 goto err; 382 goto err;
389 } 383 }
390 384
391 if (!*pval && !ASN1_item_ex_new(pval, it)) { 385 if (!*pval) {
392 ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, 386 if (!ASN1_item_ex_new(pval, it)) {
393 ERR_R_NESTED_ASN1_ERROR); 387 ASN1err(ASN1_F_ASN1_ITEM_EX_D2I,
394 goto err; 388 ERR_R_NESTED_ASN1_ERROR);
389 goto err;
390 }
391 } else {
392 memset(*pval, 0, it->size);
395 } 393 }
396 394
397 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL)) 395 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_dec.c b/src/lib/libssl/src/crypto/asn1/tasn_dec.c
index 66f039806e..560b6f3d5f 100644
--- a/src/lib/libssl/src/crypto/asn1/tasn_dec.c
+++ b/src/lib/libssl/src/crypto/asn1/tasn_dec.c
@@ -172,12 +172,6 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
172 if (!pval) 172 if (!pval)
173 return 0; 173 return 0;
174 174
175 /* always start fresh */
176 if (0 && *pval) {
177 ASN1_item_ex_free(pval, it);
178 *pval = NULL;
179 }
180
181 if (aux && aux->asn1_cb) 175 if (aux && aux->asn1_cb)
182 asn1_cb = aux->asn1_cb; 176 asn1_cb = aux->asn1_cb;
183 else 177 else
@@ -388,10 +382,14 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
388 goto err; 382 goto err;
389 } 383 }
390 384
391 if (!*pval && !ASN1_item_ex_new(pval, it)) { 385 if (!*pval) {
392 ASN1err(ASN1_F_ASN1_ITEM_EX_D2I, 386 if (!ASN1_item_ex_new(pval, it)) {
393 ERR_R_NESTED_ASN1_ERROR); 387 ASN1err(ASN1_F_ASN1_ITEM_EX_D2I,
394 goto err; 388 ERR_R_NESTED_ASN1_ERROR);
389 goto err;
390 }
391 } else {
392 memset(*pval, 0, it->size);
395 } 393 }
396 394
397 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL)) 395 if (asn1_cb && !asn1_cb(ASN1_OP_D2I_PRE, pval, it, NULL))