Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
otpauth://import parsed thealgorithmquery parameter as a name such asSHA512, butEntryStorage.import()expects the numeric enum value. The name failedparseInt()and silently fell back to SHA-1.Normalize recognized enum names to their numeric values before the import storage step. Add SHA-256 and SHA-512 regression coverage.
Evidence
otpauth://totp/alice?secret=JBSWY3DPEHPK3PXP&algorithm=SHA512.SHA512before the fix; the storage conversion then selected SHA-1. After the fix it returns3, which the storage conversion resolves to SHA-512.src/import.ts,src/test/import.test.ts.tsc --noEmitpassed;webpack --config webpack.dev.js --mode developmentcompiled successfully;git diff --checkpassed; patch policy accepted 2 text files and 27 changed lines.Fixes #1593
Merge Danger
Door: two-way
Blast Radius: localized
Only named
algorithmvalues inotpauth://imports are normalized; unknown values retain the existing fallback behavior.