diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-29 17:08:14 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2022-09-29 17:08:14 +0800 |
commit | c76ce51427ae8759b759a2cfda21b4127391a040 (patch) | |
tree | ff70a306820f813e8f88a370fa9f190e9d070d15 /shopify.c | |
parent | e6fd1d2911c8739ca32462b7f49eee018120601c (diff) |
Somehow digest_len is 45
Also, shop_len is calculated.
Diffstat (limited to 'shopify.c')
-rw-r--r-- | shopify.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -429,6 +429,7 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con, } free(sig); } else { + shop_len = strlen(shop); unsigned char hs256[hs256_len]; get_hs256(api_secret_key, upload_data, *upload_data_size, hs256, &hs256_len); @@ -436,7 +437,7 @@ static enum MHD_Result handle_request(void *cls, struct MHD_Connection *con, size_t digest_len; l8w8jwt_base64_encode(0, hs256, hs256_len, &digest, &digest_len); - if (strncmp(hmacsha256, digest, digest_len)) { + if (strncmp(hmacsha256, digest, strlen(hmacsha256))) { free(hmacsha256); free(shop); return MHD_NO; |