summaryrefslogtreecommitdiff
path: root/shopify.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-29 17:08:14 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-29 17:08:14 +0800
commitc76ce51427ae8759b759a2cfda21b4127391a040 (patch)
treeff70a306820f813e8f88a370fa9f190e9d070d15 /shopify.c
parente6fd1d2911c8739ca32462b7f49eee018120601c (diff)
Somehow digest_len is 45
Also, shop_len is calculated.
Diffstat (limited to 'shopify.c')
-rw-r--r--shopify.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shopify.c b/shopify.c
index a97e777..3d0265a 100644
--- a/shopify.c
+++ b/shopify.c
@@ -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;