diff options
author | David Shaw <[email protected]> | 2002-10-31 15:40:42 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-10-31 15:40:42 +0000 |
commit | 20c99d180a3f9c5d0134ff8c5fc62c434ae50c02 (patch) | |
tree | a954f28f4fdbdbb399d14e67e19fe5230a606322 /g10/encode.c | |
parent | * util.h: Add wipememory() macro. (diff) | |
download | gnupg-20c99d180a3f9c5d0134ff8c5fc62c434ae50c02.tar.gz gnupg-20c99d180a3f9c5d0134ff8c5fc62c434ae50c02.zip |
* build-packet.c (do_plaintext), encode.c (encode_sesskey, encode_simple,
encode_crypt), sign.c (write_plaintext_packet): Use wipememory() instead
of memset() to wipe sensitive memory as the memset() might be optimized
away.
Diffstat (limited to '')
-rw-r--r-- | g10/encode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/g10/encode.c b/g10/encode.c index 7991ef64a..6727c08ed 100644 --- a/g10/encode.c +++ b/g10/encode.c @@ -98,7 +98,7 @@ encode_sesskey( DEK *dek, DEK **ret_dek, byte *enckey ) cipher_close( hd ); memcpy( enckey, buf, c->keylen + 1 ); - memset( buf, 0, sizeof buf ); /* burn key */ + wipememory( buf, sizeof buf ); /* burn key */ *ret_dek = c; } @@ -350,7 +350,7 @@ encode_simple( const char *filename, int mode, int compat ) log_error("copying input to output failed: %s\n", g10_errstr(rc) ); break; } - memset(copy_buffer, 0, 4096); /* burn buffer */ + wipememory(copy_buffer, 4096); /* burn buffer */ } /* finish the stuff */ @@ -589,7 +589,7 @@ encode_crypt( const char *filename, STRLIST remusr ) g10_errstr(rc) ); break; } - memset(copy_buffer, 0, 4096); /* burn buffer */ + wipememory(copy_buffer, 4096); /* burn buffer */ } /* finish the stuff */ |