We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a83739 commit c6706d2Copy full SHA for c6706d2
1 file changed
src/internal.c
@@ -102,6 +102,17 @@
102
#error "wolfTPM and MAXQ10XX are incompatible with each other."
103
#endif
104
105
+/* wc_ForceZero was added in wolfSSL 5.8.4. Provide a fallback for older
106
+ * versions to securely zero sensitive memory. */
107
+#if defined(LIBWOLFSSL_VERSION_HEX) && LIBWOLFSSL_VERSION_HEX >= 0x05008004
108
+ #include <wolfssl/wolfcrypt/memory.h>
109
+#else
110
+ static void wc_ForceZero(void* mem, size_t len) {
111
+ volatile byte* p = (volatile byte*)mem;
112
+ while (len--) *p++ = 0;
113
+ }
114
+#endif
115
+
116
/* Helper to get size of struct field */
117
#define FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
118
0 commit comments