} else if (!strcmp (*args, "-caname")) {
if (args[1]) {
args++;
- if (!canames) canames = sk_new(NULL);
+ if (!canames) canames = sk_new_null();
sk_push(canames, *args);
} else badarg = 1;
} else if (!strcmp (*args, "-in")) {
CRYPTO_push_info("reading certs from input");
#endif
- certs = sk_X509_new(NULL);
+ certs = sk_X509_new_null();
/* Load in all certs in input file */
if(!cert_load(in, certs)) {
}
}
if(!keyidlen) {
+ ucert = NULL;
BIO_printf(bio_err, "No certificate matches private key\n");
goto export_end;
}
CRYPTO_push_info("reading certs from certfile");
#endif
- bags = sk_PKCS12_SAFEBAG_new (NULL);
+ bags = sk_PKCS12_SAFEBAG_new_null ();
/* Add any more certificates asked for */
if (certsin) {
}
sk_X509_pop_free(certs, X509_free);
certs = NULL;
+ /* ucert is part of certs so it is already freed */
+ ucert = NULL;
#ifdef CRYPTO_MDEBUG
CRYPTO_pop_info();
goto export_end;
}
- safes = sk_PKCS7_new (NULL);
+ safes = sk_PKCS7_new_null ();
sk_PKCS7_push (safes, authsafe);
#ifdef CRYPTO_MDEBUG
p8 = NULL;
if (name) PKCS12_add_friendlyname (bag, name, -1);
PKCS12_add_localkeyid (bag, keyid, keyidlen);
- bags = sk_PKCS12_SAFEBAG_new(NULL);
+ bags = sk_PKCS12_SAFEBAG_new_null();
sk_PKCS12_SAFEBAG_push (bags, bag);
#ifdef CRYPTO_MDEBUG
if (certs) sk_X509_pop_free(certs, X509_free);
if (safes) sk_PKCS7_pop_free(safes, PKCS7_free);
if (bags) sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
+ if (ucert) X509_free(ucert);
#ifdef CRYPTO_MDEBUG
CRYPTO_pop_info();
break;
case V_ASN1_OCTET_STRING:
- hex_prin(out, av->value.bit_string->data,
- av->value.bit_string->length);
+ hex_prin(out, av->value.octet_string->data,
+ av->value.octet_string->length);
BIO_printf(out, "\n");
break;
case V_ASN1_BIT_STRING:
- hex_prin(out, av->value.octet_string->data,
- av->value.octet_string->length);
+ hex_prin(out, av->value.bit_string->data,
+ av->value.bit_string->length);
BIO_printf(out, "\n");
break;