summaryrefslogtreecommitdiff
path: root/include/apr_crypto.h
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2016-10-06 21:11:43 +0000
committerYann Ylavic <ylavic@apache.org>2016-10-06 21:11:43 +0000
commit3b0af81d1ee8dc1ca4dfc2f3c7aa6f50515a2c8f (patch)
tree5940ecbcafec6bc5cbf5b247a1c5ea4359b43fdf /include/apr_crypto.h
parent496dd085dfd4798ca178d0d6120c281960be3950 (diff)
downloadapr-3b0af81d1ee8dc1ca4dfc2f3c7aa6f50515a2c8f.tar.gz
crypto: provide apr_crypto_memzero, garanteed to not be optimized out by
compilers. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1763665 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_crypto.h')
-rw-r--r--include/apr_crypto.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/apr_crypto.h b/include/apr_crypto.h
index d76b1d629..bf921cbff 100644
--- a/include/apr_crypto.h
+++ b/include/apr_crypto.h
@@ -178,8 +178,7 @@ typedef struct apr_crypto_key_rec_t {
APR_DECLARE(apr_status_t) apr_crypto_init(apr_pool_t *pool);
/**
- * @brief Register a cleanup to zero out the buffer provided
- * when the pool is cleaned up.
+ * @brief Zero out the buffer provided when the pool is cleaned up.
*
* @param pool - pool to register the cleanup
* @param buffer - buffer to zero out
@@ -189,6 +188,15 @@ APR_DECLARE(apr_status_t) apr_crypto_clear(apr_pool_t *pool, void *buffer,
apr_size_t size);
/**
+ * @brief Always zero out the buffer provided, without being optimized out by
+ * the compiler.
+ *
+ * @param buffer - buffer to zero out
+ * @param size - size of the buffer to zero out
+ */
+APR_DECLARE(apr_status_t) apr_crypto_memzero(void *buffer, apr_size_t size);
+
+/**
* @brief Get the driver struct for a name
*
* @param driver - pointer to driver struct.