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 error type for third invalid PIN entry #60

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Commits on Feb 20, 2024

  1. Fix error type for third invalid PIN entry

    If the user provides a wrong PIN and the persistent or per-boot PIN
    retry counter reaches its limit, we have to return the PinBlocked
    (persistent) or PinAuthBlocked (per boot) error code instead of
    PinInvalid.  The previous implementation checked the persistent retry
    counter twice instead of checking both counters.
    
    This patch fixes this problem by using the combined State::pin_blocked
    method instead of manually checking the persistent and runtime state
    directly.
    
    It also replaces a raw subtraction when computing the remaining retries
    with a saturating sub, just to be sure.
    robin-nitrokey committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    6e9fa17 View commit details
    Browse the repository at this point in the history