summaryrefslogtreecommitdiffstats
path: root/apps/pkcs12.c
diff options
context:
space:
mode:
authorJon Spillett <jon.spillett@oracle.com>2019-09-19 15:39:13 +1000
committerPauli <paul.dale@oracle.com>2020-08-07 07:59:48 +1000
commitc5ec6dcf0bdd15354a1440632766e19540487c58 (patch)
treec95f50468b0d3470ceaf7f5025db6b4fbc4d83b2 /apps/pkcs12.c
parent15c9aa3aef77c642ef2b6c84bba2b57b35ed083e (diff)
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.c14
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);