Software /
code /
prosody
Comparison
plugins/mod_auth_internal_hashed.lua @ 13202:173038306750
plugins: Use get_option_enum where appropriate
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 16 Jan 2021 21:04:58 +0100 |
parent | 12977:74b9e05af71e |
child | 13213:50324f66ca2a |
comparison
equal
deleted
inserted
replaced
13201:65fb0d7a2312 | 13202:173038306750 |
---|---|
20 local log = module._log; | 20 local log = module._log; |
21 local host = module.host; | 21 local host = module.host; |
22 | 22 |
23 local accounts = module:open_store("accounts"); | 23 local accounts = module:open_store("accounts"); |
24 | 24 |
25 local hash_name = module:get_option_string("password_hash", "SHA-1"); | 25 local hash_name = module:get_option_enum("password_hash", "SHA-1", "SHA-256"); |
26 local get_auth_db = assert(scram_hashers[hash_name], "SCRAM-"..hash_name.." not supported by SASL library"); | 26 local get_auth_db = assert(scram_hashers[hash_name], "SCRAM-"..hash_name.." not supported by SASL library"); |
27 local scram_name = "scram_"..hash_name:gsub("%-","_"):lower(); | 27 local scram_name = "scram_"..hash_name:gsub("%-","_"):lower(); |
28 | 28 |
29 -- Default; can be set per-user | 29 -- Default; can be set per-user |
30 local default_iteration_count = module:get_option_number("default_iteration_count", 10000); | 30 local default_iteration_count = module:get_option_number("default_iteration_count", 10000); |