diff options
author | Richard Levitte <levitte@openssl.org> | 2001-06-25 14:23:36 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-06-25 14:23:36 +0000 |
commit | 7953b8ff1b1a60c50fa56543b78d37bd0ca66490 (patch) | |
tree | 5517ba35fbec607ea26feea6ab4958e1c6958fcd /apps/pkcs8.c | |
parent | b1460627f30ac4a315b87c5b00b8363b11bcf673 (diff) |
Make better use of load_cert, load_certs and load_key.
Diffstat (limited to 'apps/pkcs8.c')
-rw-r--r-- | apps/pkcs8.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/apps/pkcs8.c b/apps/pkcs8.c index 5e20a2be70..cfc4851e00 100644 --- a/apps/pkcs8.c +++ b/apps/pkcs8.c @@ -217,21 +217,13 @@ int MAIN(int argc, char **argv) } #endif } - if (topk8) { - if(informat == FORMAT_PEM) - pkey = PEM_read_bio_PrivateKey(in, NULL, NULL, passin); - else if(informat == FORMAT_ASN1) - pkey = d2i_PrivateKey_bio(in, NULL); - else { - BIO_printf(bio_err, "Bad format specified for key\n"); - return (1); - } + if (topk8) + { + BIO_free(in); /* Not needed in this section */ + pkey = load_key(bio_err, infile, informat, passin, e, "key"); if (!pkey) { - BIO_printf(bio_err, "Error reading key\n", outfile); - ERR_print_errors(bio_err); return (1); } - BIO_free(in); if (!(p8inf = EVP_PKEY2PKCS8_broken(pkey, p8_broken))) { BIO_printf(bio_err, "Error converting key\n", outfile); ERR_print_errors(bio_err); |