aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aes_keywrap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/aes_keywrap.c b/aes_keywrap.c
index 63e0cf7..1ee857b 100644
--- a/aes_keywrap.c
+++ b/aes_keywrap.c
@@ -383,6 +383,8 @@ hal_error_t hal_aes_keywrap(hal_core_t *core,
}
out:
+ if (K != NULL)
+ hal_aes_keywrap_zero(core);
if (free_core)
hal_core_free(core);
return err;
@@ -483,6 +485,8 @@ hal_error_t hal_aes_keyunwrap(hal_core_t *core,
memmove(Q, Q + 8, m);
out:
+ if (K != NULL)
+ hal_aes_keywrap_zero(core);
if (free_core)
hal_core_free(core);
return err;