From be09dc97f3a7192269cc243c5cc7db7bccc9bc1f Mon Sep 17 00:00:00 2001 From: okir Date: Wed, 16 Apr 2003 14:16:08 +0000 Subject: [PATCH] - 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 --- src/tools/pkcs15-init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/pkcs15-init.c b/src/tools/pkcs15-init.c index 124b1149..d700a2a1 100644 --- a/src/tools/pkcs15-init.c +++ b/src/tools/pkcs15-init.c @@ -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)