- when getting certs from a p12 file, put the subject name into the cert labels

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1019 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-04-16 14:16:08 +00:00
parent 7cb9901113
commit be09dc97f3
1 changed files with 4 additions and 0 deletions

View File

@ -524,6 +524,7 @@ do_store_private_key(struct sc_profile *profile)
*/
for (i = 0; i < ncerts; i++) {
struct sc_pkcs15init_certargs cargs;
char namebuf[SC_PKCS15_MAX_LABEL_SIZE-1];
memset(&cargs, 0, sizeof(cargs));
/* Just the first certificate gets the same ID
@ -534,6 +535,9 @@ do_store_private_key(struct sc_profile *profile)
else
cargs.authority = 1;
cargs.label = X509_NAME_oneline(cert[i]->cert_info->subject,
namebuf, sizeof(namebuf));
cargs.x509_usage = cert[i]->ex_kusage;
r = do_convert_cert(&cargs.der_encoded, cert[i]);
if (r >= 0)