Changeset

5019:017e864b459d

mod_dialback: Ignore <db:verify/> with a 'type' attribute on incoming connections, instead of interpreting them as a request to verify a key
author Matthew Wild <mwild1@gmail.com>
date Fri, 27 Jul 2012 20:29:32 +0100
parents 5018:eb8211b65e96
children 5024:d25e1b9332cc
files plugins/mod_dialback.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;