summaryrefslogtreecommitdiffstats
path: root/apps/pkcs12.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-10-05 12:57:50 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-10-05 12:57:50 +0000
commit2d681b779cf0936b441914eabff301e3b036f6a2 (patch)
tree2512d3556656d5790fbac5acf04a5e752b7b1a06 /apps/pkcs12.c
parent3908cdf442e3394ee7fa52b46d8715796ca5ea6a (diff)
Fix for bug in pkcs12 program and typo in ASN1_tag2str().
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r--apps/pkcs12.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 5defddeb32..f6b444b5f6 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -281,13 +281,13 @@ int MAIN(int argc, char **argv)
}
}
-if (export_cert) {
+ if (export_cert) {
EVP_PKEY *key;
STACK *bags, *safes;
PKCS12_SAFEBAG *bag;
PKCS8_PRIV_KEY_INFO *p8;
PKCS7 *authsafe;
- X509 *cert = NULL, *ucert = NULL;
+ X509 *ucert = NULL;
STACK_OF(X509) *certs;
char *catmp;
int i;
@@ -313,7 +313,7 @@ if (export_cert) {
for(i = 0; i < sk_X509_num(certs); i++) {
ucert = sk_X509_value(certs, i);
if(X509_check_private_key(ucert, key)) {
- X509_digest(cert, EVP_sha1(), keyid, &keyidlen);
+ X509_digest(ucert, EVP_sha1(), keyid, &keyidlen);
break;
}
}
@@ -354,6 +354,7 @@ if (export_cert) {
/* We now have loads of certificates: include them all */
for(i = 0; i < sk_X509_num(certs); i++) {
+ X509 *cert = NULL;
cert = sk_X509_value(certs, i);
bag = M_PKCS12_x5092certbag(cert);
/* If it matches private key set id */