aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-08-23 04:21:43 -0400
committerJack Lloyd <[email protected]>2018-08-23 04:21:43 -0400
commit9a24b02e6dbff69f326a6a2a90272e238f2bb9df (patch)
treed4eeb60e98b1fecaf06a991d956a48efefebff84 /src/lib
parentd71ce2f9d53557a138e5ba6d6127de952e3aa735 (diff)
Add PBES2 as alias for PBE-PKCS5v20
Easier to remember and type.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/asn1/oid_maps.cpp3
-rw-r--r--src/lib/pubkey/pkcs8.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/asn1/oid_maps.cpp b/src/lib/asn1/oid_maps.cpp
index eb4e570db..146dc88f7 100644
--- a/src/lib/asn1/oid_maps.cpp
+++ b/src/lib/asn1/oid_maps.cpp
@@ -1,7 +1,7 @@
/*
* OID maps
*
-* This file was automatically generated by ./src/scripts/oids.py on 2018-08-01
+* This file was automatically generated by ./src/scripts/oids.py on 2018-08-23
*
* All manual edits to this file will be lost. Edit the script
* then regenerate this source file.
@@ -316,6 +316,7 @@ std::unordered_map<std::string, OID> OIDS::load_str2oid_map()
{ "OpenPGP.Curve25519", OID({1,3,6,1,4,1,3029,1,5,1}) },
{ "OpenPGP.Ed25519", OID({1,3,6,1,4,1,11591,15,1}) },
{ "PBE-PKCS5v20", OID({1,2,840,113549,1,5,13}) },
+ { "PBES2", OID({1,2,840,113549,1,5,13}) },
{ "PKCS5.PBKDF2", OID({1,2,840,113549,1,5,12}) },
{ "PKCS9.ChallengePassword", OID({1,2,840,113549,1,9,7}) },
{ "PKCS9.ContentType", OID({1,2,840,113549,1,9,3}) },
diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp
index c91e436c7..f6d50256d 100644
--- a/src/lib/pubkey/pkcs8.cpp
+++ b/src/lib/pubkey/pkcs8.cpp
@@ -167,7 +167,9 @@ choose_pbe_params(const std::string& pbe_algo, const std::string& key_algo)
}
SCAN_Name request(pbe_algo);
- if(request.algo_name() != "PBE-PKCS5v20" || request.arg_count() != 2)
+ if(request.arg_count() != 2)
+ throw Exception("Unsupported PBE " + pbe_algo);
+ if(request.algo_name() != "PBE-PKCS5v20" && request.algo_name() != "PBES2")
throw Exception("Unsupported PBE " + pbe_algo);
return std::make_pair(request.arg(0), request.arg(1));
}