Skip to content

Fix incomplete unencrypted backup for EncOTPStorage entries - #1578

Open
khoazero123 wants to merge 1 commit into
Authenticator-Extension:devfrom
khoazero123:fix/upstream-incomplete-unencrypted-backup
Open

Fix incomplete unencrypted backup for EncOTPStorage entries#1578
khoazero123 wants to merge 1 commit into
Authenticator-Extension:devfrom
khoazero123:fix/upstream-incomplete-unencrypted-backup

Conversation

@khoazero123

Copy link
Copy Markdown

Summary

  • Fix backupGetExport() skipping EncOTPStorage entries when creating plaintext backups (fixes Unencrypted backup is incomplete #1445).
  • Normalize OTP type/algorithm on decrypt and export so numeric enum values (e.g. 1 for TOTP) are exported as name strings and included in otpauth text backups.
  • Harden getOneLineOtpBackupFile() to handle numeric types for already-exported data.

Root cause

Some encrypted entries store type as 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

  • Unlock extension with passphrase-protected EncOTPStorage entries (including entries that previously failed to export).
  • Download unencrypted otpauth backup and confirm all unlocked accounts are present.
  • Verify encrypted JSON backup still includes EncOTPStorage entries unchanged.
  • Confirm TOTP/HOTP codes still generate correctly after unlock.
  • Run unit tests: npm test (includes new otp-normalize.test.ts).

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.
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.

Unencrypted backup is incomplete

1 participant