From 18ac5783735c4bbcebe0f45c76f4db585c795ee8 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Wed, 28 Jun 2023 19:00:47 +0800 Subject: [PATCH] minor update --- Core/Src/sts_cmox_hmac_sha.c | 7 ++++--- LoRaWAN/App/lora_app.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Core/Src/sts_cmox_hmac_sha.c b/Core/Src/sts_cmox_hmac_sha.c index efdbe21..ac73c59 100644 --- a/Core/Src/sts_cmox_hmac_sha.c +++ b/Core/Src/sts_cmox_hmac_sha.c @@ -17,6 +17,7 @@ #include "cmox_low_level.h" #include "stm32wlxx_hal.h" #include "sts_cmox_hmac_sha.h" +#include "yunhorn_sts_prd_conf.h" #include "sys_app.h" /* Private macros ------------------------------------------------------------*/ @@ -27,8 +28,8 @@ const uint8_t mKey[] = 0x59,0x75,0x33,0x6e,0x31,0x48,0x34,0x4f,0x31,0x52,0x35,0x4e,0x39,0x53,0x32,0x54,0x36,0x53 }; -uint8_t Computed_Tag_SHA1[20]={0x0}; -extern volatile uint8_t sts_ac_code[20]; +uint8_t Computed_Tag_SHA1[YUNHORN_STS_AC_CODE_SIZE]={0x0}; +extern volatile uint8_t sts_ac_code[YUNHORN_STS_AC_CODE_SIZE]; hmac_result_t hmac_result; uint32_t sts_hmac_verify(void) @@ -39,7 +40,7 @@ uint32_t sts_hmac_verify(void) hmac_result.ac_pass = 60; hmac_result.hmac_tag_size = 0; GetUniqueId(uid); - APP_LOG(TS_OFF, VLEVEL_H, "\r\nUID=%02x %02x %02x %02x\r\n",uid[4],uid[5],uid[6],uid[7]); + ret = sts_hmac_sha1((const uint8_t *) mKey, sizeof(mKey), (const uint8_t*)(uid+4), 4, &hmac_result); for (i=0;i