Software / code / prosody
Comparison
plugins/mod_auth_internal_hashed.lua @ 4160:f08f649b898b
mod_auth_*: Get rid of undocumented and broken 'sasl_realm' config option.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Wed, 23 Feb 2011 01:34:46 +0500 |
| parent | 3994:42899d5efe3b |
| child | 4603:6900c9484834 |
comparison
equal
deleted
inserted
replaced
| 4159:52eaa2590bfb | 4160:f08f649b898b |
|---|---|
| 138 function provider.delete_user(username) | 138 function provider.delete_user(username) |
| 139 return datamanager.store(username, host, "accounts", nil); | 139 return datamanager.store(username, host, "accounts", nil); |
| 140 end | 140 end |
| 141 | 141 |
| 142 function provider.get_sasl_handler() | 142 function provider.get_sasl_handler() |
| 143 local realm = module:get_option("sasl_realm") or module.host; | |
| 144 local testpass_authentication_profile = { | 143 local testpass_authentication_profile = { |
| 145 plain_test = function(sasl, username, password, realm) | 144 plain_test = function(sasl, username, password, realm) |
| 146 local prepped_username = nodeprep(username); | 145 local prepped_username = nodeprep(username); |
| 147 if not prepped_username then | 146 if not prepped_username then |
| 148 log("debug", "NODEprep failed on username: %s", username); | 147 log("debug", "NODEprep failed on username: %s", username); |
| 173 stored_key = stored_key and from_hex(stored_key); | 172 stored_key = stored_key and from_hex(stored_key); |
| 174 server_key = server_key and from_hex(server_key); | 173 server_key = server_key and from_hex(server_key); |
| 175 return stored_key, server_key, iteration_count, salt, true; | 174 return stored_key, server_key, iteration_count, salt, true; |
| 176 end | 175 end |
| 177 }; | 176 }; |
| 178 return new_sasl(realm, testpass_authentication_profile); | 177 return new_sasl(module.host, testpass_authentication_profile); |
| 179 end | 178 end |
| 180 | 179 |
| 181 return provider; | 180 return provider; |
| 182 end | 181 end |
| 183 | 182 |