Zero memory in CRYPTO_secure_malloc.
authorPauli <paul.dale@oracle.com>
Wed, 22 Aug 2018 00:04:27 +0000 (10:04 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 23 Aug 2018 01:12:44 +0000 (11:12 +1000)
commit837017b4748d587912d9d218894644d6ca86721f
treeafca3cea34ec1205407a443f59c3980d963e36da
parent8255fd0f4f86fa4202962d4b27185c0d96f21d75
Zero memory in CRYPTO_secure_malloc.

This commit destroys the free list pointers which would otherwise be
present in the returned memory blocks.  This in turn helps prevent
information leakage from the secure memory area.

Note: CRYPTO_secure_malloc is not guaranteed to return zeroed memory:
before the secure memory system is initialised or if it isn't implemented.

[manual merge of #7011]

Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/7026)
crypto/mem_sec.c
test/secmemtest.c