summaryrefslogtreecommitdiffstats
path: root/apps/pkcs8.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2014-02-28 17:23:54 +0000
committerDr. Stephen Henson <steve@openssl.org>2014-03-01 23:16:08 +0000
commit5693a30813a031d3921a016a870420e7eb93ec90 (patch)
tree0a9f590ad64e6df7d64a732e7f0c18f302e5b537 /apps/pkcs8.c
parent01757858feb3590b175b40d7e0e73da8255d6c50 (diff)
PKCS#8 support for alternative PRFs.
Add option to set an alternative to the default hmacWithSHA1 PRF for PKCS#8 private key encryptions. This is used automatically by PKCS8_encrypt if the nid specified is a PRF. Add option to pkcs8 utility. Update docs. (cherry picked from commit b60272b01fcb4f69201b3e1659b4f7e9e9298dfb)
Diffstat (limited to 'apps/pkcs8.c')
-rw-r--r--apps/pkcs8.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/pkcs8.c b/apps/pkcs8.c
index 7edeb179dd..dc9e1ef66f 100644
--- a/apps/pkcs8.c
+++ b/apps/pkcs8.c
@@ -135,6 +135,22 @@ int MAIN(int argc, char **argv)
else
badarg = 1;
}
+ else if (!strcmp(*args,"-v2prf"))
+ {
+ if (args[1])
+ {
+ args++;
+ pbe_nid=OBJ_txt2nid(*args);
+ if (!EVP_PBE_find(EVP_PBE_TYPE_PRF, pbe_nid, NULL, NULL, 0))
+ {
+ BIO_printf(bio_err,
+ "Unknown PRF algorithm %s\n", *args);
+ badarg = 1;
+ }
+ }
+ else
+ badarg = 1;
+ }
else if (!strcmp(*args,"-inform"))
{
if (args[1])