diff options
Diffstat (limited to 'src/lib/pbkdf/pbkdf.cpp')
-rw-r--r-- | src/lib/pbkdf/pbkdf.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/pbkdf/pbkdf.cpp b/src/lib/pbkdf/pbkdf.cpp index a60c93d5c..40610998b 100644 --- a/src/lib/pbkdf/pbkdf.cpp +++ b/src/lib/pbkdf/pbkdf.cpp @@ -16,6 +16,10 @@ #include <botan/pbkdf2.h> #endif +#if defined(BOTAN_HAS_PGP_S2K) +#include <botan/pgp_s2k.h> +#endif + namespace Botan { std::unique_ptr<PBKDF> PBKDF::create(const std::string& algo_spec, @@ -50,6 +54,14 @@ std::unique_ptr<PBKDF> PBKDF::create(const std::string& algo_spec, } #endif +#if defined(BOTAN_HAS_PGP_S2K) + if(req.algo_name() == "OpenPGP-S2K" && req.arg_count() == 1) + { + if(auto hash = HashFunction::create(req.arg(0))) + return std::unique_ptr<PBKDF>(new OpenPGP_S2K(hash.release())); + } +#endif + BOTAN_UNUSED(req); BOTAN_UNUSED(provider); |