diff options
author | deraadt <> | 2015-04-11 16:03:21 +0000 |
---|---|---|
committer | deraadt <> | 2015-04-11 16:03:21 +0000 |
commit | 3f6d0024da68bdf5d0f128537ac3ed536e6e6a6c (patch) | |
tree | 02ee416418c40719cf48cd968d4b546afbaf642a /src/lib | |
parent | 0a2c31c8f577b7611e81418bbe11b6a748f005ca (diff) | |
download | openbsd-3f6d0024da68bdf5d0f128537ac3ed536e6e6a6c.tar.gz openbsd-3f6d0024da68bdf5d0f128537ac3ed536e6e6a6c.tar.bz2 openbsd-3f6d0024da68bdf5d0f128537ac3ed536e6e6a6c.zip |
Remove all getenv() calls, especially those wrapped by issetugid().
getenv()'s wrapped by issetugid() are safe, but issetugid() is correct
difficult to impliment on many operating systems. By accident, a grand
experiment was run over the last year, where issetugid() returned 1 (the
safe value) on a few operating systems. Noone noticed & complained that
certain environment variables were not working.......
ok doug beck jsing, discussion with others
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/conf/conf_api.c | 18 | ||||
-rw-r--r-- | src/lib/libcrypto/conf/conf_mod.c | 6 | ||||
-rw-r--r-- | src/lib/libcrypto/engine/eng_list.c | 9 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/by_dir.c | 12 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/by_file.c | 16 | ||||
-rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/conf/conf_api.c | 18 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/conf/conf_mod.c | 6 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/engine/eng_list.c | 9 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/x509/by_dir.c | 12 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/x509/by_file.c | 16 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/x509/x509_vfy.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/src/doc/apps/config.pod | 7 |
13 files changed, 30 insertions, 115 deletions
diff --git a/src/lib/libcrypto/conf/conf_api.c b/src/lib/libcrypto/conf/conf_api.c index efa4be9f6b..f296e6a962 100644 --- a/src/lib/libcrypto/conf/conf_api.c +++ b/src/lib/libcrypto/conf/conf_api.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_api.c,v 1.14 2015/02/10 11:22:21 jsing Exp $ */ | 1 | /* $OpenBSD: conf_api.c,v 1.15 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -130,7 +130,6 @@ char * | |||
130 | _CONF_get_string(const CONF *conf, const char *section, const char *name) | 130 | _CONF_get_string(const CONF *conf, const char *section, const char *name) |
131 | { | 131 | { |
132 | CONF_VALUE *v, vv; | 132 | CONF_VALUE *v, vv; |
133 | char *p; | ||
134 | 133 | ||
135 | if (name == NULL) | 134 | if (name == NULL) |
136 | return (NULL); | 135 | return (NULL); |
@@ -141,14 +140,6 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
141 | v = lh_CONF_VALUE_retrieve(conf->data, &vv); | 140 | v = lh_CONF_VALUE_retrieve(conf->data, &vv); |
142 | if (v != NULL) | 141 | if (v != NULL) |
143 | return (v->value); | 142 | return (v->value); |
144 | if (strcmp(section, "ENV") == 0) { | ||
145 | if (issetugid() == 0) | ||
146 | p = getenv(name); | ||
147 | else | ||
148 | p = NULL; | ||
149 | if (p != NULL) | ||
150 | return (p); | ||
151 | } | ||
152 | } | 143 | } |
153 | vv.section = "default"; | 144 | vv.section = "default"; |
154 | vv.name = (char *)name; | 145 | vv.name = (char *)name; |
@@ -157,11 +148,8 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
157 | return (v->value); | 148 | return (v->value); |
158 | else | 149 | else |
159 | return (NULL); | 150 | return (NULL); |
160 | } else { | 151 | } else |
161 | if (issetugid()) | 152 | return (NULL); |
162 | return (NULL); | ||
163 | return (getenv(name)); | ||
164 | } | ||
165 | } | 153 | } |
166 | 154 | ||
167 | static unsigned long | 155 | static unsigned long |
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c index 4363f297c7..cb54cc2a87 100644 --- a/src/lib/libcrypto/conf/conf_mod.c +++ b/src/lib/libcrypto/conf/conf_mod.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_mod.c,v 1.25 2014/07/22 02:21:20 beck Exp $ */ | 1 | /* $OpenBSD: conf_mod.c,v 1.26 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
@@ -546,10 +546,6 @@ CONF_get1_default_config_file(void) | |||
546 | { | 546 | { |
547 | char *file = NULL; | 547 | char *file = NULL; |
548 | 548 | ||
549 | if (issetugid() == 0) | ||
550 | file = getenv("OPENSSL_CONF"); | ||
551 | if (file) | ||
552 | return strdup(file); | ||
553 | if (asprintf(&file, "%s/openssl.cnf", | 549 | if (asprintf(&file, "%s/openssl.cnf", |
554 | X509_get_default_cert_area()) == -1) | 550 | X509_get_default_cert_area()) == -1) |
555 | return (NULL); | 551 | return (NULL); |
diff --git a/src/lib/libcrypto/engine/eng_list.c b/src/lib/libcrypto/engine/eng_list.c index 740db90852..939cc82b17 100644 --- a/src/lib/libcrypto/engine/eng_list.c +++ b/src/lib/libcrypto/engine/eng_list.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eng_list.c,v 1.17 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: eng_list.c,v 1.18 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL | 2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -386,12 +386,7 @@ ENGINE_by_id(const char *id) | |||
386 | return iterator; | 386 | return iterator; |
387 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ | 387 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ |
388 | if (strcmp(id, "dynamic")) { | 388 | if (strcmp(id, "dynamic")) { |
389 | if (issetugid() == 0) { | 389 | load_dir = ENGINESDIR; |
390 | load_dir = getenv("OPENSSL_ENGINES"); | ||
391 | if (load_dir == NULL) | ||
392 | load_dir = ENGINESDIR; | ||
393 | } else | ||
394 | load_dir = ENGINESDIR; | ||
395 | 390 | ||
396 | iterator = ENGINE_by_id("dynamic"); | 391 | iterator = ENGINE_by_id("dynamic"); |
397 | if (!iterator || | 392 | if (!iterator || |
diff --git a/src/lib/libcrypto/x509/by_dir.c b/src/lib/libcrypto/x509/by_dir.c index 032210424d..7b7d14a950 100644 --- a/src/lib/libcrypto/x509/by_dir.c +++ b/src/lib/libcrypto/x509/by_dir.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: by_dir.c,v 1.36 2015/02/12 03:54:07 jsing Exp $ */ | 1 | /* $OpenBSD: by_dir.c,v 1.37 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -124,20 +124,14 @@ dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, | |||
124 | { | 124 | { |
125 | int ret = 0; | 125 | int ret = 0; |
126 | BY_DIR *ld; | 126 | BY_DIR *ld; |
127 | char *dir = NULL; | ||
128 | 127 | ||
129 | ld = (BY_DIR *)ctx->method_data; | 128 | ld = (BY_DIR *)ctx->method_data; |
130 | 129 | ||
131 | switch (cmd) { | 130 | switch (cmd) { |
132 | case X509_L_ADD_DIR: | 131 | case X509_L_ADD_DIR: |
133 | if (argl == X509_FILETYPE_DEFAULT) { | 132 | if (argl == X509_FILETYPE_DEFAULT) { |
134 | if (issetugid() == 0) | 133 | ret = add_cert_dir(ld, X509_get_default_cert_dir(), |
135 | dir = getenv(X509_get_default_cert_dir_env()); | 134 | X509_FILETYPE_PEM); |
136 | if (dir) | ||
137 | ret = add_cert_dir(ld, dir, X509_FILETYPE_PEM); | ||
138 | else | ||
139 | ret = add_cert_dir(ld, X509_get_default_cert_dir(), | ||
140 | X509_FILETYPE_PEM); | ||
141 | if (!ret) { | 135 | if (!ret) { |
142 | X509err(X509_F_DIR_CTRL, X509_R_LOADING_CERT_DIR); | 136 | X509err(X509_F_DIR_CTRL, X509_R_LOADING_CERT_DIR); |
143 | } | 137 | } |
diff --git a/src/lib/libcrypto/x509/by_file.c b/src/lib/libcrypto/x509/by_file.c index 91a8e781b2..68920271fc 100644 --- a/src/lib/libcrypto/x509/by_file.c +++ b/src/lib/libcrypto/x509/by_file.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: by_file.c,v 1.18 2015/02/05 01:33:22 reyk Exp $ */ | 1 | /* $OpenBSD: by_file.c,v 1.19 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -94,21 +94,13 @@ by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, | |||
94 | char **ret) | 94 | char **ret) |
95 | { | 95 | { |
96 | int ok = 0; | 96 | int ok = 0; |
97 | char *file = NULL; | ||
98 | 97 | ||
99 | switch (cmd) { | 98 | switch (cmd) { |
100 | case X509_L_FILE_LOAD: | 99 | case X509_L_FILE_LOAD: |
101 | if (argl == X509_FILETYPE_DEFAULT) { | 100 | if (argl == X509_FILETYPE_DEFAULT) { |
102 | if (issetugid() == 0) | 101 | ok = (X509_load_cert_crl_file(ctx, |
103 | file = getenv(X509_get_default_cert_file_env()); | 102 | X509_get_default_cert_file(), |
104 | if (file) | 103 | X509_FILETYPE_PEM) != 0); |
105 | ok = (X509_load_cert_crl_file(ctx, file, | ||
106 | X509_FILETYPE_PEM) != 0); | ||
107 | else | ||
108 | ok = (X509_load_cert_crl_file(ctx, | ||
109 | X509_get_default_cert_file(), | ||
110 | X509_FILETYPE_PEM) != 0); | ||
111 | |||
112 | if (!ok) { | 104 | if (!ok) { |
113 | X509err(X509_F_BY_FILE_CTRL, | 105 | X509err(X509_F_BY_FILE_CTRL, |
114 | X509_R_LOADING_DEFAULTS); | 106 | X509_R_LOADING_DEFAULTS); |
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index c383fda4f2..442035625a 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.c,v 1.40 2015/02/11 02:17:59 jsing Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.41 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -483,12 +483,6 @@ check_chain_extensions(X509_STORE_CTX *ctx) | |||
483 | } else { | 483 | } else { |
484 | allow_proxy_certs = | 484 | allow_proxy_certs = |
485 | !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); | 485 | !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); |
486 | #if 0 | ||
487 | /* A hack to keep people who don't want to modify their | ||
488 | software happy */ | ||
489 | if (issetugid() == 0 && getenv("OPENSSL_ALLOW_PROXY_CERTS")) | ||
490 | allow_proxy_certs = 1; | ||
491 | #endif | ||
492 | purpose = ctx->param->purpose; | 486 | purpose = ctx->param->purpose; |
493 | } | 487 | } |
494 | 488 | ||
diff --git a/src/lib/libssl/src/crypto/conf/conf_api.c b/src/lib/libssl/src/crypto/conf/conf_api.c index efa4be9f6b..f296e6a962 100644 --- a/src/lib/libssl/src/crypto/conf/conf_api.c +++ b/src/lib/libssl/src/crypto/conf/conf_api.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_api.c,v 1.14 2015/02/10 11:22:21 jsing Exp $ */ | 1 | /* $OpenBSD: conf_api.c,v 1.15 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -130,7 +130,6 @@ char * | |||
130 | _CONF_get_string(const CONF *conf, const char *section, const char *name) | 130 | _CONF_get_string(const CONF *conf, const char *section, const char *name) |
131 | { | 131 | { |
132 | CONF_VALUE *v, vv; | 132 | CONF_VALUE *v, vv; |
133 | char *p; | ||
134 | 133 | ||
135 | if (name == NULL) | 134 | if (name == NULL) |
136 | return (NULL); | 135 | return (NULL); |
@@ -141,14 +140,6 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
141 | v = lh_CONF_VALUE_retrieve(conf->data, &vv); | 140 | v = lh_CONF_VALUE_retrieve(conf->data, &vv); |
142 | if (v != NULL) | 141 | if (v != NULL) |
143 | return (v->value); | 142 | return (v->value); |
144 | if (strcmp(section, "ENV") == 0) { | ||
145 | if (issetugid() == 0) | ||
146 | p = getenv(name); | ||
147 | else | ||
148 | p = NULL; | ||
149 | if (p != NULL) | ||
150 | return (p); | ||
151 | } | ||
152 | } | 143 | } |
153 | vv.section = "default"; | 144 | vv.section = "default"; |
154 | vv.name = (char *)name; | 145 | vv.name = (char *)name; |
@@ -157,11 +148,8 @@ _CONF_get_string(const CONF *conf, const char *section, const char *name) | |||
157 | return (v->value); | 148 | return (v->value); |
158 | else | 149 | else |
159 | return (NULL); | 150 | return (NULL); |
160 | } else { | 151 | } else |
161 | if (issetugid()) | 152 | return (NULL); |
162 | return (NULL); | ||
163 | return (getenv(name)); | ||
164 | } | ||
165 | } | 153 | } |
166 | 154 | ||
167 | static unsigned long | 155 | static unsigned long |
diff --git a/src/lib/libssl/src/crypto/conf/conf_mod.c b/src/lib/libssl/src/crypto/conf/conf_mod.c index 4363f297c7..cb54cc2a87 100644 --- a/src/lib/libssl/src/crypto/conf/conf_mod.c +++ b/src/lib/libssl/src/crypto/conf/conf_mod.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: conf_mod.c,v 1.25 2014/07/22 02:21:20 beck Exp $ */ | 1 | /* $OpenBSD: conf_mod.c,v 1.26 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2001. | 3 | * project 2001. |
4 | */ | 4 | */ |
@@ -546,10 +546,6 @@ CONF_get1_default_config_file(void) | |||
546 | { | 546 | { |
547 | char *file = NULL; | 547 | char *file = NULL; |
548 | 548 | ||
549 | if (issetugid() == 0) | ||
550 | file = getenv("OPENSSL_CONF"); | ||
551 | if (file) | ||
552 | return strdup(file); | ||
553 | if (asprintf(&file, "%s/openssl.cnf", | 549 | if (asprintf(&file, "%s/openssl.cnf", |
554 | X509_get_default_cert_area()) == -1) | 550 | X509_get_default_cert_area()) == -1) |
555 | return (NULL); | 551 | return (NULL); |
diff --git a/src/lib/libssl/src/crypto/engine/eng_list.c b/src/lib/libssl/src/crypto/engine/eng_list.c index 740db90852..939cc82b17 100644 --- a/src/lib/libssl/src/crypto/engine/eng_list.c +++ b/src/lib/libssl/src/crypto/engine/eng_list.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: eng_list.c,v 1.17 2015/02/11 03:19:37 doug Exp $ */ | 1 | /* $OpenBSD: eng_list.c,v 1.18 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL | 2 | /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL |
3 | * project 2000. | 3 | * project 2000. |
4 | */ | 4 | */ |
@@ -386,12 +386,7 @@ ENGINE_by_id(const char *id) | |||
386 | return iterator; | 386 | return iterator; |
387 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ | 387 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ |
388 | if (strcmp(id, "dynamic")) { | 388 | if (strcmp(id, "dynamic")) { |
389 | if (issetugid() == 0) { | 389 | load_dir = ENGINESDIR; |
390 | load_dir = getenv("OPENSSL_ENGINES"); | ||
391 | if (load_dir == NULL) | ||
392 | load_dir = ENGINESDIR; | ||
393 | } else | ||
394 | load_dir = ENGINESDIR; | ||
395 | 390 | ||
396 | iterator = ENGINE_by_id("dynamic"); | 391 | iterator = ENGINE_by_id("dynamic"); |
397 | if (!iterator || | 392 | if (!iterator || |
diff --git a/src/lib/libssl/src/crypto/x509/by_dir.c b/src/lib/libssl/src/crypto/x509/by_dir.c index 032210424d..7b7d14a950 100644 --- a/src/lib/libssl/src/crypto/x509/by_dir.c +++ b/src/lib/libssl/src/crypto/x509/by_dir.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: by_dir.c,v 1.36 2015/02/12 03:54:07 jsing Exp $ */ | 1 | /* $OpenBSD: by_dir.c,v 1.37 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -124,20 +124,14 @@ dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, | |||
124 | { | 124 | { |
125 | int ret = 0; | 125 | int ret = 0; |
126 | BY_DIR *ld; | 126 | BY_DIR *ld; |
127 | char *dir = NULL; | ||
128 | 127 | ||
129 | ld = (BY_DIR *)ctx->method_data; | 128 | ld = (BY_DIR *)ctx->method_data; |
130 | 129 | ||
131 | switch (cmd) { | 130 | switch (cmd) { |
132 | case X509_L_ADD_DIR: | 131 | case X509_L_ADD_DIR: |
133 | if (argl == X509_FILETYPE_DEFAULT) { | 132 | if (argl == X509_FILETYPE_DEFAULT) { |
134 | if (issetugid() == 0) | 133 | ret = add_cert_dir(ld, X509_get_default_cert_dir(), |
135 | dir = getenv(X509_get_default_cert_dir_env()); | 134 | X509_FILETYPE_PEM); |
136 | if (dir) | ||
137 | ret = add_cert_dir(ld, dir, X509_FILETYPE_PEM); | ||
138 | else | ||
139 | ret = add_cert_dir(ld, X509_get_default_cert_dir(), | ||
140 | X509_FILETYPE_PEM); | ||
141 | if (!ret) { | 135 | if (!ret) { |
142 | X509err(X509_F_DIR_CTRL, X509_R_LOADING_CERT_DIR); | 136 | X509err(X509_F_DIR_CTRL, X509_R_LOADING_CERT_DIR); |
143 | } | 137 | } |
diff --git a/src/lib/libssl/src/crypto/x509/by_file.c b/src/lib/libssl/src/crypto/x509/by_file.c index 91a8e781b2..68920271fc 100644 --- a/src/lib/libssl/src/crypto/x509/by_file.c +++ b/src/lib/libssl/src/crypto/x509/by_file.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: by_file.c,v 1.18 2015/02/05 01:33:22 reyk Exp $ */ | 1 | /* $OpenBSD: by_file.c,v 1.19 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -94,21 +94,13 @@ by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, | |||
94 | char **ret) | 94 | char **ret) |
95 | { | 95 | { |
96 | int ok = 0; | 96 | int ok = 0; |
97 | char *file = NULL; | ||
98 | 97 | ||
99 | switch (cmd) { | 98 | switch (cmd) { |
100 | case X509_L_FILE_LOAD: | 99 | case X509_L_FILE_LOAD: |
101 | if (argl == X509_FILETYPE_DEFAULT) { | 100 | if (argl == X509_FILETYPE_DEFAULT) { |
102 | if (issetugid() == 0) | 101 | ok = (X509_load_cert_crl_file(ctx, |
103 | file = getenv(X509_get_default_cert_file_env()); | 102 | X509_get_default_cert_file(), |
104 | if (file) | 103 | X509_FILETYPE_PEM) != 0); |
105 | ok = (X509_load_cert_crl_file(ctx, file, | ||
106 | X509_FILETYPE_PEM) != 0); | ||
107 | else | ||
108 | ok = (X509_load_cert_crl_file(ctx, | ||
109 | X509_get_default_cert_file(), | ||
110 | X509_FILETYPE_PEM) != 0); | ||
111 | |||
112 | if (!ok) { | 104 | if (!ok) { |
113 | X509err(X509_F_BY_FILE_CTRL, | 105 | X509err(X509_F_BY_FILE_CTRL, |
114 | X509_R_LOADING_DEFAULTS); | 106 | X509_R_LOADING_DEFAULTS); |
diff --git a/src/lib/libssl/src/crypto/x509/x509_vfy.c b/src/lib/libssl/src/crypto/x509/x509_vfy.c index c383fda4f2..442035625a 100644 --- a/src/lib/libssl/src/crypto/x509/x509_vfy.c +++ b/src/lib/libssl/src/crypto/x509/x509_vfy.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vfy.c,v 1.40 2015/02/11 02:17:59 jsing Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.41 2015/04/11 16:03:21 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -483,12 +483,6 @@ check_chain_extensions(X509_STORE_CTX *ctx) | |||
483 | } else { | 483 | } else { |
484 | allow_proxy_certs = | 484 | allow_proxy_certs = |
485 | !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); | 485 | !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS); |
486 | #if 0 | ||
487 | /* A hack to keep people who don't want to modify their | ||
488 | software happy */ | ||
489 | if (issetugid() == 0 && getenv("OPENSSL_ALLOW_PROXY_CERTS")) | ||
490 | allow_proxy_certs = 1; | ||
491 | #endif | ||
492 | purpose = ctx->param->purpose; | 486 | purpose = ctx->param->purpose; |
493 | } | 487 | } |
494 | 488 | ||
diff --git a/src/lib/libssl/src/doc/apps/config.pod b/src/lib/libssl/src/doc/apps/config.pod index d018dfce50..57ec54ec9e 100644 --- a/src/lib/libssl/src/doc/apps/config.pod +++ b/src/lib/libssl/src/doc/apps/config.pod | |||
@@ -43,11 +43,8 @@ The value string undergoes variable expansion. This can be done by | |||
43 | including the form B<$var> or B<${var}>: this will substitute the value | 43 | including the form B<$var> or B<${var}>: this will substitute the value |
44 | of the named variable in the current section. It is also possible to | 44 | of the named variable in the current section. It is also possible to |
45 | substitute a value from another section using the syntax B<$section::name> | 45 | substitute a value from another section using the syntax B<$section::name> |
46 | or B<${section::name}>. By using the form B<$ENV::name> environment | 46 | or B<${section::name}>. An old form using B<$ENV::name> has been deprecated |
47 | variables can be substituted. It is also possible to assign values to | 47 | because it is unsafe. |
48 | environment variables by using the name B<ENV::name>, this will work | ||
49 | if the program looks up environment variables using the B<CONF> library | ||
50 | instead of calling B<getenv()> directly. | ||
51 | 48 | ||
52 | It is possible to escape certain characters by using any kind of quote | 49 | It is possible to escape certain characters by using any kind of quote |
53 | or the B<\> character. By making the last character of a line a B<\> | 50 | or the B<\> character. By making the last character of a line a B<\> |