From e3afeeea8ce4f293e46b7c80c3929a0b68c14b7c Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 12 May 2026 10:25:13 -0600 Subject: [PATCH] check return value of XSecure_Sha3_ReadHash() call --- wolfcrypt/src/port/xilinx/xil-sha3.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/port/xilinx/xil-sha3.c b/wolfcrypt/src/port/xilinx/xil-sha3.c index d3bd331dd6..57833f18cf 100644 --- a/wolfcrypt/src/port/xilinx/xil-sha3.c +++ b/wolfcrypt/src/port/xilinx/xil-sha3.c @@ -224,6 +224,8 @@ int wc_Sha3_384_GetHash(wc_Sha3* sha, byte* out) { #ifdef WOLFSSL_XILINX_CRYPTO_OLD wc_Sha3 s; +#else + int status; #endif if (sha == NULL || out == NULL) { @@ -237,7 +239,11 @@ int wc_Sha3_384_GetHash(wc_Sha3* sha, byte* out) return wc_Sha3_384_Final(&s, out); #else - XSecure_Sha3_ReadHash(&(sha->hw), out); + status = XSecure_Sha3_ReadHash(&(sha->hw), out); + if (status != XST_SUCCESS) { + WOLFSSL_MSG("XSecure_Sha3_ReadHash failed"); + return WC_HW_E; + } return 0; #endif }