aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-08-19 09:02:25 -0400
committerJack Lloyd <[email protected]>2017-08-19 09:02:25 -0400
commit4f2e19db300bc77672feb86925bcd7321ca4ed96 (patch)
tree6165c754f26c0e04f1ad214e5224b5c63d7c494e /src/lib
parente2a23743ccc71ee3e34505802ce70fca7f679e75 (diff)
parent51f92a09d29f68e0b1e2439e23f8f40aa4b80d48 (diff)
Merge GH #1154 Add check for passhash9 algo being available in tests
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/passhash/passhash9/passhash9.cpp9
-rw-r--r--src/lib/passhash/passhash9/passhash9.h6
2 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/passhash/passhash9/passhash9.cpp b/src/lib/passhash/passhash9/passhash9.cpp
index fef23515b..e78ac5012 100644
--- a/src/lib/passhash/passhash9/passhash9.cpp
+++ b/src/lib/passhash/passhash9/passhash9.cpp
@@ -127,4 +127,13 @@ bool check_passhash9(const std::string& pass, const std::string& hash)
PASSHASH9_PBKDF_OUTPUT_LEN);
}
+bool is_passhash9_alg_supported(uint8_t alg_id)
+ {
+ if (get_pbkdf_prf(alg_id))
+ {
+ return true;
+ }
+ return false;
+ }
+
}
diff --git a/src/lib/passhash/passhash9/passhash9.h b/src/lib/passhash/passhash9/passhash9.h
index d2282481d..80cbb939a 100644
--- a/src/lib/passhash/passhash9/passhash9.h
+++ b/src/lib/passhash/passhash9/passhash9.h
@@ -38,6 +38,12 @@ std::string BOTAN_DLL generate_passhash9(const std::string& password,
bool BOTAN_DLL check_passhash9(const std::string& password,
const std::string& hash);
+/**
+* Check if the PRF used with PBKDF2 is supported
+* @param alg_id alg_id used in generate_passhash9()
+*/
+bool BOTAN_DLL is_passhash9_alg_supported(uint8_t alg_id);
+
}
#endif