|
1 | 1 | --- a/crypto/build.info |
2 | 2 | +++ b/crypto/build.info |
3 | 3 | @@ -107,7 +107,7 @@ |
4 | | - cversion.c info.c cpt_err.c ebcdic.c uid.c o_time.c o_dir.c \ |
5 | | - o_fopen.c getenv.c o_init.c init.c trace.c provider.c provider_child.c \ |
6 | | - punycode.c passphrase.c sleep.c deterministic_nonce.c quic_vlint.c \ |
7 | | -- time.c |
8 | | -+ time.c pathtools.c |
| 4 | + comp_methods.c cversion.c info.c cpt_err.c ebcdic.c uid.c o_time.c \ |
| 5 | + o_dir.c o_fopen.c getenv.c o_init.c init.c trace.c provider.c \ |
| 6 | + provider_child.c punycode.c passphrase.c sleep.c deterministic_nonce.c \ |
| 7 | +- quic_vlint.c time.c defaults.c ssl_err.c |
| 8 | ++ quic_vlint.c time.c defaults.c ssl_err.c pathtools.c |
9 | 9 | SOURCE[../providers/libfips.a]=$UTIL_COMMON |
10 | 10 |
|
11 | 11 | SOURCE[../libcrypto]=$UPLINKSRC |
|
24 | 24 | */ |
25 | 25 | if (strcmp(id, "dynamic")) { |
26 | 26 | - if ((load_dir = ossl_safe_getenv("OPENSSL_ENGINES")) == NULL) |
27 | | -- load_dir = ENGINESDIR; |
| 27 | +- load_dir = ossl_get_enginesdir(); |
28 | 28 | + if ((load_dir = ossl_safe_getenv("OPENSSL_ENGINES")) == NULL) { |
29 | 29 | + static char * reloc = NULL; |
30 | 30 | + if (reloc == NULL) { |
31 | | -+ reloc = single_path_relocation_lib(OPENSSLBIN, ENGINESDIR); |
| 31 | ++ reloc = single_path_relocation_lib(OPENSSLBIN, ossl_get_enginesdir()); |
32 | 32 | + } |
33 | 33 | + load_dir = reloc; |
34 | 34 | + } |
|
37 | 37 | !ENGINE_ctrl_cmd_string(iterator, "DIR_LOAD", "2", 0) || |
38 | 38 | --- a/crypto/x509/x509_def.c |
39 | 39 | +++ b/crypto/x509/x509_def.c |
40 | | -@@ -9,27 +9,44 @@ |
41 | | - |
| 40 | +@@ -10,6 +10,7 @@ |
42 | 41 | #include <stdio.h> |
| 42 | + #include "internal/e_os.h" |
43 | 43 | #include "internal/cryptlib.h" |
44 | 44 | +#include "pathtools.h" |
| 45 | + #include "internal/thread_once.h" |
45 | 46 | #include <openssl/crypto.h> |
46 | | - #include <openssl/x509.h> |
47 | | - |
48 | | - const char *X509_get_default_private_dir(void) |
| 47 | + #include <openssl/x509.h> |
| 48 | +@@ -47,19 +48,19 @@ |
49 | 49 | { |
50 | | -- return X509_PRIVATE_DIR; |
51 | | -+ static char * reloc = NULL; |
52 | | -+ if (reloc == NULL) { |
53 | | -+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_PRIVATE_DIR); |
54 | | -+ } |
55 | | -+ return reloc; |
56 | | - } |
| 50 | + get_windows_default_path(x509_private_dir, "\\private"); |
| 51 | + if (strlen(x509_private_dir) > 0) |
| 52 | +- x509_private_dirptr = x509_private_dir; |
| 53 | ++ x509_private_dirptr = single_path_relocation_lib(OPENSSLBIN, x509_private_dir); |
57 | 54 |
|
58 | | - const char *X509_get_default_cert_area(void) |
59 | | - { |
60 | | -- return X509_CERT_AREA; |
61 | | -+ static char * reloc = NULL; |
62 | | -+ if (reloc == NULL) { |
63 | | -+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_CERT_AREA); |
64 | | -+ } |
65 | | -+ return reloc; |
66 | | - } |
| 55 | + get_windows_default_path(x509_cert_area, "\\"); |
| 56 | + if (strlen(x509_cert_area) > 0) |
| 57 | +- x509_cert_areaptr = x509_cert_area; |
| 58 | ++ x509_cert_areaptr = single_path_relocation_lib(OPENSSLBIN, x509_cert_area); |
67 | 59 |
|
68 | | - const char *X509_get_default_cert_dir(void) |
69 | | - { |
70 | | -- return X509_CERT_DIR; |
71 | | -+ static char * reloc = NULL; |
72 | | -+ if (reloc == NULL) { |
73 | | -+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_CERT_DIR); |
74 | | -+ } |
75 | | -+ return reloc; |
76 | | - } |
| 60 | + get_windows_default_path(x509_cert_dir, "\\certs"); |
| 61 | + if (strlen(x509_cert_dir) > 0) |
| 62 | +- x509_cert_dirptr = x509_cert_dir; |
| 63 | ++ x509_cert_dirptr = single_path_relocation_lib(OPENSSLBIN, x509_cert_dir); |
77 | 64 |
|
78 | | - const char *X509_get_default_cert_file(void) |
79 | | - { |
80 | | -- return X509_CERT_FILE; |
81 | | -+ static char * reloc = NULL; |
82 | | -+ if (reloc == NULL) { |
83 | | -+ reloc = single_path_relocation_lib(OPENSSLBIN, X509_CERT_FILE); |
84 | | -+ } |
85 | | -+ return reloc; |
86 | | - } |
| 65 | + get_windows_default_path(x509_cert_file, "\\cert.pem"); |
| 66 | + if (strlen(x509_cert_file) > 0) |
| 67 | +- x509_cert_fileptr = x509_cert_file; |
| 68 | ++ x509_cert_fileptr = single_path_relocation_lib(OPENSSLBIN, x509_cert_file); |
87 | 69 |
|
88 | | - const char *X509_get_default_cert_dir_env(void) |
| 70 | + return 1; |
| 71 | + } |
89 | 72 | --- a/crypto/provider_core.c |
90 | 73 | +++ b/crypto/provider_core.c |
91 | 74 | @@ -30,6 +30,7 @@ |
|
96 | 79 | #ifndef FIPS_MODULE |
97 | 80 | # include <openssl/self_test.h> |
98 | 81 | #endif |
99 | | -@@ -916,8 +917,13 @@ |
100 | | - |
| 82 | +@@ -989,8 +990,13 @@ |
| 83 | + |
101 | 84 | if (load_dir == NULL) { |
102 | 85 | load_dir = ossl_safe_getenv("OPENSSL_MODULES"); |
103 | 86 | - if (load_dir == NULL) |
104 | | -- load_dir = MODULESDIR; |
| 87 | +- load_dir = ossl_get_modulesdir(); |
105 | 88 | + if (load_dir == NULL) { |
106 | 89 | + static char * reloc = NULL; |
107 | 90 | + if (reloc == NULL) { |
108 | | -+ reloc = single_path_relocation_lib(OPENSSLBIN, MODULESDIR); |
| 91 | ++ reloc = single_path_relocation_lib(OPENSSLBIN, ossl_get_modulesdir()); |
109 | 92 | + } |
110 | 93 | + load_dir = reloc; |
111 | 94 | + } |
|
0 commit comments