Software /
code /
prosody
Comparison
plugins/mod_saslauth.lua @ 529:631e7d16d22b
Fix for handling latin1 encoded hostnames in SASL
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 03 Dec 2008 22:08:49 +0500 |
parent | 519:cccd610a0ef9 |
child | 563:099d8a102deb |
comparison
equal
deleted
inserted
replaced
524:3f9f67f1a106 | 529:631e7d16d22b |
---|---|
62 session.sasl_handler = nil; | 62 session.sasl_handler = nil; |
63 session:reset_stream(); | 63 session:reset_stream(); |
64 end | 64 end |
65 end | 65 end |
66 | 66 |
67 local function password_callback(node, host, mechanism) | 67 local function password_callback(node, host, mechanism, raw_host) |
68 local password = (datamanager.load(node, host, "accounts") or {}).password; -- FIXME handle hashed passwords | 68 local password = (datamanager.load(node, host, "accounts") or {}).password; -- FIXME handle hashed passwords |
69 local func = function(x) return x; end; | 69 local func = function(x) return x; end; |
70 if password then | 70 if password then |
71 if mechanism == "PLAIN" then | 71 if mechanism == "PLAIN" then |
72 return func, password; | 72 return func, password; |
73 elseif mechanism == "DIGEST-MD5" then | 73 elseif mechanism == "DIGEST-MD5" then |
74 return func, md5(node..":"..host..":"..password); | 74 return func, md5(node..":"..raw_host..":"..password); |
75 end | 75 end |
76 end | 76 end |
77 return func, nil; | 77 return func, nil; |
78 end | 78 end |
79 | 79 |