From 64e7db6f4f256656f4d78a96b07e51f7d5c6d526 Mon Sep 17 00:00:00 2001 From: John Moffett Date: Fri, 10 Feb 2023 16:13:40 -0500 Subject: [PATCH] Zero out wallet master key upon lock When an encrypted wallet is locked (for instance via the RPC `walletlock`), the docs indicate that the key is removed from memory. However, the vector (with a secure allocator) is merely cleared. This allows the key to persist indefinitely in memory. Instead, manually fill the bytes with zeroes before clearing. Github-Pull: #27080 Rebased-From: 3a11adc7004d21b3dfe028b190d83add31691c55 --- src/wallet/wallet.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 9149152bb0..5d77b4ed8f 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -25,6 +25,7 @@ #include