From 3a1178f71caeea87e5447b3359e40027450765b1 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 23 Apr 2025 11:58:40 -0700 Subject: [PATCH] Fix for STM32 Hash with NVIC (IRQ) enabled that can cause a DINIS interrupt that does not get cleared. If the HASH NVIC tab has Interrupts enabled it can cause an IRQ to be triggered that is not cleared. This is because the wolfSSL implementation of STM32 Hash does not call the HAL HASH API's and does not use interrupts yet. ZD 19778 --- wolfcrypt/src/port/st/stm32.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/port/st/stm32.c b/wolfcrypt/src/port/st/stm32.c index 80f441232..a732ac73a 100644 --- a/wolfcrypt/src/port/st/stm32.c +++ b/wolfcrypt/src/port/st/stm32.c @@ -164,8 +164,9 @@ static void wc_Stm32_Hash_RestoreContext(STM32_HASH_Context* ctx, int algo) /* init content */ #if defined(HASH_IMR_DINIE) && defined(HASH_IMR_DCIE) - /* enable IRQ's */ - HASH->IMR |= (HASH_IMR_DINIE | HASH_IMR_DCIE); + /* Disable IRQ's - wolfSSL does not use the HASH/RNG IRQ + * If using the HAL hashing API's directly it will re-enable the IRQs */ + HASH->IMR &= ~(HASH_IMR_DINIE | HASH_IMR_DCIE); #endif /* reset the control register */