# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1343417372 -3600
# Node ID 017e864b459d9f01fcaae4b61a75afc8c4585f8b
# Parent  eb8211b65e96206996bb1e2b1f2566dbff6422f0
mod_dialback: Ignore <db:verify/> with a 'type' attribute on incoming connections, instead of interpreting them as a request to verify a key

diff -r eb8211b65e96 -r 017e864b459d plugins/mod_dialback.lua
--- a/plugins/mod_dialback.lua	Thu Jul 26 16:46:18 2012 +0100
+++ b/plugins/mod_dialback.lua	Fri Jul 27 20:29:32 2012 +0100
@@ -41,6 +41,11 @@
 		-- We are being asked to verify the key, to ensure it was generated by us
 		origin.log("debug", "verifying that dialback key is ours...");
 		local attr = stanza.attr;
+		if attr.type then
+			module:log("warn", "Ignoring incoming session from %s claiming a dialback key for %s is %s",
+				origin.from_host or "(unknown)", attr.from or "(unknown)", attr.type);
+			return true;
+		end
 		-- COMPAT: Grr, ejabberd breaks this one too?? it is black and white in XEP-220 example 34
 		--if attr.from ~= origin.to_host then error("invalid-from"); end
 		local type;