diff options
author | Jon Spillett <jon.spillett@oracle.com> | 2019-09-19 07:39:13 +0200 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-08-06 23:59:48 +0200 |
commit | c5ec6dcf0bdd15354a1440632766e19540487c58 (patch) | |
tree | c95f50468b0d3470ceaf7f5025db6b4fbc4d83b2 /apps/pkcs12.c | |
parent | apps/pkcs12: Change defaults from RC2 to PBES2 with PBKDF2 (diff) | |
download | openssl-c5ec6dcf0bdd15354a1440632766e19540487c58.tar.xz openssl-c5ec6dcf0bdd15354a1440632766e19540487c58.zip |
Add new APIs to get PKCS12 secretBag OID and value
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10063)
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r-- | apps/pkcs12.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c index 3398250efd..46340c0d25 100644 --- a/apps/pkcs12.c +++ b/apps/pkcs12.c @@ -789,6 +789,16 @@ int dump_certs_pkeys_bag(BIO *out, const PKCS12_SAFEBAG *bag, X509_free(x509); break; + case NID_secretBag: + if (options & INFO) + BIO_printf(bio_err, "Secret bag\n"); + print_attribs(out, attrs, "Bag Attributes"); + BIO_printf(bio_err, "Bag Type: "); + i2a_ASN1_OBJECT(bio_err, PKCS12_SAFEBAG_get0_bag_type(bag)); + BIO_printf(bio_err, "\nBag Value: "); + print_attribute(out, PKCS12_SAFEBAG_get0_bag_obj(bag)); + return 1; + case NID_safeContentsBag: if (options & INFO) BIO_printf(bio_err, "Safe Contents bag\n"); @@ -954,6 +964,10 @@ void print_attribute(BIO *out, const ASN1_TYPE *av) OPENSSL_free(value); break; + case V_ASN1_UTF8STRING: + BIO_printf(out, "%s\n", av->value.utf8string->data); + break; + case V_ASN1_OCTET_STRING: hex_prin(out, av->value.octet_string->data, av->value.octet_string->length); |