File 0465-Fix-function_clause-error.patch of Package erlang

From ac294e8efd38b95ed42887f70c654fe3e230c31e Mon Sep 17 00:00:00 2001
From: Nikita Vorobey <nikita.v@wellnutscorp.com>
Date: Thu, 12 Dec 2024 23:06:09 +0100
Subject: [PATCH] Fix function_clause error

The error occurs if more than one certificate is configured and the first certificate fails the check by the tls_handshake_1_3:check_cert_sign_algo function. The recursive call to the select_server_cert_key_pair function fails and as a result the TLS connection is not established.
---
 lib/ssl/src/tls_server_connection_1_3.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/ssl/src/tls_server_connection_1_3.erl b/lib/ssl/src/tls_server_connection_1_3.erl
index 8801f00b67..5479eb8a9e 100644
--- a/lib/ssl/src/tls_server_connection_1_3.erl
+++ b/lib/ssl/src/tls_server_connection_1_3.erl
@@ -702,7 +702,7 @@ select_server_cert_key_pair(_,[], _,_,_,_, undefined) ->
 select_server_cert_key_pair(Session, [#{private_key := Key, certs := [Cert| _] = Certs} | Rest],
                             ClientSignAlgs, ClientSignAlgsCert, CertAuths,
                             #state{static_env = #static_env{cert_db = CertDbHandle,
-                                                            cert_db_ref = CertDbRef} = State},
+                                                            cert_db_ref = CertDbRef}} = State,
                             Default0) ->
     {_, SignAlgo, SignHash, _, _} = tls_handshake_1_3:get_certificate_params(Cert),
     %% TODO: We do validate the signature algorithm and signature hash
-- 
2.43.0

openSUSE Build Service is sponsored by