aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey/pkcs8.cpp
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/pubkey/pkcs8.cpp
parentd71ce2f9d53557a138e5ba6d6127de952e3aa735 (diff)
Add PBES2 as alias for PBE-PKCS5v20
Easier to remember and type.
Diffstat (limited to 'src/lib/pubkey/pkcs8.cpp')
-rw-r--r--src/lib/pubkey/pkcs8.cpp4
1 files changed, 3 insertions, 1 deletions
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));
}