From 7f6b12ba6ff3c272024bb8465127e22e0e9c8836 Mon Sep 17 00:00:00 2001 From: Adil Alperen Ciftci Date: Thu, 29 Oct 2026 16:53:45 +0300 Subject: [PATCH] NSE TLS: offer SHA-384 signature schemes by default I traced the missed TLS 1.3 detection to the default signature-scheme vector omitting its SHA-384 RSA and ECDSA entries. I added only rsa_pkcs1_sha384 and ecdsa_secp384r1_sha384, increasing the extension by four bytes. I covered the exact ordering with an NSE unit assertion and reproduced the before/after result against a local P-384/SHA-384 TLS 1.3 server. Signed-off-by: Adil Alperen Ciftci --- nselib/tls.lua | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/nselib/tls.lua b/nselib/tls.lua index 29cfe357c..47f93aab9 100644 --- a/nselib/tls.lua +++ b/nselib/tls.lua @@ -1791,13 +1791,16 @@ do DEFAULT_SIGALGS = EXTENSION_HELPERS["signature_algorithms"](sigalgs) end -- Equivalent for TLSv1.3 is SignatureScheme --- We'll offer all the sha256 and sha512 variants, plus a few extra +-- Offer common sha256 and sha512 variants, the certificate-relevant sha384 +-- schemes, plus a few extra. local DEFAULT_SIGSCHEMES do local sigalgs = { "rsa_pkcs1_sha256", + "rsa_pkcs1_sha384", "rsa_pkcs1_sha512", "ecdsa_secp256r1_sha256", + "ecdsa_secp384r1_sha384", "ecdsa_secp521r1_sha512", "rsa_pss_rsae_sha256", "rsa_pss_rsae_sha512", @@ -2084,4 +2087,25 @@ end for _, name in ipairs(DEFAULT_ELLIPTIC_CURVES) do test_suite:add_test(unittest.not_nil(ELLIPTIC_CURVES[name]), name .. " default elliptic curve (supported group)") end +local expected_default_sigschemes = EXTENSION_HELPERS["signature_algorithms_13"]({ + "rsa_pkcs1_sha256", + "rsa_pkcs1_sha384", + "rsa_pkcs1_sha512", + "ecdsa_secp256r1_sha256", + "ecdsa_secp384r1_sha384", + "ecdsa_secp521r1_sha512", + "rsa_pss_rsae_sha256", + "rsa_pss_rsae_sha512", + "ed25519", + "ed448", + "rsa_pss_pss_sha256", + "rsa_pss_pss_sha512", + "rsa_pkcs1_sha1", + "ecdsa_sha1", + "mldsa44", +}) +test_suite:add_test( + unittest.equal(DEFAULT_SIGSCHEMES, expected_default_sigschemes), + "default TLSv1.3 signature schemes" +) return _ENV;