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

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

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

commit a82bd3ce773575d394517953a7e703eb980b31e6
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                                   |  4 ++++
 2 files changed, 14 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 6320942aa2..3cfe4ee5e7 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 229c84648c..f94f467190 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -244,6 +244,10 @@
         Fix an allocation leak in the HTTP/2 backlog tracking when a stream is
         reset. (markt)
       </fix>
+      <fix>
+        Fix parsing of client certificates that specify more than one OCSP
+        responder for configurations that use OpenSSL-FFM. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">
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.