Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rlm_totp and add new test suite #5201

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jpereira
Copy link
Member

@jpereira jpereira commented Oct 4, 2023

eg:

[jpereira@sugarloaf:freeradius-server.git]$ make
CC src/modules/rlm_totp/rlm_totp.c
LINK build/lib/rlm_totp.la
[jpereira@sugarloaf:freeradius-server.git]$ make test.totp
TOTP-TEST INPUT=now_token_6digits.txt TOKEN=089002 TOTP_GEN_ARGV="-d 6 -D sha1"
TOTP-TEST INPUT=now_token_8digits.txt TOKEN=68089002 TOTP_GEN_ARGV="-d 8 -D sha1"
[jpereira@sugarloaf:freeradius-server.git]$

* That script get a real token using scripts/totp/totp-gen.py
* It's validate using 'radclient' sending a valid packet.
The 'nullable' field should be true.
The user TOTP token is expected over 'contro.TOTP.From-User'
@@ -186,7 +186,8 @@ module_rlm_t rlm_totp = {
.instantiate = mod_instantiate
},
.method_names = (module_method_name_t[]){
{ .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate, .method_env = &method_env },
{ .name1 = "authenticate", .name2 = CF_IDENT_ANY, .method = mod_authenticate, .method_env = &method_env },
{ .name1 = CF_IDENT_ANY, .name2 = CF_IDENT_ANY, .method = mod_authenticate, .method_env = &method_env },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not clear why this is necessary? The totp module really should only be authenticating users.

I guess that it could go anywhere to authenticate users, but we generally put the pap, chap, etc. authentications into an authenticate section

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants