summaryrefslogtreecommitdiffstats
path: root/apps/pkcs12.c
diff options
context:
space:
mode:
authorViktor Dukhovni <openssl-users@dukhovni.org>2016-01-16 00:08:38 -0500
committerViktor Dukhovni <openssl-users@dukhovni.org>2016-01-20 19:04:26 -0500
commit0996dc5440cc233f029129182bbb6e3d4613045a (patch)
tree7b54822da3319212fc52d6b9e1d463c770fa0495 /apps/pkcs12.c
parent6e8beabcd4b9450a3a7358bf5668b2bc70580517 (diff)
Refactor apps load_certs/load_crls to work incrementally
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r--apps/pkcs12.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 33a58df524..2ede38491b 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -395,9 +395,8 @@ int pkcs12_main(int argc, char **argv)
/* Load in all certs in input file */
if (!(options & NOCERTS)) {
- certs = load_certs(infile, FORMAT_PEM, NULL, e,
- "certificates");
- if (!certs)
+ if (!load_certs(infile, &certs, FORMAT_PEM, NULL, e,
+ "certificates"))
goto export_end;
if (key) {
@@ -425,13 +424,9 @@ int pkcs12_main(int argc, char **argv)
/* Add any more certificates asked for */
if (certfile) {
- STACK_OF(X509) *morecerts = NULL;
- if ((morecerts = load_certs(certfile, FORMAT_PEM, NULL, e,
- "certificates from certfile")) == NULL)
+ if (!load_certs(certfile, &certs, FORMAT_PEM, NULL, e,
+ "certificates from certfile"))
goto export_end;
- while (sk_X509_num(morecerts) > 0)
- sk_X509_push(certs, sk_X509_shift(morecerts));
- sk_X509_free(morecerts);
}
/* If chaining get chain from user cert */