aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
parentd71ce2f9d53557a138e5ba6d6127de952e3aa735 (diff)
Add PBES2 as alias for PBE-PKCS5v20
Easier to remember and type.
Diffstat (limited to 'src')
-rw-r--r--src/build-data/oids.txt1
-rw-r--r--src/lib/asn1/oid_maps.cpp3
-rw-r--r--src/lib/pubkey/pkcs8.cpp4
-rw-r--r--src/tests/test_pubkey.cpp2
4 files changed, 7 insertions, 3 deletions
diff --git a/src/build-data/oids.txt b/src/build-data/oids.txt
index feea6ef7d..3dc544c2e 100644
--- a/src/build-data/oids.txt
+++ b/src/build-data/oids.txt
@@ -210,6 +210,7 @@
[pbe]
1.2.840.113549.1.5.12 = PKCS5.PBKDF2
+1.2.840.113549.1.5.13 = PBES2
1.2.840.113549.1.5.13 = PBE-PKCS5v20
1.3.6.1.4.1.11591.4.11 = Scrypt
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));
}
diff --git a/src/tests/test_pubkey.cpp b/src/tests/test_pubkey.cpp
index 765e7e396..20bdc73ac 100644
--- a/src/tests/test_pubkey.cpp
+++ b/src/tests/test_pubkey.cpp
@@ -712,7 +712,7 @@ std::vector<Test::Result> PK_Key_Generation_Test::run()
#if defined(BOTAN_HAS_PKCS5_PBES2) && defined(BOTAN_HAS_AES) && defined(BOTAN_HAS_SCRYPT)
- test_pbe_roundtrip(result, key, "PBE-PKCS5v20(AES-128/CBC,Scrypt)", Test::random_password());
+ test_pbe_roundtrip(result, key, "PBES2(AES-128/CBC,Scrypt)", Test::random_password());
#endif
}