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

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


The following commit(s) were added to refs/heads/main by this push:
     new 16f62ec935 Refactor for clarity and cleaner initialisation
16f62ec935 is described below

commit 16f62ec935b3d46730180388a8a5aedb5af00e91
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jun 3 12:03:09 2026 +0100

    Refactor for clarity and cleaner initialisation
---
 .../ciphers/OpenSSLCipherConfigurationParser.java        | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git 
a/java/org/apache/tomcat/util/net/openssl/ciphers/OpenSSLCipherConfigurationParser.java
 
b/java/org/apache/tomcat/util/net/openssl/ciphers/OpenSSLCipherConfigurationParser.java
index 97280c4edd..0f0354f185 100644
--- 
a/java/org/apache/tomcat/util/net/openssl/ciphers/OpenSSLCipherConfigurationParser.java
+++ 
b/java/org/apache/tomcat/util/net/openssl/ciphers/OpenSSLCipherConfigurationParser.java
@@ -494,13 +494,8 @@ public class OpenSSLCipherConfigurationParser {
         addListAlias(kSRP, filterByKeyExchange(allCiphers, 
Collections.singleton(KeyExchange.SRP)));
         addListAlias(SRP, filterByKeyExchange(allCiphers, 
Collections.singleton(KeyExchange.SRP)));
 
-        /*
-         * initialized needs to be set to true here to avoid an infinite loop 
as parse(String) will call init() if
-         * initialized is not true.
-         */
-        initialized = true;
-
-        addListAlias(DEFAULT, 
parse("ALL:!eNULL:!aNULL:!DES:!RC2:!RC4:!DSS:!SEED:!IDEA:!CAMELLIA:!AESCCM:!3DES:!ARIA"));
+        addListAlias(DEFAULT,
+                
parseInternal("ALL:!eNULL:!aNULL:!DES:!RC2:!RC4:!DSS:!SEED:!IDEA:!CAMELLIA:!AESCCM:!3DES:!ARIA"));
         // COMPLEMENTOFDEFAULT is also not exactly as defined by the docs
         LinkedHashSet<Cipher> complementOfDefault =
                 filterByKeyExchange(all, new 
HashSet<>(Arrays.asList(KeyExchange.EDH, KeyExchange.EECDH)));
@@ -518,6 +513,8 @@ public class OpenSSLCipherConfigurationParser {
         complementOfDefault.addAll(aliases.get(ARIA));
         defaultSort(complementOfDefault);
         addListAlias(COMPLEMENTOFDEFAULT, complementOfDefault);
+
+        initialized = true;
     }
 
     static void addListAlias(String alias, Set<Cipher> ciphers) {
@@ -683,6 +680,11 @@ public class OpenSSLCipherConfigurationParser {
         if (!initialized) {
             init();
         }
+        return parseInternal(expression);
+    }
+
+
+    private static LinkedHashSet<Cipher> parseInternal(String expression) {
         String[] elements = expression.split(SEPARATOR);
         // Handle PROFILE= using OpenSSL (if present, otherwise warn), then 
replace elements with that
         if (elements.length == 1 && elements[0].startsWith("PROFILE=")) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to