From 37e3dbdd8206e4f0f03fab13ff3f38aa932be065 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 28 Jan 2026 00:35:28 +0100 Subject: lib: Fix OpenSSL includes and explicit_bzero on OSX The include headers and NIDs are different on macOS X. It also doesn't have explicit_bzero. The crypt.h includes are now guarded to work on OS X (trying to avoid the includes by defining the OpenSSL mac header guard led to a whole list of other issues). The explicit zero'ing of buffers temporarily holding secrets has now been abstracted in a crypt_secure_clear() function defaulting to OpenSSL_cleanse, explicit_bzero (if present) or a best-effort option using a volatile pointer. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/crypt/openssl.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/lib/crypt/openssl.h') diff --git a/src/lib/crypt/openssl.h b/src/lib/crypt/openssl.h index 083e8dde..a6bb5840 100644 --- a/src/lib/crypt/openssl.h +++ b/src/lib/crypt/openssl.h @@ -166,4 +166,7 @@ void * openssl_secure_malloc(size_t size); void openssl_secure_free(void * ptr, size_t size); +void openssl_secure_clear(void * ptr, + size_t size); + #endif /* OUROBOROS_LIB_CRYPT_OPENSSL_H */ -- cgit v1.2.3