diff options
author | lloyd <[email protected]> | 2008-10-26 21:02:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-10-26 21:02:33 +0000 |
commit | a5572385088e399eecf5531074aecabadf24d611 (patch) | |
tree | 2735cbd23715bff478ca9f004e94ac6287e32f7e /src/libstate | |
parent | 9b7cd20217d1134754daf2b2046249607ab7a3a7 (diff) |
Remove lookup.h use from OpenPGP S2K
Diffstat (limited to 'src/libstate')
-rw-r--r-- | src/libstate/def_alg.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libstate/def_alg.cpp b/src/libstate/def_alg.cpp index 6f89fa121..3c3cc5f7a 100644 --- a/src/libstate/def_alg.cpp +++ b/src/libstate/def_alg.cpp @@ -275,14 +275,6 @@ namespace Botan { throw Invalid_Algorithm_Name(algo_spec); \ } -#define HANDLE_TYPE_ONE_STRING(NAME, TYPE) \ - if(algo_name == NAME) \ - { \ - if(name.size() == 2) \ - return new TYPE(name[1]); \ - throw Invalid_Algorithm_Name(algo_spec); \ - } - /************************************************* * Look for an algorithm with this name * *************************************************/ @@ -629,7 +621,12 @@ S2K* Default_Engine::find_s2k(const std::string& algo_spec) const #endif #if defined(BOTAN_HAS_PGPS2K) - HANDLE_TYPE_ONE_STRING("OpenPGP-S2K", OpenPGP_S2K); + if(algo_name == "OpenPGP-S2K") + { + if(name.size() == 2) + return new OpenPGP_S2K(get_hash(name[1])); + throw Invalid_Algorithm_Name(algo_spec); + } #endif return 0; |