aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/tasn_dec.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2005-04-30 18:02:54 +0000
committerDr. Stephen Henson <steve@openssl.org>2005-04-30 18:02:54 +0000
commit7bdeeb64ac00caacfa476ac73bec52bea0aade34 (patch)
tree9605330f9bb0093c909db20c46404befd63f7950 /crypto/asn1/tasn_dec.c
parent43b45a42fd51f16372064d13ff693b81d63adbd9 (diff)
downloadopenssl-7bdeeb64ac00caacfa476ac73bec52bea0aade34.tar.gz
Don't attempt to parse nested ASN1 strings by default.
Diffstat (limited to 'crypto/asn1/tasn_dec.c')
-rw-r--r--crypto/asn1/tasn_dec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index 39a9d5a9aa..ed79535e66 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -3,7 +3,7 @@
* project 2000.
*/
/* ====================================================================
- * Copyright (c) 2000-2004 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1075,7 +1075,7 @@ static int asn1_find_end(const unsigned char **in, long len, char inf)
expected_eoc = 1;
/* Indefinite length constructed form. Find the end when enough EOCs
* are found. If more indefinite length constructed headers
- * are encountered increment the expected eoc count otherwise just
+ * are encountered increment the expected eoc count otherwise justi
* skip to the end of the data.
*/
while (len > 0)
@@ -1159,8 +1159,13 @@ static int asn1_collect(BUF_MEM *buf, const unsigned char **in, long len,
/* If indefinite length constructed update max length */
if (cst)
{
+#ifdef OPENSSL_ALLOW_NESTED_ASN1_STRINGS
if (!asn1_collect(buf, &p, plen, ininf, tag, aclass))
return 0;
+#else
+ ASN1err(ASN1_F_ASN1_COLLECT, ASN1_R_NESTED_ASN1_STRING);
+ return 0;
+#endif
}
else if (!collect_data(buf, &p, plen))
return 0;