# HG changeset patch # User Matthew Wild # Date 1713260545 -3600 # Node ID 563c2c70cb9f3859fc2ebfe0ade3fdd5c45e58aa # Parent 66e7d46b1d4b90d9848ed348aa61d46d5cd748a3 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. diff -r 66e7d46b1d4b -r 563c2c70cb9f mod_sasl2_fast/mod_sasl2_fast.lua --- a/mod_sasl2_fast/mod_sasl2_fast.lua Tue Apr 09 14:44:52 2024 -0500 +++ b/mod_sasl2_fast/mod_sasl2_fast.lua Tue Apr 16 10:42:25 2024 +0100 @@ -196,6 +196,13 @@ if not authc_username then return "failure", "malformed-request"; end + if not sasl_handler.profile.cb then + 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); + return "failure", "malformed-request"; + elseif not sasl_handler.profile.cb[cb_name] then + module:log("warn", "SASL profile does not support %s channel binding (FAST: %s)", cb_name, sasl_handler.fast); + return "failure", "malformed-request"; + end local cb_data = cb_name and sasl_handler.profile.cb[cb_name](sasl_handler) or ""; local ok, authz_username, response, rotation_needed = backend( mechanism_name,