diff options
Diffstat (limited to 'src/pbe')
-rw-r--r-- | src/pbe/get_pbe.cpp | 10 | ||||
-rw-r--r-- | src/pbe/pbes2/pbes2.cpp | 6 | ||||
-rw-r--r-- | src/pbe/pbes2/pbes2.h | 2 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/pbe/get_pbe.cpp b/src/pbe/get_pbe.cpp index 5fa0291c8..961da4afc 100644 --- a/src/pbe/get_pbe.cpp +++ b/src/pbe/get_pbe.cpp @@ -42,11 +42,11 @@ PBE* get_pbe(const std::string& algo_spec) Algorithm_Factory& af = global_state().algorithm_factory(); - const BlockCipher* block_cipher = af.make_block_cipher(cipher_algo); + const BlockCipher* block_cipher = af.prototype_block_cipher(cipher_algo); if(!block_cipher) throw Algorithm_Not_Found(cipher_algo); - const HashFunction* hash_function = af.make_hash_function(digest_name); + const HashFunction* hash_function = af.prototype_hash_function(digest_name); if(!hash_function) throw Algorithm_Not_Found(digest_name); @@ -99,11 +99,13 @@ PBE* get_pbe(const OID& pbe_oid, DataSource& params) Algorithm_Factory& af = global_state().algorithm_factory(); - const BlockCipher* block_cipher = af.make_block_cipher(cipher_algo); + const BlockCipher* block_cipher = af.prototype_block_cipher(cipher_algo); if(!block_cipher) throw Algorithm_Not_Found(cipher_algo); - const HashFunction* hash_function = af.make_hash_function(digest_name); + const HashFunction* hash_function = + af.prototype_hash_function(digest_name); + if(!hash_function) throw Algorithm_Not_Found(digest_name); diff --git a/src/pbe/pbes2/pbes2.cpp b/src/pbe/pbes2/pbes2.cpp index 3935bd702..e4d11eda5 100644 --- a/src/pbe/pbes2/pbes2.cpp +++ b/src/pbe/pbes2/pbes2.cpp @@ -228,4 +228,10 @@ PBE_PKCS5v20::PBE_PKCS5v20(DataSource& params) : direction(DECRYPTION) decode_params(params); } +PBE_PKCS5v20::~PBE_PKCS5v20() + { + delete hash_function; + delete block_cipher; + } + } diff --git a/src/pbe/pbes2/pbes2.h b/src/pbe/pbes2/pbes2.h index 984d5ad4a..a07fcca68 100644 --- a/src/pbe/pbes2/pbes2.h +++ b/src/pbe/pbes2/pbes2.h @@ -27,6 +27,8 @@ class BOTAN_DLL PBE_PKCS5v20 : public PBE PBE_PKCS5v20(DataSource&); PBE_PKCS5v20(BlockCipher*, HashFunction*); + + ~PBE_PKCS5v20(); private: void set_key(const std::string&); void new_params(RandomNumberGenerator& rng); |