From: Jorge Pereira Date: Wed, 4 Oct 2023 16:43:11 +0000 (-0300) Subject: totp: The fr_totp_cmp() expects token in call_env 'user_password' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1dc4d5002a759a82661d649e23044f13c3f2d7f;p=thirdparty%2Ffreeradius-server.git totp: The fr_totp_cmp() expects token in call_env 'user_password' Which is taken from control.TOTP.From-User --- diff --git a/src/modules/rlm_totp/rlm_totp.c b/src/modules/rlm_totp/rlm_totp.c index 077a235a05..cb5c229763 100644 --- a/src/modules/rlm_totp/rlm_totp.c +++ b/src/modules/rlm_totp/rlm_totp.c @@ -77,9 +77,7 @@ static int mod_bootstrap(module_inst_ctx_t const *mctx) CONF_SECTION *conf = mctx->inst->conf; inst->name = cf_section_name2(conf); - if (!inst->name) { - inst->name = cf_section_name1(conf); - } + if (!inst->name) inst->name = cf_section_name1(conf); return 0; } @@ -163,7 +161,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authenticate(rlm_rcode_t *p_result, our_keylen = len; } - if (fr_totp_cmp(&inst->totp, request, fr_time_to_sec(request->packet->timestamp), our_key, our_keylen, secret->vb_strvalue) != 0) RETURN_MODULE_FAIL; + if (fr_totp_cmp(&inst->totp, request, fr_time_to_sec(request->packet->timestamp), our_key, our_keylen, user_password->vb_strvalue) != 0) RETURN_MODULE_FAIL; RETURN_MODULE_OK; }