Software /
code /
prosody
Comparison
plugins/mod_saslauth.lua @ 1758:5acbf4318715
Add NODEprepping to SASL Digest-MD5 authentication handling.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Sun, 06 Sep 2009 22:07:59 +0200 |
parent | 1725:fb3137652ea6 |
child | 1847:1842da566c7d |
comparison
equal
deleted
inserted
replaced
1727:cbdc7bf61e0f | 1758:5acbf4318715 |
---|---|
82 return response; | 82 return response; |
83 end | 83 end |
84 elseif mechanism == "DIGEST-MD5" then | 84 elseif mechanism == "DIGEST-MD5" then |
85 function func(x) return x; end | 85 function func(x) return x; end |
86 local node, domain, realm, decoder = ...; | 86 local node, domain, realm, decoder = ...; |
87 local password = usermanager_get_password(node, domain); | 87 local prepped_node = nodeprep(node); |
88 if not prepped_node then | |
89 return func, nil; | |
90 end | |
91 local password = usermanager_get_password(prepped_node, domain); | |
88 if password then | 92 if password then |
89 if decoder then | 93 if decoder then |
90 node, realm, password = decoder(node), decoder(realm), decoder(password); | 94 node, realm, password = decoder(node), decoder(realm), decoder(password); |
91 end | 95 end |
92 return func, md5(node..":"..realm..":"..password); | 96 return func, md5(node..":"..realm..":"..password); |