comparison mod_sasl2_fast/mod_sasl2_fast.lua @ 5882:563c2c70cb9f

mod_sasl2_fast: Improve handling when SASL profile unexpectedly lacks CB This fixes a traceback reported by riau, but likely does not solve the underlying cause, whatever that is.
author Matthew Wild <mwild1@gmail.com>
date Tue, 16 Apr 2024 10:42:25 +0100
parents b10a7082b3c3
children e67fc7b66c13
comparison
equal deleted inserted replaced
5881:66e7d46b1d4b 5882:563c2c70cb9f
194 local backend = sasl_handler.profile[backend_profile_name]; 194 local backend = sasl_handler.profile[backend_profile_name];
195 local authc_username, token_hash = message:match("^([^%z]+)%z(.+)$"); 195 local authc_username, token_hash = message:match("^([^%z]+)%z(.+)$");
196 if not authc_username then 196 if not authc_username then
197 return "failure", "malformed-request"; 197 return "failure", "malformed-request";
198 end 198 end
199 if not sasl_handler.profile.cb then
200 module:log("warn", "Attempt to use channel binding %s with SASL profile that does not support any channel binding (FAST: %s)", cb_name, sasl_handler.fast);
201 return "failure", "malformed-request";
202 elseif not sasl_handler.profile.cb[cb_name] then
203 module:log("warn", "SASL profile does not support %s channel binding (FAST: %s)", cb_name, sasl_handler.fast);
204 return "failure", "malformed-request";
205 end
199 local cb_data = cb_name and sasl_handler.profile.cb[cb_name](sasl_handler) or ""; 206 local cb_data = cb_name and sasl_handler.profile.cb[cb_name](sasl_handler) or "";
200 local ok, authz_username, response, rotation_needed = backend( 207 local ok, authz_username, response, rotation_needed = backend(
201 mechanism_name, 208 mechanism_name,
202 authc_username, 209 authc_username,
203 sasl_handler.client_id, 210 sasl_handler.client_id,