diff options
author | tedu <> | 2014-04-19 17:40:49 +0000 |
---|---|---|
committer | tedu <> | 2014-04-19 17:40:49 +0000 |
commit | 8136714a88005c680ff47c13dc1c7bbce1600e9e (patch) | |
tree | 3b6e34f49d5a7f31fa452bd643a9e446e64ab298 /src | |
parent | fadb7901b28364183b71a94ea8e9ceb816c35156 (diff) | |
download | openbsd-8136714a88005c680ff47c13dc1c7bbce1600e9e.tar.gz openbsd-8136714a88005c680ff47c13dc1c7bbce1600e9e.tar.bz2 openbsd-8136714a88005c680ff47c13dc1c7bbce1600e9e.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 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_dec.c | 18 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/tasn_dec.c | 18 |
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)) |