summaryrefslogtreecommitdiff
path: root/mod_auth_custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-04-21 17:22:43 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-04-21 17:22:43 +0200
commita321ab25719582c699353b2ffeca8e04cada8fbc (patch)
tree8c204a94a1f95c80ed0bf9a8c0571b4353549bc0 /mod_auth_custom
parentcb3ca4eac2a3bf2f589584278c1776db2da3a3f6 (diff)
downloadprosody_auth-master.tar
prosody_auth-master.tar.gz
prosody_auth-master.tar.bz2
prosody_auth-master.tar.xz
prosody_auth-master.zip
Make secret logging optionalHEADmaster
Diffstat (limited to 'mod_auth_custom')
-rw-r--r--mod_auth_custom/mod_auth_custom.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/mod_auth_custom/mod_auth_custom.lua b/mod_auth_custom/mod_auth_custom.lua
index 2ac5531..1e996cb 100644
--- a/mod_auth_custom/mod_auth_custom.lua
+++ b/mod_auth_custom/mod_auth_custom.lua
@@ -7,6 +7,7 @@ local group = module:get_option_string("custom_auth_group", "xmpp");
7local pam_module = module:get_option_string("custom_pam_module", "xmpp"); 7local pam_module = module:get_option_string("custom_pam_module", "xmpp");
8local alias_file = module:get_option_string("custom_alias_file"); 8local alias_file = module:get_option_string("custom_alias_file");
9local alias_secret_file = module:get_option_string("custom_alias_secret_file"); 9local alias_secret_file = module:get_option_string("custom_alias_secret_file");
10local log_secrets = module:get_option_boolean("custom_log_secrets", false);
10 11
11function is_real_user(username) 12function is_real_user(username)
12 for i,v in ipairs(posix.getgrnam(group).gr_mem) do 13 for i,v in ipairs(posix.getgrnam(group).gr_mem) do
@@ -35,7 +36,9 @@ function alias_pw(username)
35 local secret = f:read("*all"); 36 local secret = f:read("*all");
36 f:close(); 37 f:close();
37 local auth = sha2.sha512hex(username .. "@" .. module.host .. secret); 38 local auth = sha2.sha512hex(username .. "@" .. module.host .. secret);
38 module:log("debug", "Expecting ā€˜%sā€™ as auth-secret for %s", auth, username .. "@" .. module.host); 39 if log_secrets then
40 module:log("debug", "Expecting ā€˜%sā€™ as auth-secret for %s", auth, username .. "@" .. module.host);
41 end
39 return auth; 42 return auth;
40end 43end
41 44