From ae194e522ed0ffea8da0d158a2447227646d1402 Mon Sep 17 00:00:00 2001 From: Mark Atwood Date: Thu, 9 Jul 2026 16:32:58 -0700 Subject: [PATCH] fix: force-zero key cache on server cleanup --- src/wh_server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wh_server.c b/src/wh_server.c index 3a4c11553..de42831b5 100644 --- a/src/wh_server.c +++ b/src/wh_server.c @@ -51,6 +51,7 @@ /* Server API's */ #include "wolfhsm/wh_server.h" +#include "wolfhsm/wh_utils.h" #include "wolfhsm/wh_server_nvm.h" #ifdef WOLFHSM_CFG_ENABLE_AUTHENTICATION #include "wolfhsm/wh_auth.h" @@ -190,7 +191,7 @@ int wh_Server_Cleanup(whServerContext* server) (void)wh_Log_Cleanup(&server->log); #endif /* WOLFHSM_CFG_LOGGING */ - memset(server, 0, sizeof(*server)); + wh_Utils_ForceZero(server, sizeof(*server)); return WH_ERROR_OK; }