Comparison

plugins/mod_saslauth.lua @ 1637:c1292624f991

mod_saslauth: Fix traceback on attempted login for non-existent users
author Matthew Wild <mwild1@gmail.com>
date Wed, 05 Aug 2009 16:31:56 +0100
parent 1585:edc066730d11
child 1638:6fd0c2f46b21
comparison
equal deleted inserted replaced
1636:16e9ba7c4a03 1637:c1292624f991
75 else return response end 75 else return response end
76 elseif mechanism == "DIGEST-MD5" then 76 elseif mechanism == "DIGEST-MD5" then
77 function func(x) return x; end 77 function func(x) return x; end
78 local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4]; 78 local node, domain, realm, decoder = arg[1], arg[2], arg[3], arg[4];
79 local password = usermanager_get_password(node, domain) 79 local password = usermanager_get_password(node, domain)
80 if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end 80 if password then
81 return func, md5(node..":"..realm..":"..password); 81 if decoder then node, realm, password = decoder(node), decoder(realm), decoder(password); end
82 return func, md5(node..":"..realm..":"..password);
83 else
84 return func, nil;
85 end
82 end 86 end
83 end 87 end
84 88
85 local function sasl_handler(session, stanza) 89 local function sasl_handler(session, stanza)
86 if stanza.name == "auth" then 90 if stanza.name == "auth" then