Commit 03f200cabb for openssl.org

commit 03f200cabbf064ddda03160056fdb82bfc0c2612
Author: Matt Caswell <matt@openssl.foundation>
Date:   Wed Aug 19 16:32:56 2026 +0100

    Make the TLS 1.3 resumption PSK check aware of DTLS 1.3

    tls13_check_resumption_psk() tells tls_construct_ctos_early_data()
    whether the resumption session can key 0-RTT, but compared the session
    version against TLS1_3_VERSION only. A DTLS 1.3 session records
    DTLS1_3_VERSION, so the check never matched for DTLS.

    The caller then fell back to the external PSK session, which is NULL
    when resuming, and took the suppression path: max_early_data was set to
    0, early_data_suppressed was set, and the early_data extension was not
    sent. SSL_connect() ran an ordinary handshake and returned WANT_READ
    with an empty error queue, so SSL_write_early_data() returned 0 with
    nothing to indicate why.

    Compare against DTLS1_3_VERSION for DTLS, using the version1_3 idiom
    the calling function already uses.

    The helper is newer than the DTLS 1.3 work: it was factored out of
    tls_construct_ctos_early_data() after that function had been made
    version aware, so it never picked up the DTLS case.

    Fixes the DTLS 1.3 iterations of nine sslapitest early data tests.

    Assisted-by: Claude Code:claude-opus-5
    Reviewed-by: Ryan Hooper <ryanh@openssl.foundation>
    Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
    Merge-date: Fri Aug 21 18:10:39 2026
    Merged-from: https://github.com/openssl/openssl/pull/32441

diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c
index 525c324f41..a1a00a9982 100644
--- a/ssl/statem/extensions_clnt.c
+++ b/ssl/statem/extensions_clnt.c
@@ -1100,9 +1100,10 @@ static int tls13_check_resumption_psk(SSL_CONNECTION *s, const EVP_MD *handmd)
 {
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);
     const EVP_MD *mdres;
+    const int version1_3 = SSL_CONNECTION_IS_DTLS(s) ? DTLS1_3_VERSION : TLS1_3_VERSION;

     if (s->session == NULL
-        || s->session->ssl_version != TLS1_3_VERSION
+        || s->session->ssl_version != version1_3
         || s->session->ext.ticklen == 0
         || s->session->cipher == NULL)
         return 0;