Fix incomplete unencrypted backup for EncOTPStorage entries - #1578
Open
khoazero123 wants to merge 1 commit into
Open
Fix incomplete unencrypted backup for EncOTPStorage entries#1578khoazero123 wants to merge 1 commit into
khoazero123 wants to merge 1 commit into
Conversation
Normalize OTP type/algorithm on decrypt and export so numeric types are not dropped from otpauth backups, and include decrypted EncOTPStorage in plaintext cloud exports.
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
backupGetExport()skippingEncOTPStorageentries when creating plaintext backups (fixes Unencrypted backup is incomplete #1445).type/algorithmon decrypt and export so numeric enum values (e.g.1for TOTP) are exported as name strings and included in otpauth text backups.getOneLineOtpBackupFile()to handle numeric types for already-exported data.Root cause
Some encrypted entries store
typeas a numeric enum. After decryption/export, those entries could remain as numbers. The otpauth exporter only accepted string types like"totp", so affected accounts were silently omitted from unencrypted backups even though they appeared in the UI after unlock.Test plan
EncOTPStorageentries (including entries that previously failed to export).EncOTPStorageentries unchanged.npm test(includes newotp-normalize.test.ts).