From fed7de961e348bd9ffcd87f2916ffabb48bd07b2 Mon Sep 17 00:00:00 2001 From: Blake-Madden <66873089+Blake-Madden@users.noreply.github.com> Date: Mon, 1 Jul 2024 21:00:52 -0400 Subject: [PATCH] Expand wxSecureZeroMemory docs Give examples of how it may be implemented. Format it into a doxygen @note block. Closes #24665. --- interface/wx/utils.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/wx/utils.h b/interface/wx/utils.h index b8aa8a6cf6..f377448a9b 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -346,9 +346,13 @@ bool wxGetEnvMap(wxEnvVariableHashMap *map); @param p Pointer to the memory block to be zeroed, must be non-null. @param n The number of bytes to zero. - NOTE: If security is vitally important in your use case, please + @note If security is vitally important in your use case, please have a look at the implementations and decide whether you trust - them to behave as promised. + them to behave as promised. Depending on the platform and available libraries, + this may be implemented as `RtlSecureZeroMemory` (MS Windows), + `explicit_bzero()` (FreeBSD), `memset_s()` (macOS), + or a generic method which uses `volatile` to avoid the call from + being optimized away. @header{wx/utils.h}