diff options
Diffstat (limited to 'src/constructs/passhash/passhash9.cpp')
-rw-r--r-- | src/constructs/passhash/passhash9.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/constructs/passhash/passhash9.cpp b/src/constructs/passhash/passhash9.cpp index 9e5ff3257..b869e2812 100644 --- a/src/constructs/passhash/passhash9.cpp +++ b/src/constructs/passhash/passhash9.cpp @@ -37,8 +37,14 @@ MessageAuthenticationCode* get_pbkdf_prf(byte alg_id) std::pair<byte, MessageAuthenticationCode*> choose_pbkdf_prf() { - byte alg_id = 0; - return std::make_pair(alg_id, get_pbkdf_prf(alg_id)); + for(byte alg_id = 0; alg_id != 255; ++alg_id) + { + MessageAuthenticationCode* prf = get_pbkdf_prf(alg_id); + if(prf) + return std::make_pair(alg_id, prf); + } + + throw Internal_Error("Passhash9: No PRF available"); } } |