diff options
author | lloyd <[email protected]> | 2014-01-18 17:12:30 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2014-01-18 17:12:30 +0000 |
commit | 4917f26a2b154e841cd27c1bcecdd41d2bdeb6ce (patch) | |
tree | 0456ae4efcd748ececc83a35a6353373778e1291 /src/lib/pbe/get_pbe.cpp | |
parent | 560b7671685317035e724b4c75030dc5cf86f461 (diff) |
Remove PBES1 entirely
Diffstat (limited to 'src/lib/pbe/get_pbe.cpp')
-rw-r--r-- | src/lib/pbe/get_pbe.cpp | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/lib/pbe/get_pbe.cpp b/src/lib/pbe/get_pbe.cpp index 4ec518776..5cb5ccc88 100644 --- a/src/lib/pbe/get_pbe.cpp +++ b/src/lib/pbe/get_pbe.cpp @@ -11,10 +11,6 @@ #include <botan/parsing.h> #include <botan/libstate.h> -#if defined(BOTAN_HAS_PBE_PKCS_V15) - #include <botan/pbes1.h> -#endif - #if defined(BOTAN_HAS_PBE_PKCS_V20) #include <botan/pbes2.h> #include <botan/hmac.h> @@ -59,15 +55,6 @@ PBE* get_pbe(const std::string& algo_spec, if(request.arg_count() != 2) throw Invalid_Algorithm_Name(algo_spec); -#if defined(BOTAN_HAS_PBE_PKCS_V15) - if(pbe == "PBE-PKCS5v15") - return new PBE_PKCS5v15(block_cipher->clone(), - hash_function->clone(), - passphrase, - msec, - rng); -#endif - #if defined(BOTAN_HAS_PBE_PKCS_V20) if(pbe == "PBE-PKCS5v20") return new PBE_PKCS5v20(block_cipher->clone(), @@ -91,44 +78,6 @@ PBE* get_pbe(const OID& pbe_oid, const std::string pbe = request.algo_name(); -#if defined(BOTAN_HAS_PBE_PKCS_V15) - if(pbe == "PBE-PKCS5v15") - { - if(request.arg_count() != 2) - throw Invalid_Algorithm_Name(request.as_string()); - - std::string digest_name = request.arg(0); - const std::string cipher = request.arg(1); - - std::vector<std::string> cipher_spec = split_on(cipher, '/'); - if(cipher_spec.size() != 2) - throw Invalid_Argument("PBE: Invalid cipher spec " + cipher); - - const std::string cipher_algo = SCAN_Name::deref_alias(cipher_spec[0]); - const std::string cipher_mode = cipher_spec[1]; - - if(cipher_mode != "CBC") - throw Invalid_Argument("PBE: Invalid cipher mode " + cipher); - - Algorithm_Factory& af = global_state().algorithm_factory(); - - const BlockCipher* block_cipher = af.prototype_block_cipher(cipher_algo); - if(!block_cipher) - throw Algorithm_Not_Found(cipher_algo); - - const HashFunction* hash_function = - af.prototype_hash_function(digest_name); - - if(!hash_function) - throw Algorithm_Not_Found(digest_name); - - return new PBE_PKCS5v15(block_cipher->clone(), - hash_function->clone(), - params, - passphrase); - } -#endif - #if defined(BOTAN_HAS_PBE_PKCS_V20) if(pbe == "PBE-PKCS5v20") return new PBE_PKCS5v20(params, passphrase); |