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/libcrypto/engine | |
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/libcrypto/engine')
-rw-r--r-- | src/lib/libcrypto/engine/eng_list.c | 9 |
1 files changed, 2 insertions, 7 deletions
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 || |