Use subject name as friendly name if there is no friendly name for certificate.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23072 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-04-23 11:11:20 +00:00
parent 2dff9d5af2
commit 5f7508dfc1

View File

@@ -2491,8 +2491,16 @@ hx509_cert_get_friendly_name(hx509_cert cert)
a = hx509_cert_get_attribute(cert, oid_id_pkcs_9_at_friendlyName()); a = hx509_cert_get_attribute(cert, oid_id_pkcs_9_at_friendlyName());
if (a == NULL) { if (a == NULL) {
/* XXX use subject name ? */ hx509_name name;
ret = hx509_cert_get_subject(cert, &name);
if (ret)
return NULL; return NULL;
ret = hx509_name_to_string(name, &cert->friendlyname);
hx509_name_free(&name);
if (ret)
return NULL;
return cert->friendlyname;
} }
ret = decode_PKCS9_friendlyName(a->data.data, a->data.length, &n, &sz); ret = decode_PKCS9_friendlyName(a->data.data, a->data.length, &n, &sz);