提交 2820d5ac 编写于 作者: M Mupceet

fix: get udid 错误

Signed-off-by: NMupceet <laiguizhong@huawei.com>
上级 8cabde55
......@@ -144,7 +144,7 @@ static int GetSha256Value(const char *input, char *udid, int udidSize)
mbedtls_sha256_context context;
mbedtls_sha256_init(&context);
mbedtls_sha256_starts_ret(&context, 0);
mbedtls_sha256_update_ret(&context, (const unsigned char)input, strlen(input));
mbedtls_sha256_update_ret(&context, (const unsigned char *)input, strlen(input));
mbedtls_sha256_finish_ret(&context, hash);
for (size_t i = 0; i < HASH_LENGTH; i++) {
......@@ -194,6 +194,9 @@ const char *GetSerial_(void)
int GetDevUdid_(char *udid, int size)
{
if (size < UDID_LEN || udid == NULL) {
return EC_FAILURE;
}
const char *manufacture = GetManufacture_();
const char *model = GetProductModel_();
const char *sn = GetSerial_();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册