This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new d2bb194eee Fix backports
d2bb194eee is described below
commit d2bb194eeec962ce78fe2c4690aefb9f13af6bfc
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 78fbca3ad0..124dbb27d1 100644
--- a/java/org/apache/tomcat/util/net/SSLHostConfig.java
+++ b/java/org/apache/tomcat/util/net/SSLHostConfig.java
@@ -856,10 +856,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.length() > 0) {
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 8209d3f09b..0c07d4d4c0 100644
--- a/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
+++ b/test/org/apache/tomcat/util/descriptor/web/TestWebXml.java
@@ -819,8 +819,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]