summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2019-04-07 16:35:50 +0000
committerjsing <>2019-04-07 16:35:50 +0000
commit3a3def0d377f1817d5aa504ebfad33ce823a1ba6 (patch)
tree565c05cfc3f5c16bc1e88c8b1cdd28a5323b19c3 /src/lib
parent3cca012bbe5fc59e175b77d294821fb99b334f67 (diff)
downloadopenbsd-3a3def0d377f1817d5aa504ebfad33ce823a1ba6.tar.gz
openbsd-3a3def0d377f1817d5aa504ebfad33ce823a1ba6.tar.bz2
openbsd-3a3def0d377f1817d5aa504ebfad33ce823a1ba6.zip
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@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/tasn_prn.c8
1 files changed, 2 insertions, 6 deletions
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 @@
1/* $OpenBSD: tasn_prn.c,v 1.19 2019/04/01 15:48:04 jsing Exp $ */ 1/* $OpenBSD: tasn_prn.c,v 1.20 2019/04/07 16:35:50 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 */
@@ -512,12 +512,7 @@ asn1_primitive_print(BIO *out, ASN1_VALUE **fld, const ASN1_ITEM *it,
512 512
513 return pf->prim_print(out, fld, it, indent, pctx); 513 return pf->prim_print(out, fld, it, indent, pctx);
514 } 514 }
515
516 str = (ASN1_STRING *)*fld; 515 str = (ASN1_STRING *)*fld;
517
518 if (str->length < 0)
519 return 0;
520
521 if (it->itype == ASN1_ITYPE_MSTRING) 516 if (it->itype == ASN1_ITYPE_MSTRING)
522 utype = str->type & ~V_ASN1_NEG; 517 utype = str->type & ~V_ASN1_NEG;
523 else 518 else
@@ -526,6 +521,7 @@ asn1_primitive_print(BIO *out, ASN1_VALUE **fld, const ASN1_ITEM *it,
526 ASN1_TYPE *atype = (ASN1_TYPE *)*fld; 521 ASN1_TYPE *atype = (ASN1_TYPE *)*fld;
527 utype = atype->type; 522 utype = atype->type;
528 fld = &atype->value.asn1_value; 523 fld = &atype->value.asn1_value;
524 str = (ASN1_STRING *)*fld;
529 if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE) 525 if (pctx->flags & ASN1_PCTX_FLAGS_NO_ANY_TYPE)
530 pname = NULL; 526 pname = NULL;
531 else 527 else