From 4c948e2ef76a72d7905351d7da8ccc0233afbb2f Mon Sep 17 00:00:00 2001 From: toddouska Date: Thu, 1 Mar 2012 16:46:24 -0800 Subject: [PATCH] don't allow zero length asn names in certs --- configure.ac | 2 +- ctaocrypt/src/asn.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b02197c84..129010458 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ # # -AC_INIT([cyassl],[2.0.8],[http://www.yassl.com]) +AC_INIT([cyassl],[2.0.9],[http://www.yassl.com]) AC_CONFIG_AUX_DIR(config) diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index 4715e4855..c9e399f20 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -1300,6 +1300,10 @@ static int GetName(DecodedCert* cert, int nameType) cert->maxIdx) < 0) return ASN_PARSE_E; + if (strLen == 0) { + CYASSL_MSG("Zero length name"); + return ASN_PARSE_E; + } if (strLen > (int)(ASN_NAME_MAX - idx)) return ASN_PARSE_E;