Fix ASN1_STRING_to_UTF8 could not convert NumericString
authorMatt Caswell <matt@openssl.org>
Thu, 23 Jun 2016 18:54:06 +0000 (19:54 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 23 Jun 2016 19:49:43 +0000 (20:49 +0100)
tag2nbyte had -1 at 18th position, but underlying ASN1_mbstring_copy
supports NumericString. tag2nbyte is also used in do_print_ex which will
not be broken by setting 1 at 18th position of tag2nbyte

Reviewed-by: Stephen Henson <steve@openssl.org>
crypto/asn1/a_strex.c

index 59d51210c3cd59349b107ef5a5b2c22d85524044..d419e9d2ce4900b7fae9be4d54b0ef5c9c48936f 100644 (file)
@@ -282,7 +282,7 @@ static const signed char tag2nbyte[] = {
     -1, -1, -1, -1, -1,         /* 5-9 */
     -1, -1, 0, -1,              /* 10-13 */
     -1, -1, -1, -1,             /* 15-17 */
-    -1, 1, 1,                   /* 18-20 */
+    1, 1, 1,                    /* 18-20 */
     -1, 1, 1, 1,                /* 21-24 */
     -1, 1, -1,                  /* 25-27 */
     4, -1, 2                    /* 28-30 */