diff options
| author | deraadt <> | 2015-04-11 16:03:21 +0000 |
|---|---|---|
| committer | deraadt <> | 2015-04-11 16:03:21 +0000 |
| commit | b6e092d1e41107edc3265fcda97c497aa21950e1 (patch) | |
| tree | 02ee416418c40719cf48cd968d4b546afbaf642a /src/lib/libcrypto/engine | |
| parent | 3de00996e453d8f15c3be32318c2c06666256670 (diff) | |
| download | openbsd-b6e092d1e41107edc3265fcda97c497aa21950e1.tar.gz openbsd-b6e092d1e41107edc3265fcda97c497aa21950e1.tar.bz2 openbsd-b6e092d1e41107edc3265fcda97c497aa21950e1.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 || |
