a_strex.c: improve documentation of 'tag2nbyte' lookup table

The 'tag2nbyte' lookup table maps the tags of ASN1 string types
to their respective character widths. It is used for example by
ASN1_STRING_to_UTF8(). This commit adds the tag names as comments.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6062)
This commit is contained in:
Dr. Matthias St. Pierre 2018-04-20 17:55:02 +02:00
parent 39df51522b
commit d8f436f3cf

View file

@ -281,12 +281,22 @@ static int do_dump(unsigned long lflags, char_io *io_ch, void *arg,
static const signed char tag2nbyte[] = {
-1, -1, -1, -1, -1, /* 0-4 */
-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, 1, /* 21-24 */
-1, 1, -1, /* 25-27 */
4, -1, 2 /* 28-30 */
-1, -1, /* 10-11 */
0, /* 12 V_ASN1_UTF8STRING */
-1, -1, -1, -1, -1, /* 13-17 */
1, /* 18 V_ASN1_NUMERICSTRING */
1, /* 19 V_ASN1_PRINTABLESTRING */
1, /* 20 V_ASN1_T61STRING */
-1, /* 21 */
1, /* 22 V_ASN1_IA5STRING */
1, /* 23 V_ASN1_UTCTIME */
1, /* 24 V_ASN1_GENERALIZEDTIME */
-1, /* 25 */
1, /* 26 V_ASN1_ISO64STRING */
-1, /* 27 */
4, /* 28 V_ASN1_UNIVERSALSTRING */
-1, /* 29 */
2 /* 30 V_ASN1_BMPSTRING */
};
/*