aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_auth_insecure.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-06 00:54:28 +0200
committerKim Alvefur <zash@zash.se>2020-06-06 00:54:28 +0200
commite0837564185908155cf41dcacc0d99d9a5df33b0 (patch)
tree5dab399947091600ef0a5f4937cd915844ad6584 /plugins/mod_auth_insecure.lua
parentc36203ba7ffe035f91f5065184cf741d3d32cce7 (diff)
parent71c6728e69c98d7a70ec4ae4ffacb08ae683803f (diff)
downloadprosody-e0837564185908155cf41dcacc0d99d9a5df33b0.tar.gz
prosody-e0837564185908155cf41dcacc0d99d9a5df33b0.zip
Merge 0.11->trunk
Diffstat (limited to 'plugins/mod_auth_insecure.lua')
-rw-r--r--plugins/mod_auth_insecure.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/mod_auth_insecure.lua b/plugins/mod_auth_insecure.lua
index 9e23c29f..dc5ee616 100644
--- a/plugins/mod_auth_insecure.lua
+++ b/plugins/mod_auth_insecure.lua
@@ -9,6 +9,7 @@
local datamanager = require "util.datamanager";
local new_sasl = require "util.sasl".new;
+local saslprep = require "util.encodings".stringprep.saslprep;
local host = module.host;
local provider = { name = "insecure" };
@@ -21,6 +22,10 @@ end
function provider.set_password(username, password)
local account = datamanager.load(username, host, "accounts");
+ password = saslprep(password);
+ if not password then
+ return nil, "Password fails SASLprep.";
+ end
if account then
account.password = password;
return datamanager.store(username, host, "accounts", account);