Replace BIO_printf with ASN1_STRING_print in GENERAL_NAME_print
authorAcheev Bhagat <acheevbhagat@hotmail.com>
Fri, 7 Jun 2019 00:05:49 +0000 (20:05 -0400)
committerDr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Fri, 7 Jun 2019 07:09:48 +0000 (09:09 +0200)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/9101)

(cherry picked from commit bab6046146c4fc8f088c1aaca11598ede7609c04)

crypto/x509v3/v3_alt.c

index 832e6d1285712ee9ad481492657761f64c0bdc36..c357721bd6ff94ab610c62a5825c28b7b307dd61 100644 (file)
@@ -157,15 +157,18 @@ int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen)
         break;
 
     case GEN_EMAIL:
-        BIO_printf(out, "email:%s", gen->d.ia5->data);
+        BIO_printf(out, "email:");
+        ASN1_STRING_print(out, gen->d.ia5);
         break;
 
     case GEN_DNS:
-        BIO_printf(out, "DNS:%s", gen->d.ia5->data);
+        BIO_printf(out, "DNS:");
+        ASN1_STRING_print(out, gen->d.ia5);
         break;
 
     case GEN_URI:
-        BIO_printf(out, "URI:%s", gen->d.ia5->data);
+        BIO_printf(out, "URI:");
+        ASN1_STRING_print(out, gen->d.ia5);
         break;
 
     case GEN_DIRNAME: