This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git


The following commit(s) were added to refs/heads/main by this push:
     new ac6f59b81 Remove an unreachable if condition around CRLs in 
sslcontext.c
ac6f59b81 is described below

commit ac6f59b8162c52bc6fe1add64d38af9da9dd9c02
Author: Michael Osipov <micha...@apache.org>
AuthorDate: Fri Oct 27 12:52:19 2023 +0200

    Remove an unreachable if condition around CRLs in sslcontext.c
    
    SSL_CTX_get_cert_store() will never return NULL because it is initialized at
    context creation time with X509_STORE_new() and unless we have set it 
explicitly
    to NULL with SSL_CTX_set_cert_store().
---
 native/src/sslcontext.c           | 7 +++----
 xdocs/miscellaneous/changelog.xml | 3 +++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/native/src/sslcontext.c b/native/src/sslcontext.c
index b52258914..34669ff70 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -611,10 +611,9 @@ TCN_IMPLEMENT_CALL(jboolean, SSLContext, 
setCARevocation)(TCN_STDARGS, jlong ctx
         return JNI_FALSE;
     }
 
-    if (!c->crl) {
-        if ((c->crl = SSL_CTX_get_cert_store(c->ctx)) == NULL)
-            goto cleanup;
-    }
+    if (!c->crl)
+        c->crl = SSL_CTX_get_cert_store(c->ctx);
+
     if (J2S(file)) {
         lookup = X509_STORE_add_lookup(c->crl, X509_LOOKUP_file());
         if (lookup == NULL) {
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index c5ea8ce09..ffd0e10f5 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -56,6 +56,9 @@
     <add>
       Add Ant version (1.10.2) requirement identical to Tomcat. (michaelo)
     </add>
+    <update>
+      Remove an unreachable if condition around CRLs in sslcontext.c. 
(michaelo)
+    </update>
   </changelog>
 </section>
 <section name="Changes in 2.0.6">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to