]> granicus.if.org Git - apache/commitdiff
* modules/ssl/ssl_engine_pphrase.c (ssl_load_encrypted_pkey):
authorJoe Orton <jorton@apache.org>
Thu, 3 May 2018 15:41:26 +0000 (15:41 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 3 May 2018 15:41:26 +0000 (15:41 +0000)
  Simplify code, no functional change.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830836 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_pphrase.c

index 76584535908f577e0f366b0286cf0ab3debf5b00..0b8023eb80d7c9a5cf780d38d2b0007bc15cda17 100644 (file)
@@ -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