diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index 8b3d22da7..42fee2730 100644 --- a/crypto/asn1/tasn_dec.c +++ b/crypto/asn1/tasn_dec.c @@ -174,7 +174,6 @@ static int asn1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, unsigned char *wp = NULL; /* BIG FAT WARNING! BREAKS CONST WHERE USED */ unsigned char imphack = 0, oclass; char seq_eoc, seq_nolen, cst, isopt; - long tmplen; int i; int otag; int ret = 0; @@ -373,7 +372,6 @@ static int asn1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, case ASN1_ITYPE_NDEF_SEQUENCE: case ASN1_ITYPE_SEQUENCE: p = *in; - tmplen = len; /* If no IMPLICIT tagging set to SEQUENCE, UNIVERSAL */ if (tag == -1) { @@ -388,13 +386,8 @@ static int asn1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, goto err; } else if (ret == -1) return -1; - if (aux && (aux->flags & ASN1_AFLG_BROKEN)) { - len = tmplen - (p - *in); - seq_nolen = 1; - } /* If indefinite we don't do a length check */ - else - seq_nolen = seq_eoc; + seq_nolen = seq_eoc; if (!cst) { OPENSSL_PUT_ERROR(ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED); goto err; diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h index 7bd77017a..ea864ec43 100644 --- a/include/openssl/asn1t.h +++ b/include/openssl/asn1t.h @@ -151,10 +151,6 @@ extern "C" { static const ASN1_AUX tname##_aux = {NULL, 0, 0, cb, 0}; \ ASN1_SEQUENCE(tname) -#define ASN1_BROKEN_SEQUENCE(tname) \ - static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0}; \ - ASN1_SEQUENCE(tname) - #define ASN1_SEQUENCE_ref(tname, cb) \ static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), cb, 0}; \ ASN1_SEQUENCE(tname) @@ -175,8 +171,6 @@ extern "C" { #tname \ ASN1_ITEM_end(tname) -#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) - #define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) #define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) @@ -699,8 +693,6 @@ typedef struct ASN1_STREAM_ARG_st { #define ASN1_AFLG_REFCOUNT 1 /* Save the encoding of structure (useful for signatures) */ #define ASN1_AFLG_ENCODING 2 -/* The Sequence length is invalid */ -#define ASN1_AFLG_BROKEN 4 /* operation values for asn1_cb */