summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--lib/util.cc11
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 @@
#include <openssl/evp.h>
+#include <openssl/sha.h>
#include <openssl/hmac.h>
#include <curl/curl.h>
-#include "opkele/util.h"
-#include "opkele/exception.h"
+#include <opkele/util.h>
+#include <opkele/exception.h>
+#include <opkele/debug.h>
@@ -422,6 +424,7 @@ namespace opkele {
unsigned int md_len = 0;
- unsigned char *md = HMAC(evpmd,
+ unsigned char md[SHA256_DIGEST_LENGTH];
+ HMAC(evpmd,
&(secret.front()),secret.size(),
(const unsigned char*)kv.data(),kv.length(),
- 0,&md_len);
+ md,&md_len);
return encode_base64(md,md_len);