aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/priv.h
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-03-02 17:55:51 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-03-02 18:07:42 +0100
commit81847bf5135d836000d206d559df2e27f9a00a84 (patch)
tree16824a3f76f933df790ad5d221388e1e5d7c1f54 /include/libssh/priv.h
parentbba40abc7603fbb3e4f5089684845312b789aff7 (diff)
downloadlibssh-81847bf5135d836000d206d559df2e27f9a00a84.tar.gz
libssh-81847bf5135d836000d206d559df2e27f9a00a84.tar.xz
libssh-81847bf5135d836000d206d559df2e27f9a00a84.zip
priv: Implement explicit_bzero as a function if not available
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Alberto Aguirre <albaguirre@gmail.com>
Diffstat (limited to 'include/libssh/priv.h')
-rw-r--r--include/libssh/priv.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/include/libssh/priv.h b/include/libssh/priv.h
index d191a9f5..f99e769e 100644
--- a/include/libssh/priv.h
+++ b/include/libssh/priv.h
@@ -281,21 +281,7 @@ int ssh_connector_remove_event(ssh_connector connector);
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
#ifndef HAVE_EXPLICIT_BZERO
-/*
- * See http://llvm.org/bugs/show_bug.cgi?id=15495
- */
-#if defined(HAVE_GCC_VOLATILE_MEMORY_PROTECTION)
-#define explicit_bzero(s, n) do { \
- if ((s) != NULL) { \
- void *_x = (s); \
- memset((_x), '\0', (n)); __asm__ volatile("" : : "r"(&(_x)) : "memory"); \
- } \
-} while (0)
-#else /* HAVE_GCC_VOLATILE_MEMORY_PROTECTION */
-#define explicit_bzero(s, n) do { \
- memset((s), '\0', (n)); \
-} while (0)
-#endif /* HAVE_GCC_VOLATILE_MEMORY_PROTECTION */
+void explicit_bzero(void *s, size_t n);
#endif /* !HAVE_EXPLICIT_BZERO */
/**