Skip to content

fix(totp): accept secrets shorter than 128 bits - #74

Merged
OffRange merged 2 commits into
v2from
fix/allow-short-totp-secret
Aug 20, 2026
Merged

fix(totp): accept secrets shorter than 128 bits#74
OffRange merged 2 commits into
v2from
fix/allow-short-totp-secret

Conversation

@OffRange

Copy link
Copy Markdown
Owner

RFC 4226 asks for at least 128 bits of secret material and totp-rs enforces that, so a shorter secret - GitHub hands those out - was rejected outright. Build through TOTP::new_unchecked instead and run every rule TOTP::new would have applied, minus that floor, then report the weakness through the new SecretStrength on TotpInfo.

Scanning an unparseable code from the view screen silently did nothing. It now shows the same parse error dialog the create screen already had, which moved to :feature:totp so both screens can reach it.

Closes #68

Copilot AI lite review requested due to automatic review settings August 19, 2026 17:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

OffRange and others added 2 commits August 20, 2026 00:12
RFC 4226 asks for at least 128 bits of secret material and totp-rs enforces
that, so a shorter secret - GitHub hands those out - was rejected outright.
Build through TOTP::new_unchecked instead and run every rule TOTP::new would
have applied, minus that floor, then report the weakness through the new
SecretStrength on TotpInfo.

Scanning an unparseable code from the view screen silently did nothing. It
now shows the same parse error dialog the create screen already had, which
moved to :feature:totp so both screens can reach it.

Closes #68

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@OffRange
OffRange force-pushed the fix/allow-short-totp-secret branch from 388df4a to a51cba9 Compare August 19, 2026 23:44
@OffRange
OffRange merged commit 836809d into v2 Aug 20, 2026
9 checks passed
@OffRange
OffRange deleted the fix/allow-short-totp-secret branch August 20, 2026 00:12
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.

fix(totp): support shorter TOTP secret

2 participants