]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Remove duplicate colon in otherName display
authorMathis Marion <mathis.marion@silabs.com>
Thu, 1 Aug 2024 07:59:49 +0000 (09:59 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 7 Aug 2024 17:53:49 +0000 (19:53 +0200)
The colon is already added in X509V3_EXT_val_prn(). In fact, the other
branches from i2v_GENERAL_NAME() do not include a trailing colon.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23428)

crypto/x509/v3_san.c
test/recipes/25-test_eai_data/san.ascii
test/recipes/25-test_eai_data/san.utf8

index 5eea2c011e2daf1b16415997be87310d40642314..4b75bca886074f4b01bb01fa3f2b0f15ba9e6710 100644 (file)
@@ -88,7 +88,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
         switch (OBJ_obj2nid(gen->d.otherName->type_id)) {
         case NID_id_on_SmtpUTF8Mailbox:
             if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
-                    || !x509v3_add_len_value_uchar("othername: SmtpUTF8Mailbox:",
+                    || !x509v3_add_len_value_uchar("othername: SmtpUTF8Mailbox",
                             gen->d.otherName->value->value.utf8string->data,
                             gen->d.otherName->value->value.utf8string->length,
                             &ret))
@@ -96,7 +96,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
             break;
         case NID_XmppAddr:
             if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
-                    || !x509v3_add_len_value_uchar("othername: XmppAddr:",
+                    || !x509v3_add_len_value_uchar("othername: XmppAddr",
                             gen->d.otherName->value->value.utf8string->data,
                             gen->d.otherName->value->value.utf8string->length,
                             &ret))
@@ -104,7 +104,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
             break;
         case NID_SRVName:
             if (gen->d.otherName->value->type != V_ASN1_IA5STRING
-                    || !x509v3_add_len_value_uchar("othername: SRVName:",
+                    || !x509v3_add_len_value_uchar("othername: SRVName",
                             gen->d.otherName->value->value.ia5string->data,
                             gen->d.otherName->value->value.ia5string->length,
                             &ret))
@@ -112,7 +112,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
             break;
         case NID_ms_upn:
             if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
-                    || !x509v3_add_len_value_uchar("othername: UPN:",
+                    || !x509v3_add_len_value_uchar("othername: UPN",
                             gen->d.otherName->value->value.utf8string->data,
                             gen->d.otherName->value->value.utf8string->length,
                             &ret))
@@ -120,7 +120,7 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
             break;
         case NID_NAIRealm:
             if (gen->d.otherName->value->type != V_ASN1_UTF8STRING
-                    || !x509v3_add_len_value_uchar("othername: NAIRealm:",
+                    || !x509v3_add_len_value_uchar("othername: NAIRealm",
                             gen->d.otherName->value->value.utf8string->data,
                             gen->d.otherName->value->value.utf8string->length,
                             &ret))
@@ -128,10 +128,10 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,
             break;
         default:
             if (OBJ_obj2txt(oline, sizeof(oline), gen->d.otherName->type_id, 0) > 0)
-                BIO_snprintf(othername, sizeof(othername), "othername: %s:",
+                BIO_snprintf(othername, sizeof(othername), "othername: %s",
                              oline);
             else
-                OPENSSL_strlcpy(othername, "othername:", sizeof(othername));
+                OPENSSL_strlcpy(othername, "othername", sizeof(othername));
 
             /* check if the value is something printable */
             if (gen->d.otherName->value->type == V_ASN1_IA5STRING) {
index e719e2660f00e05b54e61502340a81c8176c6eb1..15043655049a8ab0e7d6c85d97f0832418b32305 100644 (file)
@@ -1,2 +1,2 @@
 X509v3 Subject Alternative Name: 
-    othername: SmtpUTF8Mailbox::学生@elementary.school.example.com
+    othername: SmtpUTF8Mailbox:学生@elementary.school.example.com
index cf62d9dfbe63840fa2a91b429bf662008e504343..063ccc02e4cf56226c77c36ad03ea24bcc997c58 100644 (file)
@@ -1,2 +1,2 @@
 X509v3 Subject Alternative Name: 
-    othername: SmtpUTF8Mailbox::医生@大学.example.com
+    othername: SmtpUTF8Mailbox:医生@大学.example.com