diff options
Diffstat (limited to 'lib/x509/output.c')
-rw-r--r-- | lib/x509/output.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/x509/output.c b/lib/x509/output.c index c8b0c66ddb..705e8babfa 100644 --- a/lib/x509/output.c +++ b/lib/x509/output.c @@ -448,7 +448,9 @@ print_aki_gn_serial(gnutls_buffer_st * str, gnutls_x509_aki_t aki) err = gnutls_x509_aki_get_cert_issuer(aki, 0, &alt_type, &san, &other_oid, &serial); - if (err < 0) { + if (err == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { + return; + } else if (err < 0) { addf(str, "error: gnutls_x509_aki_get_cert_issuer: %s\n", gnutls_strerror(err)); return; @@ -481,10 +483,11 @@ static void print_aki(gnutls_buffer_st * str, gnutls_datum_t *der) goto cleanup; } + /* Check if an alternative name is there */ + print_aki_gn_serial(str, aki); + err = gnutls_x509_aki_get_id(aki, &id); if (err == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) { - /* Check if an alternative name is there */ - print_aki_gn_serial(str, aki); goto cleanup; } else if (err < 0) { addf(str, "error: gnutls_x509_aki_get_id: %s\n", @@ -1259,6 +1262,22 @@ static void print_extension(gnutls_buffer_st * str, const char *prefix, critical ? _("critical") : _("not critical")); print_issuer_sign_tool(str, prefix, der); + } else if (strcmp(oid, "2.5.4.3") == 0) { + int ret; + gnutls_datum_t tmp = {NULL, 0}; + + addf(str, _("%s\t\tCommon Name (%s):\n"), + prefix, + critical ? _("critical") : _("not critical")); + + ret = _gnutls_x509_decode_string(ASN1_ETYPE_PRINTABLE_STRING, der->data, der->size, &tmp, 0); + if (ret < 0) { + addf(str, "error: x509_decode_string: %s\n", + gnutls_strerror(ret)); + } else { + addf(str, "%s\t\t\t%s\n", prefix, tmp.data); + gnutls_free(tmp.data); + } } else { addf(str, _("%s\t\tUnknown extension %s (%s):\n"), prefix, oid, |