From 4edcf0b450cd42d2037155d520b7e6323b624b6a Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Fri, 21 Jun 2024 10:34:37 -0400 Subject: [PATCH] Don't fall back to pre-defined constants on windows We don't want to allow windows systems on new installs to use OPENSSLDIR/MODULESDIR/ENGINESDIR at all, as it makes no sense to define paths at build time that have no meaning at install time. Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/24450) --- crypto/defaults.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/crypto/defaults.c b/crypto/defaults.c index 56f2cb417a..8f60d182e3 100644 --- a/crypto/defaults.c +++ b/crypto/defaults.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -121,15 +121,9 @@ const char *ossl_get_openssldir(void) if (!RUN_ONCE(&defaults_setup_init, do_defaults_setup)) return NULL; return (const char *)openssldir; -# else - return "UNDEFINED"; # endif -#else -# ifdef OPENSSLDIR +# else return OPENSSLDIR; -# else - return ""; -# endif #endif } @@ -149,11 +143,7 @@ const char *ossl_get_enginesdir(void) return "UNDEFINED"; # endif #else -# ifdef OPENSSLDIR return ENGINESDIR; -# else - return ""; -# endif #endif } @@ -173,11 +163,7 @@ const char *ossl_get_modulesdir(void) return "UNDEFINED"; # endif #else -# ifdef MODULESDIR return MODULESDIR; -# else - return ""; -# endif #endif } @@ -191,6 +177,6 @@ const char *ossl_get_wininstallcontext(void) #if defined(_WIN32) && defined (OSSL_WINCTX) return MAKESTR(OSSL_WINCTX); #else - return ""; + return "UNDEFINED"; #endif }