From d855d308261a7059536044b9c61220244711ae38 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 6 Jun 2019 11:48:12 +0200 Subject: [PATCH] Use MAP_CONCEAL on OpenBSD --- src/libsodium/crypto_pwhash/argon2/argon2-core.c | 6 +++++- .../crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c | 6 +++++- src/libsodium/sodium/utils.c | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/libsodium/crypto_pwhash/argon2/argon2-core.c b/src/libsodium/crypto_pwhash/argon2/argon2-core.c index c4e4d842..2f1ebbfd 100644 --- a/src/libsodium/crypto_pwhash/argon2/argon2-core.c +++ b/src/libsodium/crypto_pwhash/argon2/argon2-core.c @@ -35,7 +35,11 @@ # define MAP_ANON MAP_ANONYMOUS #endif #ifndef MAP_NOCORE -# define MAP_NOCORE 0 +# ifdef MAP_CONCEAL +# define MAP_NOCORE MAP_CONCEAL +# else +# define MAP_NOCORE 0 +# endif #endif #ifndef MAP_POPULATE # define MAP_POPULATE 0 diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c index cbd68aa1..a7d94107 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c @@ -31,7 +31,11 @@ # define MAP_ANON MAP_ANONYMOUS #endif #ifndef MAP_NOCORE -# define MAP_NOCORE 0 +# ifdef MAP_CONCEAL +# define MAP_NOCORE MAP_CONCEAL +# else +# define MAP_NOCORE 0 +# endif #endif #ifndef MAP_POPULATE # define MAP_POPULATE 0 diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 1fbd3a37..151dd09c 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -59,7 +59,11 @@ void *alloca (size_t); #define GARBAGE_VALUE 0xdb #ifndef MAP_NOCORE -# define MAP_NOCORE 0 +# ifdef MAP_CONCEAL +# define MAP_NOCORE MAP_CONCEAL +# else +# define MAP_NOCORE 0 +# endif #endif #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) # define MAP_ANON MAP_ANONYMOUS