diff options
-rw-r--r-- | checks/validate.dat | 5 | ||||
-rw-r--r-- | src/libstate/get_enc.cpp | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/checks/validate.dat b/checks/validate.dat index 594f7ed2f..d6d9c6699 100644 --- a/checks/validate.dat +++ b/checks/validate.dat @@ -60664,6 +60664,11 @@ C9A0B2622F13916036E29E7462E206E8BA5B50CE9212752EB8EA2A4AA7B40A4CC1BF:\ 350381FADEAEB560DC447AFC68A6B47E6EA1E7412F6CF7B2D82342FCCD11D3B4:\ A39B76C6EEC8374A11493AD08C246A3E40DFAE5064F4EE3489C273646178:64:1000 +[PBKDF2(CMAC(Blowfish))] +7871796668727865686965646C6865776E76626A:\ +43734BADB91F5D89DB20B469CD2EF376CAABC226EE3952872050428EFB5E3026:\ +24A1A50B17D63EE8394B69FC70887F4F94883D68:32:5 + # MARKER: Encoders/Decoders # Format is input:output diff --git a/src/libstate/get_enc.cpp b/src/libstate/get_enc.cpp index a825a5d24..1176061c2 100644 --- a/src/libstate/get_enc.cpp +++ b/src/libstate/get_enc.cpp @@ -15,7 +15,6 @@ #if defined(BOTAN_HAS_PBKDF2) #include <botan/pbkdf2.h> - #include <botan/hmac.h> #endif #if defined(BOTAN_HAS_PGPS2K) @@ -96,7 +95,12 @@ PBKDF* get_pbkdf(const std::string& algo_spec) #if defined(BOTAN_HAS_PBKDF2) if(request.algo_name() == "PBKDF2" && request.arg_count() == 1) - return new PKCS5_PBKDF2(new HMAC(af.make_hash_function(request.arg(0)))); + { + if(const MessageAuthenticationCode* mac_proto = af.prototype_mac(request.arg(0))) + return new PKCS5_PBKDF2(mac_proto->clone()); + + return new PKCS5_PBKDF2(af.make_mac("HMAC(" + request.arg(0) + ")")); + } #endif #if defined(BOTAN_HAS_PGPS2K) |