From: David von Oheimb <David.von.Oheimb@siemens.com>
Date: Mon, 29 Jan 2018 15:58:07 +0000 (+0100)
Subject: remove 'keyid:' when printing simple X509 authority keyID (without issuer and serial)
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86afd005fb8184e37c41d85128a01b58ac152d60;p=openssl

remove 'keyid:' when printing simple X509 authority keyID (without issuer and serial)

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6226)
---

diff --git a/crypto/x509v3/v3_akey.c b/crypto/x509v3/v3_akey.c
index 78218d5695..b656b4b502 100644
--- a/crypto/x509v3/v3_akey.c
+++ b/crypto/x509v3/v3_akey.c
@@ -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)