]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't fall back to pre-defined constants on windows
authorNeil Horman <nhorman@openssl.org>
Fri, 21 Jun 2024 14:34:37 +0000 (10:34 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 9 Jul 2024 08:01:44 +0000 (04:01 -0400)
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 <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24450)

crypto/defaults.c

index 56f2cb417a2635df9e3d28a8ff599c74225480bb..8f60d182e36563cba42ffd64f5d6633a555399dd 100644 (file)
@@ -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
-    return OPENSSLDIR;
 # else
-    return "";
-# endif
+    return OPENSSLDIR;
 #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
 }