From 506ee45da2853e66bf20b0d9a2c3cbee22c4b55d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 6 Apr 2023 17:09:03 +0200 Subject: mod_admin_shell: Fix display of remote cert status when expired etc Looks like autocomplete unhelpfully capitalized this word, but it's lowercase where it is set in mod_s2s_auth_certs --- plugins/mod_admin_shell.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index e1016425..ee68a64b 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -829,7 +829,7 @@ available_columns = { width = 11; mapper = function(cert_status, session) if cert_status then return capitalize(cert_status); end - if session.cert_chain_status == "Invalid" then + if session.cert_chain_status == "invalid" then local cert_errors = set.new(session.cert_chain_errors[1]); if cert_errors:contains("certificate has expired") then return "Expired"; -- cgit v1.2.3 From 57c37716145d1383e861c390c4953f41e81dfdb3 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 19 Apr 2023 11:32:53 +0200 Subject: util.error: Fix error on conversion of invalid error stanza, fix #1805 Error stanzas should have an element, but if you pass a stanza without one to util.error.from_stanza() it triggers an attempt to index a nil value, which this patch avoids. In the conditional, it should be safe to assume error_tag is non-nil since condition can't have those values then. --- util/error.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/error.lua b/util/error.lua index 326c01f8..b83f81e5 100644 --- a/util/error.lua +++ b/util/error.lua @@ -141,7 +141,7 @@ local function from_stanza(stanza, context, source) local error_tag = stanza:get_child("error"); context = context or {}; context.stanza = stanza; - context.by = error_tag.attr.by or stanza.attr.from; + context.by = error_tag and error_tag.attr.by or stanza.attr.from; local uri; if condition == "gone" or condition == "redirect" then -- cgit v1.2.3