aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/passhash
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2017-08-19 10:50:31 +0200
committerRenĂ© Korthaus <[email protected]>2017-08-19 10:50:31 +0200
commit51f92a09d29f68e0b1e2439e23f8f40aa4b80d48 (patch)
tree7aaaa0a5d61dd586d37d0085531b8ee5fa5c84e1 /src/lib/passhash
parentfc1a9b50cd49a76dd88460d4e1b3a415c72b638f (diff)
Add is_passhash9_alg_supported()
Diffstat (limited to 'src/lib/passhash')
-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