diff options
| author | deraadt <> | 2014-06-29 00:52:18 +0000 |
|---|---|---|
| committer | deraadt <> | 2014-06-29 00:52:18 +0000 |
| commit | d911dabb7612c190534926f7712219cb024885c8 (patch) | |
| tree | 44979684b64cc8f9afbdecb5fc672f7771052b54 /src | |
| parent | a043daacc3e5405961a1cb3d2f45ae3a12576eaa (diff) | |
| download | openbsd-d911dabb7612c190534926f7712219cb024885c8.tar.gz openbsd-d911dabb7612c190534926f7712219cb024885c8.tar.bz2 openbsd-d911dabb7612c190534926f7712219cb024885c8.zip | |
correct issetugid sense as spotted by Stijn van Drongelen.
Substantially expand the conditional to reduce potential for error.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/engine/eng_list.c | 10 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/engine/eng_list.c | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/lib/libcrypto/engine/eng_list.c b/src/lib/libcrypto/engine/eng_list.c index 22e2abb01d..dddbaf0cc0 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.11 2014/06/23 22:19:02 deraadt Exp $ */ | 1 | /* $OpenBSD: eng_list.c,v 1.12 2014/06/29 00:52:18 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 | */ |
| @@ -385,9 +385,13 @@ ENGINE_by_id(const char *id) | |||
| 385 | return iterator; | 385 | return iterator; |
| 386 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ | 386 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ |
| 387 | if (strcmp(id, "dynamic")) { | 387 | if (strcmp(id, "dynamic")) { |
| 388 | if (issetugid() == 0 || | 388 | if (issetugid() == 0) { |
| 389 | (load_dir = getenv("OPENSSL_ENGINES")) == 0) | 389 | load_dir = getenv("OPENSSL_ENGINES"); |
| 390 | if (load_dir == NULL) | ||
| 391 | load_dir = ENGINESDIR; | ||
| 392 | } else | ||
| 390 | load_dir = ENGINESDIR; | 393 | load_dir = ENGINESDIR; |
| 394 | |||
| 391 | iterator = ENGINE_by_id("dynamic"); | 395 | iterator = ENGINE_by_id("dynamic"); |
| 392 | if (!iterator || | 396 | if (!iterator || |
| 393 | !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || | 397 | !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || |
diff --git a/src/lib/libssl/src/crypto/engine/eng_list.c b/src/lib/libssl/src/crypto/engine/eng_list.c index 22e2abb01d..dddbaf0cc0 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.11 2014/06/23 22:19:02 deraadt Exp $ */ | 1 | /* $OpenBSD: eng_list.c,v 1.12 2014/06/29 00:52:18 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 | */ |
| @@ -385,9 +385,13 @@ ENGINE_by_id(const char *id) | |||
| 385 | return iterator; | 385 | return iterator; |
| 386 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ | 386 | /* Prevent infinite recusrion if we're looking for the dynamic engine. */ |
| 387 | if (strcmp(id, "dynamic")) { | 387 | if (strcmp(id, "dynamic")) { |
| 388 | if (issetugid() == 0 || | 388 | if (issetugid() == 0) { |
| 389 | (load_dir = getenv("OPENSSL_ENGINES")) == 0) | 389 | load_dir = getenv("OPENSSL_ENGINES"); |
| 390 | if (load_dir == NULL) | ||
| 391 | load_dir = ENGINESDIR; | ||
| 392 | } else | ||
| 390 | load_dir = ENGINESDIR; | 393 | load_dir = ENGINESDIR; |
| 394 | |||
| 391 | iterator = ENGINE_by_id("dynamic"); | 395 | iterator = ENGINE_by_id("dynamic"); |
| 392 | if (!iterator || | 396 | if (!iterator || |
| 393 | !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || | 397 | !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || |
