(tomcat) branch 9.0.x updated: Fix OpenSSL-FFM with client certs with multiple OCSP responders

[email protected]
Newsgroups gmane.comp.jakarta.tomcat.devel
Message-ID <178656821960.2811625.1307412285937433493@gitbox3-he-fi.apache.org>
This is an automated email from the ASF dual-hosted git repository.

markt-asf 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 747effa4ae Fix OpenSSL-FFM with client certs with multiple OCSP responders
747effa4ae is described below

commit 747effa4aead3c7aaeed60534e60f1dc846348d2
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Aug 12 21:46:44 2026 +0100

    Fix OpenSSL-FFM with client certs with multiple OCSP responders
---
 .../apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java | 12 ++++++++++--
 webapps/docs/changelog.xml                                   |  8 ++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
index 70d60939ef..83acba6166 100644
--- a/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
+++ b/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLEngine.java
@@ -1277,11 +1277,19 @@ public final class OpenSSLEngine extends SSLEngine implements SSLUtil.ProtocolIn
     private static final byte[] OCSP_OID = { 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01 };
 
     private static void parseOCSPURLs(Asn1Parser parser, ArrayList<String> urls) {
+        // See RFC 5280, section 4.2.2.1 for format
+        // Outer sequence
+        int tag = parser.peekTag();
+        if (tag == ASN1_SEQUENCE) {
+            parser.parseTag(ASN1_SEQUENCE);
+            parser.parseFullLength();
+        }
+        // Iterate over nested sequences
         while (!parser.eof()) {
-            int tag = parser.peekTag();
+            tag = parser.peekTag();
             if (tag == ASN1_SEQUENCE) {
                 parser.parseTag(ASN1_SEQUENCE);
-                parser.parseFullLength();
+                parser.parseLength();
             } else if (tag == ASN1_OID) {
                 parser.parseTag(ASN1_OID);
                 int oidLen = parser.parseLength();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f4789b6d45..f83534d888 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -108,6 +108,14 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 9.0.122 (remm)" rtext="in development">
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        Fix parsing of client certificates that specify more than one OCSP
+        responder for configurations that use OpenSSL-FFM. (markt)
+      </fix>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 9.0.121 (remm)" rtext="release in progress">
   <subsection name="Catalina">
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.