aboutsummaryrefslogtreecommitdiff
path: root/src/shared/Auth/Hmac.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/Auth/Hmac.cpp')
-rw-r--r--src/shared/Auth/Hmac.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/Auth/Hmac.cpp b/src/shared/Auth/Hmac.cpp
index 4446bdb38ce..07fbd4821fb 100644
--- a/src/shared/Auth/Hmac.cpp
+++ b/src/shared/Auth/Hmac.cpp
@@ -23,10 +23,8 @@
HmacHash::HmacHash(uint32 len, uint8 *seed)
{
- ASSERT(len == SEED_KEY_SIZE);
-
HMAC_CTX_init(&m_ctx);
- HMAC_Init_ex(&m_ctx, seed, SEED_KEY_SIZE, EVP_sha1(), NULL);
+ HMAC_Init_ex(&m_ctx, seed, len, EVP_sha1(), NULL);
}
HmacHash::~HmacHash()
@@ -44,6 +42,11 @@ void HmacHash::UpdateData(const uint8 *data, int length)
HMAC_Update(&m_ctx, data, length);
}
+void HmacHash::UpdateData(const std::string &str)
+{
+ UpdateData((uint8 const*)str.c_str(), str.length());
+}
+
void HmacHash::Finalize()
{
uint32 length = 0;