Software /
code /
prosody
Comparison
plugins/mod_saslauth.lua @ 5832:7d100d917243
mod_saslauth: Set secure socket as SASL object user data for secure sessions.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Mon, 17 Jan 2011 16:50:21 +0100 |
parent | 3983:38ec7255b111 |
child | 5834:c0cc4e73d9fa |
comparison
equal
deleted
inserted
replaced
5831:aa4bdabd3c0f | 5832:7d100d917243 |
---|---|
244 if not origin.username then | 244 if not origin.username then |
245 if secure_auth_only and not origin.secure then | 245 if secure_auth_only and not origin.secure then |
246 return; | 246 return; |
247 end | 247 end |
248 origin.sasl_handler = usermanager_get_sasl_handler(module.host); | 248 origin.sasl_handler = usermanager_get_sasl_handler(module.host); |
249 | |
250 if origin.secure then | |
251 origin.sasl_handler["userdata"] = origin.conn:socket(); | |
252 end | |
249 features:tag("mechanisms", mechanisms_attr); | 253 features:tag("mechanisms", mechanisms_attr); |
250 for mechanism in pairs(origin.sasl_handler:mechanisms()) do | 254 for mechanism in pairs(origin.sasl_handler:mechanisms()) do |
251 if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then | 255 if mechanism ~= "PLAIN" or origin.secure or allow_unencrypted_plain_auth then |
252 features:tag("mechanism"):text(mechanism):up(); | 256 features:tag("mechanism"):text(mechanism):up(); |
253 end | 257 end |