summaryrefslogtreecommitdiffstats
path: root/crypto/pkcs12/p12_crt.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2000-03-22 13:50:23 +0000
committerDr. Stephen Henson <steve@openssl.org>2000-03-22 13:50:23 +0000
commite77066ea0a1a339a22bd5226eb08f139f67e96fe (patch)
treed71e9ef514b5cea0512376b563665c2949253b33 /crypto/pkcs12/p12_crt.c
parentd12cd419009ed7b57245ac9ba65df06705aa259f (diff)
Fix a memory leak in PKCS12_parse.
Don't copy private key to X509 etc public key structures. Fix for warning.
Diffstat (limited to 'crypto/pkcs12/p12_crt.c')
-rw-r--r--crypto/pkcs12/p12_crt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/pkcs12/p12_crt.c b/crypto/pkcs12/p12_crt.c
index 56d88b0759..ee8aed54c7 100644
--- a/crypto/pkcs12/p12_crt.c
+++ b/crypto/pkcs12/p12_crt.c
@@ -61,7 +61,7 @@
#include <openssl/pkcs12.h>
PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
- STACK *ca, int nid_key, int nid_cert, int iter, int mac_iter,
+ STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter, int mac_iter,
int keytype)
{
PKCS12 *p12;
@@ -103,8 +103,8 @@ PKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,
/* Add all other certificates */
if(ca) {
- for(i = 0; i < sk_num(ca); i++) {
- tcert = (X509 *)sk_value(ca, i);
+ for(i = 0; i < sk_X509_num(ca); i++) {
+ tcert = sk_X509_value(ca, i);
if(!(bag = M_PKCS12_x5092certbag(tcert))) return NULL;
if(!sk_push(bags, (char *)bag)) {
PKCS12err(PKCS12_F_PKCS12_CREATE,ERR_R_MALLOC_FAILURE);