You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2018/05/03 15:41:26 UTC

svn commit: r1830836 - /httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c

Author: jorton
Date: Thu May  3 15:41:26 2018
New Revision: 1830836

URL: http://svn.apache.org/viewvc?rev=1830836&view=rev
Log:
* modules/ssl/ssl_engine_pphrase.c (ssl_load_encrypted_pkey):
  Simplify code, no functional change.

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c?rev=1830836&r1=1830835&r2=1830836&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_pphrase.c Thu May  3 15:41:26 2018
@@ -139,7 +139,6 @@ apr_status_t ssl_load_encrypted_pkey(ser
     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(ser
          * 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