Skip to content

Commit

Permalink
totp: The fr_totp_cmp() expects token in call_env 'user_password'
Browse files Browse the repository at this point in the history
Which is taken from control.TOTP.From-User
  • Loading branch information
jpereira authored and alandekok committed Oct 6, 2023
1 parent e31a2cd commit d1dc4d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/modules/rlm_totp/rlm_totp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit d1dc4d5

Please sign in to comment.