mod_legacyauth: Limit authentication to unauthenticated client connections.

Sat, 16 Oct 2010 05:46:23 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sat, 16 Oct 2010 05:46:23 +0500
changeset 3528
5cdcd7ee6ef5
parent 3527
59cdb9166bd0
child 3529
3f9cc12308aa

mod_legacyauth: Limit authentication to unauthenticated client connections.

plugins/mod_legacyauth.lua file | annotate | diff | comparison | revisions
--- a/plugins/mod_legacyauth.lua	Sat Oct 16 05:41:49 2010 +0500
+++ b/plugins/mod_legacyauth.lua	Sat Oct 16 05:46:23 2010 +0500
@@ -32,6 +32,11 @@
 module:hook("stanza/iq/jabber:iq:auth:query", function(event)
 	local session, stanza = event.origin, event.stanza;
 
+	if session.type ~= "c2s_unauthed" then
+		session.send(st.error_reply(stanza, "cancel", "service-unavailable", "Legacy authentication is only allowed for unauthenticated client connections."));
+		return true;
+	end
+
 	if secure_auth_only and not session.secure then
 		session.send(st.error_reply(stanza, "modify", "not-acceptable", "Encryption (SSL or TLS) is required to connect to this server"));
 		return true;

mercurial