Commit 6771020733 for openssl.org

commit 677102073341cdd75c9c4b6e6ed146025dba7a19
Author: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Date:   Wed Aug 5 15:05:35 2026 +0200

    ssl: add missing SSLfatal in TLSv1.3 finished MAC computation

    tls13_final_finish_mac() returned failure on a NULL handshake digest
    without calling SSLfatal() or raising any error, while its callers on
    the Finished construction and processing paths assume the fatal state
    was already set. This should currently not happen as the handshake
    digest must have been fetched successfully earlier in the handshake,
    so this is just future proofing of the error handling.

    Assisted-by: Claude:claude-fable-5

    Reviewed-by: Matt Caswell <matt@openssl.foundation>
    Reviewed-by: Frederik Wedel-Heinen <fwh.openssl@gmail.com>
    MergeDate: Tue Aug 11 07:49:36 2026
    (Merged from https://github.com/openssl/openssl/pull/32198)

diff --git a/ssl/tls13_enc.c b/ssl/tls13_enc.c
index ae47f5301c..2ac8eeddc7 100644
--- a/ssl/tls13_enc.c
+++ b/ssl/tls13_enc.c
@@ -280,8 +280,10 @@ size_t tls13_final_finish_mac(SSL_CONNECTION *s, const char *str, size_t slen,
     OSSL_PARAM params[2], *p = params;
     SSL_CTX *sctx = SSL_CONNECTION_GET_CTX(s);

-    if (md == NULL)
+    if (md == NULL) {
+        SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
         return 0;
+    }

     /* Safe to cast away const here since we're not "getting" any data */
     if (sctx->propq != NULL)