If TOTP unsealing fails, HOTP isn't updated
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 1.6k
- Forks
- 211
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 6
Description
If TOTP unsealing fails, the HOTP status isn't updated. In some cases this can mean it displays "success" incorrectly if it had previously traced success. (This means they both had to unseal at some point, then a change was made that causes TOTP to fail unsealing, such as entering the recovery console and returning to gui-init.)
The HOTP unseal currently only occurs if TOTP unseal succeeds: `update_totp && update_hotp`. This avoids counting two failures toward dictionary attack lockout if unseal fails, since both TOTP and HOTP each separately try to unseal the same secret.
This was briefly changed to be independent: `update_totp; update_hotp`. This ensures HOTP is always up to date, but counts two failures toward DA lockout if unseal fails. (TPM2 is currently configuring 10 auth failures to DA lockout, TPM1 limits vary by TPM vendor.)
We probably need a flow like:
```
if `unseal_secret`; then
update_totp "$secret"
update_hotp "$secret"
else
TOTP="Unable to unseal"
HOTP="Unable to unseal"
fi
```
This would only unseal once when preparing the menu, but still always update both TOTP and HOTP.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the menu flow containing update_totp, update_hotp, and unseal_secret. Trace how the current update_totp && update_hotp path handles unseal failure, then verify that one unseal attempt updates both statuses on success and shows “Unable to unseal” for both on failure. Done means HOTP cannot retain a prior success when TOTP unsealing fails, without counting a second failed unseal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell
- Domain
- authentication, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100