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

Require PIN for registering an hotp credential #114

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

sosthene-nitrokey
Copy link
Collaborator

sosthene-nitrokey added a commit to Nitrokey/nitrokey-hotp-verification that referenced this pull request Apr 24, 2024
If the PIN is not set, configure it.

Nitrokeys prior to Nitrokey/trussed-secrets-app#114
will ignore the PIN. It might surprise users that have not set a PIN
in the past that a PIN is now set.

Nitrokeys with firmware after Nitrokey/trussed-secrets-app#114
will accept expect this behaviour from hotp-verification
src/credential.rs Outdated Show resolved Hide resolved
sosthene-nitrokey added a commit to Nitrokey/nitrokey-hotp-verification that referenced this pull request Apr 25, 2024
If the PIN is not set, configure it.

Nitrokeys prior to Nitrokey/trussed-secrets-app#114
will ignore the PIN. It might surprise users that have not set a PIN
in the past that a PIN is now set.

Nitrokeys with firmware after Nitrokey/trussed-secrets-app#114
will accept expect this behaviour from hotp-verification
@sosthene-nitrokey sosthene-nitrokey merged commit 82c20a8 into main Apr 25, 2024
2 checks passed
@tlaurion
Copy link

tlaurion commented May 6, 2024

@sosthene-nitrokey can you link to parallel work for hotp-verification and Heads code needed to deal with this?

@stv0g
Copy link

stv0g commented Jun 14, 2024

My testing show registering a TOTP secret still requires no PIN to be set.
Is this indented? WHy is there this asymmetry between HOTP and TOTP?

@sosthene-nitrokey
Copy link
Collaborator Author

sosthene-nitrokey commented Jun 14, 2024

The use case is different and leads to different threat models.

Reverse HOTP is used so that the key can verify that the code sent to it is correct. Being able to create an HOTP credential could allow verification against a newly created credential instead of the real one.

On the other hand TOTP is used to authenticate the key to a service. Being able to create false credential would only mean that the key would not be able to be authenticated, leading to an explicit failure, instead of authentication working when it shouldn't.

You should not that it it also not possible to create a pin-protected without first presenting the PIN.

@robin-nitrokey
Copy link
Member

To be precise, HOTP and TOTP credentials are handled identically. What is different and affected by this PR is Reverse HOTP, sometimes shortened to HOTP.

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.

4 participants