Skip to content

Commit 96f745a

Browse files
committed
EVP SM3: fix cast
wc_Sm3Update takes a word32 for the size. Others cases are using the OpenSSL compatibility API but SM3 APIs don't exist in OpenSSL.
1 parent d6a6cbb commit 96f745a

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

wolfcrypt/src/evp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10308,8 +10308,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type)
1030810308
break;
1030910309
#ifdef WOLFSSL_SM3
1031010310
case WC_HASH_TYPE_SM3:
10311-
ret = wc_Sm3Update(&ctx->hash.digest.sm3, data,
10312-
(unsigned long)sz);
10311+
ret = wc_Sm3Update(&ctx->hash.digest.sm3, data, (word32)sz);
1031310312
if (ret == 0) {
1031410313
ret = WOLFSSL_SUCCESS;
1031510314
}

0 commit comments

Comments
 (0)