Software /
code /
prosody
Comparison
plugins/mod_auth_internal_hashed.lua @ 3981:2b0b8fe68df2
util.sasl.*, mod_auth_*, mod_saslauth: Pass SASL handler as first parameter to SASL profile callbacks.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Mon, 27 Dec 2010 19:57:04 +0500 |
parent | 3454:8cf30367aa4f |
child | 3994:42899d5efe3b |
comparison
equal
deleted
inserted
replaced
3980:6b2fac6602b3 | 3981:2b0b8fe68df2 |
---|---|
136 end | 136 end |
137 | 137 |
138 function provider.get_sasl_handler() | 138 function provider.get_sasl_handler() |
139 local realm = module:get_option("sasl_realm") or module.host; | 139 local realm = module:get_option("sasl_realm") or module.host; |
140 local testpass_authentication_profile = { | 140 local testpass_authentication_profile = { |
141 plain_test = function(username, password, realm) | 141 plain_test = function(sasl, username, password, realm) |
142 local prepped_username = nodeprep(username); | 142 local prepped_username = nodeprep(username); |
143 if not prepped_username then | 143 if not prepped_username then |
144 log("debug", "NODEprep failed on username: %s", username); | 144 log("debug", "NODEprep failed on username: %s", username); |
145 return "", nil; | 145 return "", nil; |
146 end | 146 end |
147 return usermanager.test_password(prepped_username, realm, password), true; | 147 return usermanager.test_password(prepped_username, realm, password), true; |
148 end, | 148 end, |
149 scram_sha_1 = function(username, realm) | 149 scram_sha_1 = function(sasl, username, realm) |
150 local credentials = datamanager.load(username, host, "accounts"); | 150 local credentials = datamanager.load(username, host, "accounts"); |
151 if not credentials then return; end | 151 if not credentials then return; end |
152 if credentials.password then | 152 if credentials.password then |
153 usermanager.set_password(username, credentials.password, host); | 153 usermanager.set_password(username, credentials.password, host); |
154 credentials = datamanager.load(username, host, "accounts"); | 154 credentials = datamanager.load(username, host, "accounts"); |