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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new dc568d6729 Fix backports
dc568d6729 is described below

commit dc568d6729c096dfbfd583017b766d2f90b5c646
Author: remm <[email protected]>
AuthorDate: Thu Oct 15 22:31:56 2026 +0200

    Fix backports
---
 java/org/apache/tomcat/util/buf/Asn1Writer.java               |  5 +++--
 .../tomcat/util/modeler/modules/LocalStrings.properties       |  1 +
 java/org/apache/tomcat/util/net/SSLHostConfig.java            | 11 +++++++++--
 test/org/apache/tomcat/util/descriptor/web/TestWebXml.java    |  4 ++--
 4 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/Asn1Writer.java 
b/java/org/apache/tomcat/util/buf/Asn1Writer.java
index 602ddbaac5..838bc2842b 100644
--- a/java/org/apache/tomcat/util/buf/Asn1Writer.java
+++ b/java/org/apache/tomcat/util/buf/Asn1Writer.java
@@ -113,10 +113,11 @@ public class Asn1Writer {
             // record a length > 127
             // Result is lengthSize = 1 + number of bytes to record length
             // Note the limit is required to terminate the loop since the shift
-            // distance is evaluated modulo 32.
+            // distance is evaluated modulo 32. Four bytes is the most any Java
+            // array length (a non-negative int) can need.
             do {
                 lengthSize++;
-            } while (lengthSize < 4 && (dataSize >>> (lengthSize * 8)) > 0);
+            } while (lengthSize < 5 && (dataSize >>> ((lengthSize - 1) * 8)) > 
0);
         }
 
         // 1 for tag + lengthSize + dataSize
diff --git 
a/java/org/apache/tomcat/util/modeler/modules/LocalStrings.properties 
b/java/org/apache/tomcat/util/modeler/modules/LocalStrings.properties
index 904e69c462..16d99888f5 100644
--- a/java/org/apache/tomcat/util/modeler/modules/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/modeler/modules/LocalStrings.properties
@@ -16,4 +16,5 @@
 # Do not edit this file directly.
 # To edit translations see: 
https://tomcat.apache.org/getinvolved.html#Translations
 
+modules.readDescriptorsError=Error reading descriptors
 source.introspectionError=Introspection error creating MBean for class [{0}]
diff --git a/java/org/apache/tomcat/util/net/SSLHostConfig.java 
b/java/org/apache/tomcat/util/net/SSLHostConfig.java
index f3b842d95a..bc3630294e 100644
--- a/java/org/apache/tomcat/util/net/SSLHostConfig.java
+++ b/java/org/apache/tomcat/util/net/SSLHostConfig.java
@@ -858,10 +858,17 @@ public class SSLHostConfig implements Serializable {
     /**
      * Obtain the current cipher suite (TLSv1.3) configuration.
      *
-     * @return An OpenSSL cipher suite string for the current configuration.
+     * @return An OpenSSL cipher suite string for the current configuration
+     *         or {@code null} if no cipher suites have been configured.
      */
     public String getCipherSuites() {
-        StringBuilder sb = new StringBuilder(cipherSuites);
+        if (cipherSuites == null && cipherSuitesFromCiphers == null) {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        if (cipherSuites != null) {
+            sb.append(cipherSuites);
+        }
         if (cipherSuitesFromCiphers != null && 
!cipherSuitesFromCiphers.isEmpty()) {
             if (!sb.isEmpty()) {
                 sb.append(':');
diff --git a/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java 
b/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
index 18da96410c..930bf3f14f 100644
--- a/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
+++ b/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
@@ -846,8 +846,8 @@ public class TestWebXml {
                 "<web-app xmlns=\"https://jakarta.ee/xml/ns/jakartaee\"\n"; +
                 "         
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"; +
                 "         
xsi:schemaLocation=\"https://jakarta.ee/xml/ns/jakartaee"; +
-                " https://jakarta.ee/xml/ns/jakartaee/web-app_6_2.xsd\"\n"; +
-                "         version=\"6.2\"\n" +
+                " https://jakarta.ee/xml/ns/jakartaee/web-app_6_1.xsd\"\n"; +
+                "         version=\"6.1\"\n" +
                 "         metadata-complete=\"true\">\n" +
                 "\n" +
                 "  <service-ref>\n" +


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

Reply via email to