remove 'keyid:' when printing simple X509 authority keyID (without issuer and serial)
authorDavid von Oheimb <David.von.Oheimb@siemens.com>
Mon, 29 Jan 2018 15:58:07 +0000 (16:58 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 18 Mar 2019 17:20:23 +0000 (17:20 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6226)

crypto/x509v3/v3_akey.c

index 78218d5695e81f4f1f59c243a982e7543618f485..b656b4b5029fe8a74249e8f184924ecfcc68194c 100644 (file)
@@ -42,7 +42,7 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method,
     char *tmp;
     if (akeyid->keyid) {
         tmp = OPENSSL_buf2hexstr(akeyid->keyid->data, akeyid->keyid->length);
-        X509V3_add_value("keyid", tmp, &extlist);
+        X509V3_add_value((akeyid->issuer || akeyid->serial) ? "keyid" : NULL, tmp, &extlist);
         OPENSSL_free(tmp);
     }
     if (akeyid->issuer)