@@ -417,6 +417,7 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
417417 CRYP_Cmd (DISABLE );
418418 #endif /* WOLFSSL_STM32_CUBEMX */
419419 wolfSSL_CryptHwMutexUnLock ();
420+ wc_Stm32_Aes_Cleanup ();
420421
421422 return ret ;
422423 }
@@ -520,6 +521,7 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
520521 CRYP_Cmd (DISABLE );
521522 #endif /* WOLFSSL_STM32_CUBEMX */
522523 wolfSSL_CryptHwMutexUnLock ();
524+ wc_Stm32_Aes_Cleanup ();
523525
524526 return ret ;
525527 }
@@ -3562,6 +3564,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
35623564 HAL_CRYP_DeInit (& hcryp );
35633565
35643566 wolfSSL_CryptHwMutexUnLock ();
3567+ wc_Stm32_Aes_Cleanup ();
35653568
35663569 return ret ;
35673570 }
@@ -3624,6 +3627,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
36243627
36253628 HAL_CRYP_DeInit (& hcryp );
36263629 wolfSSL_CryptHwMutexUnLock ();
3630+ wc_Stm32_Aes_Cleanup ();
36273631
36283632 return ret ;
36293633 }
@@ -3708,6 +3712,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
37083712 /* disable crypto processor */
37093713 CRYP_Cmd (DISABLE );
37103714 wolfSSL_CryptHwMutexUnLock ();
3715+ wc_Stm32_Aes_Cleanup ();
37113716
37123717 return ret ;
37133718 }
@@ -3802,6 +3807,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
38023807 /* disable crypto processor */
38033808 CRYP_Cmd (DISABLE );
38043809 wolfSSL_CryptHwMutexUnLock ();
3810+ wc_Stm32_Aes_Cleanup ();
38053811
38063812 return ret ;
38073813 }
@@ -4562,6 +4568,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
45624568 #endif /* WOLFSSL_STM32_CUBEMX */
45634569
45644570 wolfSSL_CryptHwMutexUnLock ();
4571+ wc_Stm32_Aes_Cleanup ();
45654572 return ret ;
45664573 }
45674574
@@ -6708,6 +6715,7 @@ static WARN_UNUSED_RESULT int wc_AesGcmEncrypt_STM32(
67086715 ret = AES_GCM_AUTH_E ;
67096716#endif /* WOLFSSL_STM32_CUBEMX */
67106717 wolfSSL_CryptHwMutexUnLock ();
6718+ wc_Stm32_Aes_Cleanup ();
67116719
67126720 if (ret == 0 ) {
67136721 /* return authTag */
@@ -7242,6 +7250,7 @@ static WARN_UNUSED_RESULT int wc_AesGcmDecrypt_STM32(
72427250 XMEMCPY (tag , partialBlock , authTagSz );
72437251#endif /* WOLFSSL_STM32_CUBEMX */
72447252 wolfSSL_CryptHwMutexUnLock ();
7253+ wc_Stm32_Aes_Cleanup ();
72457254
72467255 /* Check authentication tag */
72477256 if (ConstantCompare ((const byte * )tagExpected , (byte * )tag , authTagSz ) != 0 ) {
0 commit comments