Эх сурвалжийг харах

fix:修复iotauth路华为云密钥生成概率错误

Dozingfiretruck 2 жил өмнө
parent
commit
444fcd563a

+ 2 - 2
components/iotauth/luat_lib_iotauth.c

@@ -260,8 +260,8 @@ static int l_iotauth_onenet(lua_State *L) {
 }
 
 static void iotda_token(const char* device_id,const char* device_secret,long long cur_timestamp,int ins_timestamp,char* client_id,const char* password){
-    char hmac[64] = {0};
-    char timestamp[12] = {0};
+    char hmac[65] = {0};
+    char timestamp[13] = {0};
     struct tm *timeinfo = localtime( &cur_timestamp );
     if(snprintf_(timestamp, 12, "%04d%02d%02d%02d", (timeinfo->tm_year)+1900,timeinfo->tm_mon+1,timeinfo->tm_mday,timeinfo->tm_hour)<0){
         return;