You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2026/08/26 12:43:21 UTC

(tomcat-native) branch main updated (10c98b699 -> 035249cc4)

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

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


    from 10c98b699 Try using latest checkout and upload-artifect actions in the workflow
     new 54f066dda Fix a potential crash when negotiating ALPN
     new 035249cc4 Fallback as intended if ALPN negotiation fails.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 native/src/sslutils.c             | 11 ++++++-----
 xdocs/miscellaneous/changelog.xml |  8 ++++++++
 2 files changed, 14 insertions(+), 5 deletions(-)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


(tomcat-native) 02/02: Fallback as intended if ALPN negotiation fails.

Posted by ma...@apache.org.
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-native.git

commit 035249cc49b5f00fb1e457e504abae5bbc9c1345
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 26 13:35:59 2026 +0100

    Fallback as intended if ALPN negotiation fails.
---
 native/src/sslutils.c             | 9 +++++----
 xdocs/miscellaneous/changelog.xml | 5 +++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/native/src/sslutils.c b/native/src/sslutils.c
index 857244d01..a4b9e2cea 100644
--- a/native/src/sslutils.c
+++ b/native/src/sslutils.c
@@ -476,12 +476,13 @@ int select_next_proto(SSL *ssl, const unsigned char **out, unsigned char *outlen
     }
 
     if (supported_protos_len > 0 && inlen > 0 && failure_behavior == SSL_SELECTOR_FAILURE_CHOOSE_MY_LAST_PROTOCOL) {
-         // There were no match but we just select our last protocol and hope the other peer support it.
+         // There was no match so select our last protocol and hope the peer supports it.
          //
-         // decrement the pointer again so the pointer points to the start of the protocol.
-         p -= proto_len;
+         // Switch the pointer to our list and decrement by the length of the last entry so the pointer points to the
+         // start of the protocol.
+         p = supported_protos - target_proto_len;
          *out = p;
-         *outlen = proto_len;
+         *outlen = target_proto_len;
          return SSL_TLSEXT_ERR_OK;
     }
     // TODO: OpenSSL currently not support to fail with fatal error. Once this changes we can also support it here.
diff --git a/xdocs/miscellaneous/changelog.xml b/xdocs/miscellaneous/changelog.xml
index a20e6996c..50ca0dae9 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -50,6 +50,11 @@
     <fix>
       Fix a potential crash when negotiating ALPN. (markt)
     </fix>
+    <fix>
+      If ALPN negotiation fails and failure is configured to use the last server
+      protocol in the list, use it rather than the last protocol offered by the
+      client. (markt)
+    </fix>
   </changelog>
 </section>
 <section name="2.0.15" rtext="2026-06-15">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


(tomcat-native) 01/02: Fix a potential crash when negotiating ALPN

Posted by ma...@apache.org.
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-native.git

commit 54f066dda606706dff8dac3b9ca3f63287ccf3c4
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 26 13:21:11 2026 +0100

    Fix a potential crash when negotiating ALPN
---
 native/src/sslutils.c             | 2 +-
 xdocs/miscellaneous/changelog.xml | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/native/src/sslutils.c b/native/src/sslutils.c
index edc9fa8b0..857244d01 100644
--- a/native/src/sslutils.c
+++ b/native/src/sslutils.c
@@ -471,7 +471,7 @@ int select_next_proto(SSL *ssl, const unsigned char **out, unsigned char *outlen
         }
 
         // increment len and pointers.
-        i += target_proto_len;
+        i += 1 + target_proto_len;
         supported_protos += target_proto_len;
     }
 
diff --git a/xdocs/miscellaneous/changelog.xml b/xdocs/miscellaneous/changelog.xml
index a042749e1..a20e6996c 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -47,6 +47,9 @@
     <update>
       Make Windows 10 / 11 the default target version for Windows builds. (rjung)
     </update>
+    <fix>
+      Fix a potential crash when negotiating ALPN. (markt)
+    </fix>
   </changelog>
 </section>
 <section name="2.0.15" rtext="2026-06-15">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org