# HG changeset patch # User Matthew Wild # Date 1718801592 -3600 # Node ID 87441b5672775ac292aa5357e31a1b35cb0ba037 # Parent f408b8e603afe94c00ead9dc315d770a815db052 mod_sasl2_fast: Fix traceback when no cb_data is available (thanks riau) We already verify (earlier in the process) that cb_data is present if we are using a mechanism that requires it. diff -r f408b8e603af -r 87441b567277 mod_sasl2_fast/mod_sasl2_fast.lua --- a/mod_sasl2_fast/mod_sasl2_fast.lua Sat Jun 08 03:28:25 2024 -0500 +++ b/mod_sasl2_fast/mod_sasl2_fast.lua Wed Jun 19 13:53:12 2024 +0100 @@ -49,7 +49,7 @@ log("debug", "Looking for %s token %s/%s", mechanism, username, key); token = token_store:get(username, key); if token and token.mechanism == mechanism then - local expected_hash = hmac_f(token.secret, "Initiator"..cb_data); + local expected_hash = hmac_f(token.secret, "Initiator"..(cb_data or "")); if hash.equals(expected_hash, token_hash) then local current_time = now(); if token.expires_at < current_time then @@ -77,7 +77,7 @@ log("debug", "FAST token due for rotation (age: %d)", current_time - token.issued_at); rotation_needed = true; end - return true, username, hmac_f(token.secret, "Responder"..cb_data), rotation_needed; + return true, username, hmac_f(token.secret, "Responder"..(cb_data or "")), rotation_needed; end end if not tried_current_token then