diff options
author | jsing <> | 2022-05-12 19:11:14 +0000 |
---|---|---|
committer | jsing <> | 2022-05-12 19:11:14 +0000 |
commit | 5bdcfefad695534cdfef84146076871e71771406 (patch) | |
tree | e23df38f2eb306441e12fc2ae7e03b746daf9a61 /src | |
parent | be814b451bedb2aaf52c1e292a00ddf1334d89da (diff) | |
download | openbsd-5bdcfefad695534cdfef84146076871e71771406.tar.gz openbsd-5bdcfefad695534cdfef84146076871e71771406.tar.bz2 openbsd-5bdcfefad695534cdfef84146076871e71771406.zip |
Remove ASN1_AFLG_BROKEN.
This workaround was used by ASN1_BROKEN_SEQUENCE, which existed for
NETSCAPE_ENCRYPTED_PKEY. Remove the workaround since the only consumer
has already been removed.
ok tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/asn1t.h | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/tasn_dec.c | 12 |
2 files changed, 3 insertions, 19 deletions
diff --git a/src/lib/libcrypto/asn1/asn1t.h b/src/lib/libcrypto/asn1/asn1t.h index 2d38b0d006..d02fde4ced 100644 --- a/src/lib/libcrypto/asn1/asn1t.h +++ b/src/lib/libcrypto/asn1/asn1t.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1t.h,v 1.20 2022/05/10 05:19:22 jsing Exp $ */ | 1 | /* $OpenBSD: asn1t.h,v 1.21 2022/05/12 19:11:14 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -183,10 +183,6 @@ extern "C" { | |||
183 | static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ | 183 | static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \ |
184 | ASN1_SEQUENCE(tname) | 184 | ASN1_SEQUENCE(tname) |
185 | 185 | ||
186 | #define ASN1_BROKEN_SEQUENCE(tname) \ | ||
187 | static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \ | ||
188 | ASN1_SEQUENCE(tname) | ||
189 | |||
190 | #define ASN1_SEQUENCE_ref(tname, cb, lck) \ | 186 | #define ASN1_SEQUENCE_ref(tname, cb, lck) \ |
191 | static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ | 187 | static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \ |
192 | ASN1_SEQUENCE(tname) | 188 | ASN1_SEQUENCE(tname) |
@@ -219,8 +215,6 @@ extern "C" { | |||
219 | #tname \ | 215 | #tname \ |
220 | ASN1_ITEM_end(tname) | 216 | ASN1_ITEM_end(tname) |
221 | 217 | ||
222 | #define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) | ||
223 | |||
224 | #define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) | 218 | #define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) |
225 | 219 | ||
226 | #define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) | 220 | #define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) |
@@ -745,8 +739,6 @@ typedef struct ASN1_STREAM_ARG_st { | |||
745 | #define ASN1_AFLG_REFCOUNT 1 | 739 | #define ASN1_AFLG_REFCOUNT 1 |
746 | /* Save the encoding of structure (useful for signatures) */ | 740 | /* Save the encoding of structure (useful for signatures) */ |
747 | #define ASN1_AFLG_ENCODING 2 | 741 | #define ASN1_AFLG_ENCODING 2 |
748 | /* The Sequence length is invalid */ | ||
749 | #define ASN1_AFLG_BROKEN 4 | ||
750 | 742 | ||
751 | /* operation values for asn1_cb */ | 743 | /* operation values for asn1_cb */ |
752 | 744 | ||
diff --git a/src/lib/libcrypto/asn1/tasn_dec.c b/src/lib/libcrypto/asn1/tasn_dec.c index f3e032c1c1..8732ab53cf 100644 --- a/src/lib/libcrypto/asn1/tasn_dec.c +++ b/src/lib/libcrypto/asn1/tasn_dec.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tasn_dec.c,v 1.63 2022/05/10 18:40:06 jsing Exp $ */ | 1 | /* $OpenBSD: tasn_dec.c,v 1.64 2022/05/12 19:11:14 jsing Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -249,7 +249,6 @@ asn1_item_ex_d2i_sequence(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
249 | ASN1_aux_cb *asn1_cb = NULL; | 249 | ASN1_aux_cb *asn1_cb = NULL; |
250 | char seq_eoc, seq_nolen, cst, isopt; | 250 | char seq_eoc, seq_nolen, cst, isopt; |
251 | const unsigned char *p = NULL, *q; | 251 | const unsigned char *p = NULL, *q; |
252 | long tmplen; | ||
253 | int i; | 252 | int i; |
254 | int ret = 0; | 253 | int ret = 0; |
255 | 254 | ||
@@ -261,7 +260,6 @@ asn1_item_ex_d2i_sequence(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
261 | asn1_cb = aux->asn1_cb; | 260 | asn1_cb = aux->asn1_cb; |
262 | 261 | ||
263 | p = *in; | 262 | p = *in; |
264 | tmplen = len; | ||
265 | 263 | ||
266 | /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ | 264 | /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ |
267 | if (tag == -1) { | 265 | if (tag == -1) { |
@@ -276,13 +274,7 @@ asn1_item_ex_d2i_sequence(ASN1_VALUE **pval, const unsigned char **in, long len, | |||
276 | goto err; | 274 | goto err; |
277 | } else if (ret == -1) | 275 | } else if (ret == -1) |
278 | return -1; | 276 | return -1; |
279 | if (aux && (aux->flags & ASN1_AFLG_BROKEN)) { | 277 | seq_nolen = seq_eoc; |
280 | len = tmplen - (p - *in); | ||
281 | seq_nolen = 1; | ||
282 | } | ||
283 | /* If indefinite we don't do a length check */ | ||
284 | else | ||
285 | seq_nolen = seq_eoc; | ||
286 | if (!cst) { | 278 | if (!cst) { |
287 | ASN1error(ASN1_R_SEQUENCE_NOT_CONSTRUCTED); | 279 | ASN1error(ASN1_R_SEQUENCE_NOT_CONSTRUCTED); |
288 | goto err; | 280 | goto err; |