diff options
author | lloyd <[email protected]> | 2008-06-30 04:34:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-06-30 04:34:54 +0000 |
commit | 32937ed3ab5cb51ad175d602d466cbb9dfe917ad (patch) | |
tree | c15176e5584044a9f77ba7e04d64eb542ed25b5d /src/pbes2.cpp | |
parent | 517ba1ba8f7659f8d35ee2912709fb54d4ec6b2e (diff) |
Remove the free-standing function deref_alias. It only served as a forwarder
for the implementation in Library_State. Instead explicitly call deref_alias
on global_state() wherever the old freestanding version was used. This serves
to make (more) uses of the global state explicit rather than implicit.
Diffstat (limited to 'src/pbes2.cpp')
-rw-r--r-- | src/pbes2.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pbes2.cpp b/src/pbes2.cpp index 62913abac..d3533f14f 100644 --- a/src/pbes2.cpp +++ b/src/pbes2.cpp @@ -4,6 +4,7 @@ *************************************************/ #include <botan/pbe_pkcs.h> +#include <botan/libstate.h> #include <botan/der_enc.h> #include <botan/ber_dec.h> #include <botan/parsing.h> @@ -155,7 +156,7 @@ void PBE_PKCS5v20::decode_params(DataSource& source) std::vector<std::string> cipher_spec = split_on(cipher, '/'); if(cipher_spec.size() != 2) throw Decoding_Error("PBE-PKCS5 v2.0: Invalid cipher spec " + cipher); - cipher_algo = deref_alias(cipher_spec[0]); + cipher_algo = global_state().deref_alias(cipher_spec[0]); if(!known_cipher(cipher_algo) || cipher_spec[1] != "CBC") throw Decoding_Error("PBE-PKCS5 v2.0: Don't know param format for " + @@ -195,12 +196,14 @@ bool PBE_PKCS5v20::known_cipher(const std::string& algo) const *************************************************/ PBE_PKCS5v20::PBE_PKCS5v20(const std::string& d_algo, const std::string& c_algo) : - direction(ENCRYPTION), digest(deref_alias(d_algo)), cipher(c_algo) + direction(ENCRYPTION), + digest(global_state().deref_alias(d_algo)), + cipher(c_algo) { std::vector<std::string> cipher_spec = split_on(cipher, '/'); if(cipher_spec.size() != 2) throw Invalid_Argument("PBE-PKCS5 v2.0: Invalid cipher spec " + cipher); - cipher_algo = deref_alias(cipher_spec[0]); + cipher_algo = global_state().deref_alias(cipher_spec[0]); const std::string cipher_mode = cipher_spec[1]; if(!have_block_cipher(cipher_algo)) |