summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2018-05-03 17:41:26 +0200
committerJoe Orton <jorton@apache.org>2018-05-03 17:41:26 +0200
commit382e540ae5b09d48a73b90390eda2066fa679430 (patch)
tree7da98399438c9eefabca85aba947fae54550e089
parentmod_ssl: Add support for loading private keys from ENGINEs. Support (diff)
downloadapache2-382e540ae5b09d48a73b90390eda2066fa679430.tar.xz
apache2-382e540ae5b09d48a73b90390eda2066fa679430.zip
* modules/ssl/ssl_engine_pphrase.c (ssl_load_encrypted_pkey):
Simplify code, no functional change. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830836 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/ssl/ssl_engine_pphrase.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/modules/ssl/ssl_engine_pphrase.c b/modules/ssl/ssl_engine_pphrase.c
index 7658453590..0b8023eb80 100644
--- a/modules/ssl/ssl_engine_pphrase.c
+++ b/modules/ssl/ssl_engine_pphrase.c
@@ -139,7 +139,6 @@ apr_status_t ssl_load_encrypted_pkey(server_rec *s, apr_pool_t *p, int idx,
ssl_asn1_t *asn1;
unsigned char *ucp;
long int length;
- BOOL bReadable;
int nPassPhrase = (*pphrases)->nelts;
int nPassPhraseRetry = 0;
apr_time_t pkey_mtime = 0;
@@ -216,16 +215,12 @@ apr_status_t ssl_load_encrypted_pkey(server_rec *s, apr_pool_t *p, int idx,
* is not empty. */
ERR_clear_error();
- bReadable = ((pPrivateKey = modssl_read_privatekey(ppcb_arg.pkey_file,
- NULL, ssl_pphrase_Handle_CB, &ppcb_arg)) != NULL ?
- TRUE : FALSE);
-
- /*
- * when the private key file now was readable,
- * it's fine and we go out of the loop
- */
- if (bReadable)
- break;
+ pPrivateKey = modssl_read_privatekey(ppcb_arg.pkey_file, NULL,
+ ssl_pphrase_Handle_CB, &ppcb_arg);
+ /* If the private key was successfully read, nothing more to
+ do here. */
+ if (pPrivateKey != NULL)
+ break;
/*
* when we have more remembered pass phrases