Comparison

plugins/mod_auth_internal_hashed.lua @ 12127:baa7cdde69a6

mod_auth_internal_hashed: Make SCRAM iteration count configurable
author Kim Alvefur <zash@zash.se>
date Sun, 26 Dec 2021 16:37:50 +0100
parent 11560:3bbb1af92514
child 12128:593e823566e1
comparison
equal deleted inserted replaced
12126:0d8e6646ce42 12127:baa7cdde69a6
26 local hash_name = module:get_option_string("password_hash", "SHA-1"); 26 local hash_name = module:get_option_string("password_hash", "SHA-1");
27 local get_auth_db = assert(scram_hashers[hash_name], "SCRAM-"..hash_name.." not supported by SASL library"); 27 local get_auth_db = assert(scram_hashers[hash_name], "SCRAM-"..hash_name.." not supported by SASL library");
28 local scram_name = "scram_"..hash_name:gsub("%-","_"):lower(); 28 local scram_name = "scram_"..hash_name:gsub("%-","_"):lower();
29 29
30 -- Default; can be set per-user 30 -- Default; can be set per-user
31 local default_iteration_count = 4096; 31 local default_iteration_count = module:get_option_number("default_iteration_count", 4096);
32 32
33 -- define auth provider 33 -- define auth provider
34 local provider = {}; 34 local provider = {};
35 35
36 function provider.test_password(username, password) 36 function provider.test_password(username, password)