From 96f745af6ff5dbc5c7f4292dffa70e3cc8aa7eb0 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Wed, 12 Jul 2023 08:05:03 +1000 Subject: [PATCH] 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. --- wolfcrypt/src/evp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 0fc7b85d7d..2e98a8f5ce 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -10308,8 +10308,7 @@ int wolfSSL_EVP_MD_type(const WOLFSSL_EVP_MD* type) break; #ifdef WOLFSSL_SM3 case WC_HASH_TYPE_SM3: - ret = wc_Sm3Update(&ctx->hash.digest.sm3, data, - (unsigned long)sz); + ret = wc_Sm3Update(&ctx->hash.digest.sm3, data, (word32)sz); if (ret == 0) { ret = WOLFSSL_SUCCESS; }