From 3a3def0d377f1817d5aa504ebfad33ce823a1ba6 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 7 Apr 2019 16:35:50 +0000 Subject: Revert tasn_prn.c r1.18. In this code, just because something is cast to a type doesn't mean it is necessarily that type - in this case we cannot check the length of the ASN1_STRING here, since it might be another data type and later handled as an int (for example, in the V_ASN1_BOOLEAN case). We will revisit this post release. ok tb@ --- src/lib/libcrypto/asn1/tasn_prn.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/asn1/tasn_prn.c b/src/lib/libcrypto/asn1/tasn_prn.c index 36bb4ddc4b..ab8985318e 100644 --- a/src/lib/libcrypto/asn1/tasn_prn.c +++ b/src/lib/libcrypto/asn1/tasn_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_prn.c,v 1.19 2019/04/01 15:48:04 jsing Exp $ */ +/* $OpenBSD: tasn_prn.c,v 1.20 2019/04/07 16:35:50 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -512,12 +512,7 @@ asn1_primitive_print(BIO *out, ASN1_VALUE **fld, const ASN1_ITEM *it, return pf->prim_print(out, fld, it, indent, pctx); } - str = (ASN1_STRING *)*fld; - - if (str->length < 0) - return 0; - if (it->itype == ASN1_ITYPE_MSTRING) utype = str->type & ~V_ASN1_NEG; else @@ -526,6 +521,7 @@ asn1_primitive_print(BIO *out, ASN1_VALUE **fld, const ASN1_ITEM *it, ASN1_TYPE *atype = (ASN1_TYPE *)*fld; utype = atype->type; fld = &atype->value.asn1_value; + str = (ASN1_STRING *)*fld; if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE) pname = NULL; else -- cgit v1.2.3-55-g6feb