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

Enable MFA with unmatched order of auth_methods #873

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

essa
Copy link

@essa essa commented Jun 30, 2022

Resolves #872.

This PR adds tests for MFA, one of them reproduces #872, and updates Net:SSH:Authetication:Session#authenticate so that new tests pass.

Copy link
Collaborator

@mfazekas mfazekas left a comment

Choose a reason for hiding this comment

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

Thanks much, for the PR, looks great.
We'll need to add an integration test, as well.

Looking at the manpage - AuthenticationMethods can be publickey, publickey
https://man.freebsd.org/cgi/man.cgi?sshd_config(5) it can be 3 elements, and this version of the fix doesn't handle that. What do you think?

return true if try_authenticate(name, next_service, username, password, key_manager, options)
end

# try skipped methods
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't prefer comments, the code is obvious. Or maybe extract to a method like, try_skipped_in_case_allowed_auth_updated, what do you think?

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.

MFA authentication depends on the order of methods in AuthenticationMethods
2 participants