-rw-r--r-- | lib/util.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/util.cc b/lib/util.cc index b85a377..bb8a2e8 100644 --- a/lib/util.cc +++ b/lib/util.cc | |||
@@ -10,6 +10,8 @@ | |||
10 | #include <openssl/evp.h> | 10 | #include <openssl/evp.h> |
11 | #include <openssl/sha.h> | ||
11 | #include <openssl/hmac.h> | 12 | #include <openssl/hmac.h> |
12 | #include <curl/curl.h> | 13 | #include <curl/curl.h> |
13 | #include "opkele/util.h" | 14 | #include <opkele/util.h> |
14 | #include "opkele/exception.h" | 15 | #include <opkele/exception.h> |
16 | #include <opkele/debug.h> | ||
15 | 17 | ||
@@ -422,6 +424,7 @@ namespace opkele { | |||
422 | unsigned int md_len = 0; | 424 | unsigned int md_len = 0; |
423 | unsigned char *md = HMAC(evpmd, | 425 | unsigned char md[SHA256_DIGEST_LENGTH]; |
426 | HMAC(evpmd, | ||
424 | &(secret.front()),secret.size(), | 427 | &(secret.front()),secret.size(), |
425 | (const unsigned char*)kv.data(),kv.length(), | 428 | (const unsigned char*)kv.data(),kv.length(), |
426 | 0,&md_len); | 429 | md,&md_len); |
427 | return encode_base64(md,md_len); | 430 | return encode_base64(md,md_len); |