Changeset

12812:b2d422b88cd6

Revert unintentionally committed parts of 12bd40b8e105
author Kim Alvefur <zash@zash.se>
date Wed, 21 Dec 2022 21:34:07 +0100
parents 12811:ccc0bdad82cc
children 12813:4be161c25e14
files net/resolvers/service.lua plugins/mod_s2s_auth_certs.lua util/x509.lua
diffstat 3 files changed, 5 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/net/resolvers/service.lua	Wed Nov 09 19:10:16 2022 +0100
+++ b/net/resolvers/service.lua	Wed Dec 21 21:34:07 2022 +0100
@@ -111,17 +111,12 @@
 			answer = {};
 		end
 		if answer then
-			if answer.bogus then
+			if self.extra and not answer.secure then
+				self.extra.use_dane = false;
+			elseif answer.bogus then
 				self.last_error = "Validation error in SRV lookup";
 				ready();
 				return;
-			elseif self.extra then
-				if answer.secure then
-					self.extra.secure_hostname = "HMMMMMMM";
-				else
-					-- Insecure results, so no DANE
-					self.extra.use_dane = false;
-				end
 			end
 
 			if #answer == 0 then
--- a/plugins/mod_s2s_auth_certs.lua	Wed Nov 09 19:10:16 2022 +0100
+++ b/plugins/mod_s2s_auth_certs.lua	Wed Dec 21 21:34:07 2022 +0100
@@ -12,8 +12,6 @@
 	local conn = session.conn;
 	local log = session.log or log;
 
-	local secure_hostname = conn.extra and conn.extra.dane_hostname;
-
 	if not cert then
 		log("warn", "No certificate provided by %s", host or "unknown host");
 		return;
@@ -39,14 +37,6 @@
 
 		-- We'll go ahead and verify the asserted identity if the
 		-- connecting server specified one.
-		if secure_hostname then
-			if cert_verify_identity(secure_hostname, "xmpp-server", cert) then
-				module:log("info", "Secure SRV name delegation %q -> %q", secure_hostname, host);
-				session.cert_identity_status = "valid"
-			else
-				session.cert_identity_status = "invalid"
-			end
-		end
 		if host then
 			if cert_verify_identity(host, "xmpp-server", cert) then
 				session.cert_identity_status = "valid"
--- a/util/x509.lua	Wed Nov 09 19:10:16 2022 +0100
+++ b/util/x509.lua	Wed Dec 21 21:34:07 2022 +0100
@@ -276,7 +276,8 @@
 	return names.data;
 end
 
-local pat = "%-%-%-%-%-BEGIN ([A-Z ]+)%-%-%-%-%-\r?\n([0-9A-Za-z+/=\r\n]*)\r?\n%-%-%-%-%-END %1%-%-%-%-%-";
+local pat = "%-%-%-%-%-BEGIN ([A-Z ]+)%-%-%-%-%-\r?\n"..
+"([0-9A-Za-z+/=\r\n]*)\r?\n%-%-%-%-%-END %1%-%-%-%-%-";
 
 local function pem2der(pem)
 	local typ, data = pem:match(pat);