summaryrefslogtreecommitdiffstats
path: root/apps/pkcs12.c
diff options
context:
space:
mode:
authorHubert Kario <hkario@redhat.com>2017-07-26 16:27:06 +0200
committerRich Salz <rsalz@openssl.org>2017-07-26 15:04:54 -0400
commit75f163d33575bac299258cea58e1da80fba01769 (patch)
tree13b25c0a4629d65371bbe2baa97a895f7d5c4378 /apps/pkcs12.c
parent7eb370ee15715c8fc84582d08d1b1be539d948f6 (diff)
handle scrypt PBKDF in PKCS#12 files info
Print the parameters for scrypt PBKDF when used in PKCS#12 files. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1334)
Diffstat (limited to 'apps/pkcs12.c')
-rw-r--r--apps/pkcs12.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 122dcab10a..e8c1c87cb3 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -819,6 +819,22 @@ static int alg_print(const X509_ALGOR *alg)
BIO_printf(bio_err, ", Iteration %ld, PRF %s",
ASN1_INTEGER_get(kdf->iter), OBJ_nid2sn(prfnid));
PBKDF2PARAM_free(kdf);
+ } else if (pbenid == NID_id_scrypt) {
+ SCRYPT_PARAMS *kdf = NULL;
+
+ if (aparamtype == V_ASN1_SEQUENCE)
+ kdf = ASN1_item_unpack(aparam, ASN1_ITEM_rptr(SCRYPT_PARAMS));
+ if (kdf == NULL) {
+ BIO_puts(bio_err, ", <unsupported parameters>");
+ goto done;
+ }
+ BIO_printf(bio_err, ", Salt length: %d, Cost(N): %ld, "
+ "Block size(r): %ld, Paralelizm(p): %ld",
+ ASN1_STRING_length(kdf->salt),
+ ASN1_INTEGER_get(kdf->costParameter),
+ ASN1_INTEGER_get(kdf->blockSize),
+ ASN1_INTEGER_get(kdf->parallelizationParameter));
+ SCRYPT_PARAMS_free(kdf);
}
PBE2PARAM_free(pbe2);
} else {