summaryrefslogtreecommitdiff
path: root/e_os.h
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2020-02-05 14:28:37 -0500
committerBernd Edlinger <bernd.edlinger@hotmail.de>2020-02-14 15:18:27 +0100
commit6943335e3e3889fd7a1c7b027ccdcd4f3955b5ec (patch)
tree9979b8473e1a1d6d7ad0899f9a3a194804a0ae10 /e_os.h
parentcdb16632636c4a1a439449d110f94cad15d2e9fe (diff)
downloadopenssl-new-6943335e3e3889fd7a1c7b027ccdcd4f3955b5ec.tar.gz
Make secure-memory be a config option
Adding support for "no-secure-memory" was simple, a one-liner. Fixing all the "ifdef OPENSSL_SECURE_MEMORY" to be "ifndef NO_xxx" was a bit more work. My original goof, for not following the OpenSSL pattern "ifndef NO_" used everywhere else. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/11023)
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/e_os.h b/e_os.h
index e33c56dccb..bd864240b1 100644
--- a/e_os.h
+++ b/e_os.h
@@ -299,11 +299,16 @@ struct servent *getservbyname(const char *name, const char *proto);
# define CRYPTO_memcmp memcmp
# endif
-/* unistd.h defines _POSIX_VERSION */
-# if !defined(OPENSSL_NO_SECURE_MEMORY) && defined(OPENSSL_SYS_UNIX) \
- && ( (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
- || defined(__sun) || defined(__hpux) || defined(__sgi) \
- || defined(__osf__) )
-# define OPENSSL_SECURE_MEMORY /* secure memory is implemented */
+# ifndef OPENSSL_NO_SECURE_MEMORY
+ /* unistd.h defines _POSIX_VERSION */
+# if defined(OPENSSL_SYS_UNIX) \
+ && ( (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \
+ || defined(__sun) || defined(__hpux) || defined(__sgi) \
+ || defined(__osf__) )
+ /* secure memory is implemented */
+# else
+# define OPENSSL_NO_SECURE_MEMORY
+# endif
# endif
+
#endif