Authenticator: Introduce AUTH_DEFAULT_SALT_SIZE

This commit is contained in:
2021-10-03 17:01:03 +02:00
父節點 5037a17fba
當前提交 8b044d712b
共有 3 個文件被更改,包括 8 次插入5 次删除

查看文件

@@ -42,11 +42,12 @@ std::vector<char> Authenticator::pbkdf5(std::string password, const std::vector<
unsigned char hash[32];
const EVP_MD *sha256 = EVP_sha256();
const unsigned char *rawsalt = reinterpret_cast<const unsigned char *>(salt.data());
int ret = PKCS5_PBKDF2_HMAC(password.c_str(), password.size(), rawsalt, salt.size(), 300000, sha256, sizeof(hash), hash);
int ret =
PKCS5_PBKDF2_HMAC(password.c_str(), password.size(), rawsalt, salt.size(), 300000, sha256, sizeof(hash), hash);
if(ret != 1)
{
Logger::error() << "Authenticator: pbkdf5: Failed to create hash";
return { };
return {};
}
std::vector<char> result;