diff options
author | Daiki Ueno <ueno@gnu.org> | 2020-05-26 10:22:37 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2020-05-27 14:14:37 +0200 |
commit | a2080f6506701d8d9ca5111d628607a6a8013f61 (patch) | |
tree | 21f5bc6031441e9c34718eeadbe5f6160a8a56e0 /tests/test-read-file.c | |
parent | e4a38aadac2e90c6dfb317d0845746c200cf6697 (diff) | |
download | gnulib-a2080f6506701d8d9ca5111d628607a6a8013f61.tar.gz |
read-file: add RF_SENSITIVE flag
* lib/read-file.h (RF_SENSITIVE): New define.
* lib/read-file.c (fread_file, read_file): Take into account of
RF_SENSITIVE flag.
* modules/read-file (Depends-on): Add explicit_bzero.
This adds an alternative behavior of those functions to explicitly
clear the internal memory block when it becomes unused. This is
useful for reading sensitive information from a file.
Diffstat (limited to 'tests/test-read-file.c')
-rw-r--r-- | tests/test-read-file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test-read-file.c b/tests/test-read-file.c index 84b9049940..b37f875b22 100644 --- a/tests/test-read-file.c +++ b/tests/test-read-file.c @@ -117,6 +117,8 @@ main (void) { ASSERT (!test_read_file (0)); ASSERT (!test_read_file (RF_BINARY)); + ASSERT (!test_read_file (RF_SENSITIVE)); + ASSERT (!test_read_file (RF_BINARY | RF_SENSITIVE)); return 0; } |