summaryrefslogtreecommitdiff
path: root/node/Utils.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-02 09:08:31 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-10-02 09:08:31 -0700
commite8c5495b61ebde115ee133e8c85933191bd0cd61 (patch)
treee8f80f74b77bb1dc83b0fd5fd0d86ebc72c9cd86 /node/Utils.hpp
parent28646eee0a81a5555fbfa504b66a5b11be4f3fb7 (diff)
downloadinfinitytier-e8c5495b61ebde115ee133e8c85933191bd0cd61.tar.gz
infinitytier-e8c5495b61ebde115ee133e8c85933191bd0cd61.zip
Yes, zero my secret key data. Yes I really, really mean it.
Diffstat (limited to 'node/Utils.hpp')
-rw-r--r--node/Utils.hpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/node/Utils.hpp b/node/Utils.hpp
index affae9a8..defb52a9 100644
--- a/node/Utils.hpp
+++ b/node/Utils.hpp
@@ -101,18 +101,10 @@ public:
}
/**
- * Securely zero memory
- *
- * This just uses volatile to ensure that it's never optimized out.
+ * Securely zero memory, avoiding compiler optimizations and such
*/
- static inline void burn(void *ptr,unsigned int len)
- throw()
- {
- volatile unsigned char *p = (unsigned char *)ptr;
- volatile unsigned char *e = p + len;
- while (p != e)
- *(p++) = (unsigned char)0;
- }
+ static void burn(void *ptr,unsigned int len)
+ throw();
/**
* Delete a file