27 DISABLE_GCC_WARNING(
"-Wredundant-decls")
28 #include <openssl/err.h>
29 #include <openssl/crypto.h>
30 ENABLE_GCC_WARNING(
"-Wredundant-decls")
55 memwipe(
void *mem, uint8_t
byte,
size_t sz)
70 #if defined(SecureZeroMemory) || defined(HAVE_SECUREZEROMEMORY)
72 SecureZeroMemory(mem,sz);
73 #elif defined(HAVE_RTLSECUREZEROMEMORY)
74 RtlSecureZeroMemory(mem,sz);
75 #elif defined(HAVE_EXPLICIT_BZERO)
77 explicit_bzero(mem, sz);
78 #elif defined(HAVE_MEMSET_S)
80 memset_s(mem, sz, 0, sz);
81 #elif defined(ENABLE_OPENSSL)
93 OPENSSL_cleanse(mem, sz);
96 asm volatile(
"" :::
"memory");
108 memset(mem,
byte, sz);
Utility macros to handle different features and behavior in different compilers.
void tor_str_wipe_and_free_(char *str)
void memwipe(void *mem, uint8_t byte, size_t sz)
Common functions for cryptographic routines.
void tor_free_(void *mem)
Macros to manage assertions, fatal and non-fatal.