diff options
author | tedu <> | 2014-04-18 15:03:20 +0000 |
---|---|---|
committer | tedu <> | 2014-04-18 15:03:20 +0000 |
commit | 8d7a155e827dd96b3fcf47a54551caa3e14fa961 (patch) | |
tree | 72378c252e3573a08e5cdf77a046b709ae6a57b8 /src | |
parent | e3edc2bce08ee456837990d810fd78efd4cf1ac5 (diff) | |
download | openbsd-8d7a155e827dd96b3fcf47a54551caa3e14fa961.tar.gz openbsd-8d7a155e827dd96b3fcf47a54551caa3e14fa961.tar.bz2 openbsd-8d7a155e827dd96b3fcf47a54551caa3e14fa961.zip |
Some dude named Tavis Ormandy reported a bug which has gone unfixed.
http://marc.info/?l=openssl-users&m=138014120223264&w=2
Arguably a doc bug, but we argue not. If you parse a new cert into memory
occupied by a previously verified cert, the new cert will inherit that
state, bypassing future verification checks. To avoid this, we will always
start fresh with a new object.
grudging ok from guenther, after i threatened to make him read the code yet
again. "that ok was way more painful and tiring then it should have been"
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_dec.c | 5 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/tasn_dec.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c index f19c457169..1ce40039b1 100644 --- a/src/lib/libcrypto/asn1/tasn_dec.c +++ b/src/lib/libcrypto/asn1/tasn_dec.c | |||
@@ -171,6 +171,11 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
171 | 171 | ||
172 | if (!pval) | 172 | if (!pval) |
173 | return 0; | 173 | return 0; |
174 | /* always start fresh */ | ||
175 | if (*pval) { | ||
176 | ASN1_item_ex_free(pval, it); | ||
177 | *pval = NULL; | ||
178 | } | ||
174 | if (aux && aux->asn1_cb) | 179 | if (aux && aux->asn1_cb) |
175 | asn1_cb = aux->asn1_cb; | 180 | asn1_cb = aux->asn1_cb; |
176 | else | 181 | else |
diff --git a/src/lib/libssl/src/crypto/asn1/tasn_dec.c b/src/lib/libssl/src/crypto/asn1/tasn_dec.c index f19c457169..1ce40039b1 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_dec.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_dec.c | |||
@@ -171,6 +171,11 @@ ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
171 | 171 | ||
172 | if (!pval) | 172 | if (!pval) |
173 | return 0; | 173 | return 0; |
174 | /* always start fresh */ | ||
175 | if (*pval) { | ||
176 | ASN1_item_ex_free(pval, it); | ||
177 | *pval = NULL; | ||
178 | } | ||
174 | if (aux && aux->asn1_cb) | 179 | if (aux && aux->asn1_cb) |
175 | asn1_cb = aux->asn1_cb; | 180 | asn1_cb = aux->asn1_cb; |
176 | else | 181 | else |