From 026b17b7d725109f586622755b435ded3673c43a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 31 Mar 2015 10:20:19 +0100 Subject: V597: introduce a rtl_secureZeroMemory Change-Id: Id28046eb318cd3b2ed0b813fd266617547cf6ee2 --- include/rtl/alloc.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/rtl/alloc.h b/include/rtl/alloc.h index 835db155ac44..bd3190d5f8c1 100644 --- a/include/rtl/alloc.h +++ b/include/rtl/alloc.h @@ -71,7 +71,6 @@ SAL_DLLPUBLIC void SAL_CALL rtl_freeMemory ( void * Ptr ) SAL_THROW_EXTERN_C(); - /** Allocate and zero memory. A call to this function will return NULL upon the requested @@ -84,18 +83,32 @@ SAL_DLLPUBLIC void * SAL_CALL rtl_allocateZeroMemory ( sal_Size Bytes ) SAL_THROW_EXTERN_C(); +/** Zero memory + + Fills a block of memory with zeros in a way that is guaranteed to be secure + + @param Ptr [in] pointer to previously allocated memory. + @param Bytes [in] memory size. + + @since LibreOffice 4.5 + */ +SAL_DLLPUBLIC void SAL_CALL rtl_secureZeroMemory ( + void * Ptr, + sal_Size Bytes +) SAL_THROW_EXTERN_C(); + /** Zero and free memory. @param Ptr [in] pointer to previously allocated memory. @param Bytes [in] memory size. - @return none. Memory is zero'ed and released. Ptr is invalid. + @return none. Memory is zero'ed with rtl_secureZeroMemory and released. Ptr + is invalid. */ SAL_DLLPUBLIC void SAL_CALL rtl_freeZeroMemory ( void * Ptr, sal_Size Bytes ) SAL_THROW_EXTERN_C(); - /** Allocate aligned memory. A call to this function will return NULL upon the requested -- cgit