From c119aa19a9147d104db2f2b5b611604b4f07f6b3 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 23 May 2014 14:41:04 +0200 Subject: add passphrase_wipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/passphrase.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/passphrase.h') diff --git a/src/passphrase.h b/src/passphrase.h index 932b6e5..0731404 100644 --- a/src/passphrase.h +++ b/src/passphrase.h @@ -27,6 +27,14 @@ */ extern char* passphrase_read(void); +/** + * Forcable write NUL characters to a passphrase + * + * @param ptr The password to wipe + * @param n The number of characters to wipe + */ +extern void passphrase_wipe(char* ptr, size_t n) __attribute__((optimize("-O0"))); + /** * Disable echoing and do anything else to the terminal settnings `passphrase_read` requires */ -- cgit v1.2.3-70-g09d2