# HG changeset patch # User Kim Alvefur # Date 1724692863 -7200 # Node ID 078780f262d56db64afeb84f3ad73c6da1d6e8b4 # Parent a1bc6533bbba40e042b6e10f6d927eb75cfcb948 mod_s2s: Fix traceback due to type confusion (Thanks Menel) The code assumed a 2-d sparse array but it could also be a string. diff -r a1bc6533bbba -r 078780f262d5 plugins/mod_s2s.lua --- a/plugins/mod_s2s.lua Sun Aug 18 17:01:47 2024 +0200 +++ b/plugins/mod_s2s.lua Mon Aug 26 19:21:03 2024 +0200 @@ -986,7 +986,7 @@ -- Complete the sentence "Your certificate " with what's wrong local function friendly_cert_error(session) --> string if session.cert_chain_status == "invalid" then - if session.cert_chain_errors then + if type(session.cert_chain_errors) == "table" then local cert_errors = set.new(session.cert_chain_errors[1]); if cert_errors:contains("certificate has expired") then return "has expired"; @@ -1006,6 +1006,7 @@ return "does not match any DANE TLSA records"; end end + -- TODO cert_chain_errors can be a string, handle that return "is not trusted"; -- for some other reason elseif session.cert_identity_status == "invalid" then return "is not valid for this name";