You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/06/21 12:56:38 UTC

[tomcat] branch 9.0.x updated: Fix OpenSSL version check

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

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 1bef182ffa Fix OpenSSL version check
1bef182ffa is described below

commit 1bef182ffa6ddbe750fe04acb830473be9b1bcac
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Jun 21 13:56:06 2022 +0100

    Fix OpenSSL version check
    
    Also some minor formatting clean-up
---
 java/org/apache/catalina/core/AprLifecycleListener.java | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java
index 07757bc753..6f7d280202 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -175,10 +175,8 @@ public class AprLifecycleListener implements LifecycleListener {
 
     }
 
-    private static void terminateAPR()
-        throws ClassNotFoundException, NoSuchMethodException,
-               IllegalAccessException, InvocationTargetException
-    {
+    private static void terminateAPR() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException,
+            InvocationTargetException {
         String methodName = "terminate";
         Method method = Class.forName("org.apache.tomcat.jni.Library")
             .getMethod(methodName, (Class [])null);
@@ -282,7 +280,7 @@ public class AprLifecycleListener implements LifecycleListener {
             return;
         }
         if (sslInitialized) {
-             //only once per VM
+            // Only once per VM
             return;
         }
 
@@ -304,7 +302,7 @@ public class AprLifecycleListener implements LifecycleListener {
         method.invoke(null, paramValues);
 
         // OpenSSL 3 onwards uses providers
-        boolean usingProviders = tcnMajor > 1 || (tcnVersion > 1233 && (SSL.version() & 0xF0000000L) > 2);
+        boolean usingProviders = tcnMajor > 1 || (tcnVersion > 1233 && (SSL.version() & 0xF0000000L) > 0x20000000);
 
         // Tomcat Native 1.x built with OpenSSL 1.x without explicitly enabling
         // FIPS and Tomcat Native < 1.2.34 built with OpenSSL 3.x will fail if


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