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

Enhance UI support for pam_u2f #152

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

Conversation

kriansa
Copy link

@kriansa kriansa commented Aug 15, 2022

tl;dr

When using pam_u2f or any PAM module that sends a message and awaits for external input:

  • Clock ticks on screen
  • Keyboard-related indicators don't show up
  • AUTH_TIMEOUT is respected and your screen blanks out correctly (opt-in)

Long description

Adds support for an interactive screen when receiving info/msg from PAM.

This means that clock will keep ticking if you receive an error or info message from PAM. This is particularly useful for when using "ui blocking" modules such as pam_u2f, where you get your U2F device blinking while waiting for an input and PAM will be waiting after leaving you with the message "Please touch the device". Without this patch, that screen would seem frozen, as the clock (if displayed) would be static and your screen would never go blank even after timeout. You had two options, either finish the authentication by touching the device, or remove it so it would fail and go back to the fallback authentication mechanism (usually user/password).

For that feature to work well, there's also a new env variable you should set (XSECURELOCK_AUTHPROTO_KILL_ON_TIMEOUT): it works by killing the authproto process responsible for that auth instance if timeout is reached or user actively presses Esc. That step must be done if the PAM auth module you're using keeps waiting indefinitely for an action from the user, which will inevitably make the screen hang forever if that condition is not met.

All in all, these features will make the UI more consistent, by making sure that in any type of message received from authproto, we can behave using the same set of rules, like timeouts and screen updates (so the clock ticks!)

@google-cla
Copy link

google-cla bot commented Aug 15, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Adds support for a interactive screen when receiving info/msg from PAM.
This means that clock will keep ticking if you receive an error or info
message from PAM. This is particularly useful for when using pam_u2f,
where you get your U2F token blinking waiting for an input while PAM
will be waiting and the screen will be left with a message "Please touch
the device". Previously that screen would seem frozen, as the clock (if
displayed) would be stopped and your screen would never go blank (if
configured). You had two options, either finish the authentication by
touching the device, or remove it so it would fail and go back to the
fallback authentication mechanism (usually user/password).

For that feature to work well, there's also a new env variable you
should set (`XSECURELOCK_AUTHPROTO_KILL_ON_TIMEOUT`): it will kill the
authproto process responsible for that auth instance. That must be done
if the PAM auth module you're using keeps waiting indefinitely for an
action from the user, which will inevitably make the screen hang forever
if that condition is not met.
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.

1 participant