Comparison

plugins/mod_legacyauth.lua @ 5083:4629c60a303b

mod_legacyauth: Return an error if username or resource fails stringprep (thanks iron)
author Kim Alvefur <zash@zash.se>
date Tue, 07 Aug 2012 17:00:12 +0200
parent 4258:ee445e658848
child 5084:82b9fe0c79c5
comparison
equal deleted inserted replaced
5082:1ffc788c5696 5083:4629c60a303b
56 else 56 else
57 username, password, resource = t_concat(username), t_concat(password), t_concat(resource); 57 username, password, resource = t_concat(username), t_concat(password), t_concat(resource);
58 username = nodeprep(username); 58 username = nodeprep(username);
59 resource = resourceprep(resource) 59 resource = resourceprep(resource)
60 local reply = st.reply(stanza); 60 local reply = st.reply(stanza);
61 if not (username and resource) then
62 session.send(st.error_reply(stanza, "modify", "bad-request"));
63 return true;
64 end
61 if usermanager.test_password(username, session.host, password) then 65 if usermanager.test_password(username, session.host, password) then
62 -- Authentication successful! 66 -- Authentication successful!
63 local success, err = sessionmanager.make_authenticated(session, username); 67 local success, err = sessionmanager.make_authenticated(session, username);
64 if success then 68 if success then
65 local err_type, err_msg; 69 local err_type, err_msg;