Comparison

plugins/mod_saslauth.lua @ 2207:7ef74b2be8f8

Allow SASL PLAIN over unsecure connections when intended by admin.
author Tobias Markmann <tm@ayena.de>
date Thu, 19 Nov 2009 16:43:38 +0100
parent 2204:de3edab7551d
child 2208:2dc746323de6
comparison
equal deleted inserted replaced
2206:5f54100bb426 2207:7ef74b2be8f8
139 end 139 end
140 if config.get(session.host or "*", "core", "anonymous_login") then 140 if config.get(session.host or "*", "core", "anonymous_login") then
141 session.sasl_handler = new_sasl(session.host, anonymous_authentication_profile); 141 session.sasl_handler = new_sasl(session.host, anonymous_authentication_profile);
142 else 142 else
143 session.sasl_handler = new_sasl(session.host, default_authentication_profile); 143 session.sasl_handler = new_sasl(session.host, default_authentication_profile);
144 if not session.secure then 144 if not (module:get_option("allow_unencrypted_plain_auth")) and not session.secure then
145 session.sasl_handler:forbidden({"PLAIN"}); 145 session.sasl_handler:forbidden({"PLAIN"});
146 end 146 end
147 end 147 end
148 features:tag("mechanisms", mechanisms_attr); 148 features:tag("mechanisms", mechanisms_attr);
149 for k, v in pairs(session.sasl_handler:mechanisms()) do 149 for k, v in pairs(session.sasl_handler:mechanisms()) do