#include <openssl/crypto.h>
#include <e_os.h>
+#include <string.h>
+
#if defined(OPENSSL_SYS_LINUX) || defined(OPENSSL_SYS_UNIX)
# define IMPLEMENTED
# include <stdlib.h>
-# include <string.h>
# include <assert.h>
# include <unistd.h>
# include <sys/types.h>
#endif /* IMPLEMENTED */
}
-void CRYPTO_secure_free(void *ptr)
+void *CRYPTO_secure_zalloc(size_t num, const char *file, int line)
+{
+ void *ret = CRYPTO_secure_malloc(num, file, line);
+
+ if (ret != NULL)
+ memset(ret, 0, num);
+ return ret;
+}
+
+void CRYPTO_secure_free(void *ptr, const char *file, int line)
{
#ifdef IMPLEMENTED
size_t actual_size;
if (ptr == NULL)
return;
if (!secure_mem_initialized) {
- CRYPTO_free(ptr);
+ CRYPTO_free(ptr, file, line);
return;
}
LOCK();
sh_free(ptr);
UNLOCK();
#else
- CRYPTO_free(ptr);
+ CRYPTO_free(ptr, file, line);
#endif /* IMPLEMENTED */
}