PR: 2742
[openssl.git] / crypto / asn1 / asn1_par.c
index 938a7915ef083dd17225dc72ac15a4fbf563fdca..aaca69aebd94ca286bac91742f5db55957674109 100644 (file)
@@ -206,6 +206,8 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offse
                                (tag == V_ASN1_T61STRING) ||
                                (tag == V_ASN1_IA5STRING) ||
                                (tag == V_ASN1_VISIBLESTRING) ||
+                               (tag == V_ASN1_NUMERICSTRING) ||
+                               (tag == V_ASN1_UTF8STRING) ||
                                (tag == V_ASN1_UTCTIME) ||
                                (tag == V_ASN1_GENERALIZEDTIME))
                                {
@@ -237,7 +239,7 @@ static int asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offse
                                ii=d2i_ASN1_BOOLEAN(NULL,&opp,len+hl);
                                if (ii < 0)
                                        {
-                                       if (BIO_write(bp,"Bad boolean\n",12))
+                                       if (BIO_write(bp,"Bad boolean\n",12) <= 0)
                                                goto end;
                                        }
                                BIO_printf(bp,":%d",ii);
@@ -415,7 +417,7 @@ end:
 
 const char *ASN1_tag2str(int tag)
 {
-       static const char *tag2str[] = {
+       static const char * const tag2str[] = {
         "EOC", "BOOLEAN", "INTEGER", "BIT STRING", "OCTET STRING", /* 0-4 */
         "NULL", "OBJECT", "OBJECT DESCRIPTOR", "EXTERNAL", "REAL", /* 5-9 */
         "ENUMERATED", "<ASN1 11>", "UTF8STRING", "<ASN1 13>",      /* 10-13 */