1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-08 23:37:47 +02:00

* secmem.c (secmem_free, secmem_term): Use wipememory2() instead of

memset() to overwrite secure memory.
This commit is contained in:
David Shaw 2002-11-06 15:43:38 +00:00
parent 49db742b75
commit 23ac2c1e0a
2 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2002-11-06 David Shaw <dshaw@jabberwocky.com>
* secmem.c (secmem_free, secmem_term): Use wipememory2() instead
of memset() to overwrite secure memory.
2002-10-28 Werner Koch <wk@gnupg.org>
* w32reg.c (read_w32_registry_string): Fixed expanding of the

View File

@ -406,10 +406,10 @@ secmem_free( void *a )
size = mb->size;
/* This does not make much sense: probably this memory is held in the
* cache. We do it anyway: */
memset(mb, 0xff, size );
memset(mb, 0xaa, size );
memset(mb, 0x55, size );
memset(mb, 0x00, size );
wipememory2(mb, 0xff, size );
wipememory2(mb, 0xaa, size );
wipememory2(mb, 0x55, size );
wipememory2(mb, 0x00, size );
mb->size = size;
mb->u.next = unused_blocks;
unused_blocks = mb;
@ -439,10 +439,10 @@ secmem_term()
if( !pool_okay )
return;
memset( pool, 0xff, poolsize);
memset( pool, 0xaa, poolsize);
memset( pool, 0x55, poolsize);
memset( pool, 0x00, poolsize);
wipememory2( pool, 0xff, poolsize);
wipememory2( pool, 0xaa, poolsize);
wipememory2( pool, 0x55, poolsize);
wipememory2( pool, 0x00, poolsize);
#ifdef HAVE_MMAP
if( pool_is_mmapped )
munmap( pool, poolsize );