Repository navigation
fix: keep TOTP from KeePassXC and Lastpass CSV exports - #249
Closed
jayhemnani9910 wants to merge 2 commits into
Closed
jayhemnani9910 wants to merge 2 commits into
jayhemnani9910 wants to merge 2 commits into
Conversation
KeepassxcCSV inherits the KeepassX2 keys, which have no TOTP column, so the otpauth URL that KeepassXC 2.6+ writes there was dropped (or kept as 'TOTP: otpauth://...' with --all, which pass-otp does not read). Map it to otpauth. It is not added to keys so older exports without the column still parse.
Lastpass exports the TOTP secret in a totp column, which LastpassCSV did not map, so it was dropped. Map it to otpauth; clean.otp builds the otpauth URL from the secret. Older exports without the column still parse.
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.
Importing a KeepassXC or Lastpass CSV export drops every TOTP secret. KeepassXC 2.6+ writes the otpauth URL in a
TOTPcolumn (Database > Export > CSV):Lastpass (its only export is CSV) has a
totpcolumn with the base32 secret:pimport pass keepassxc export.csv -o store(orlastpass) writes the password, login and url, but nootpauth://line, and gives no warning. With--allthe value is kept asTOTP: otpauth://..., which pass-otp does not read. Anyone moving from KeepassXC with this export loses their 2FA seeds.KeepassxcCSVuses theKeepassx2CSVkeys, which have no TOTP column (KeepassX had no TOTP), andLastpassCSV.keyshas nototpeither. The KDBX importer already reads OTP. Bothparsemethods now move the value tootpauth: for KeepassXC only anotpauth://URL, for Lastpass the secret, whichclean.otpturns into anotpauth://URL. I did not add the columns tokeys, becausecheckheaderwould then reject older exports without them (KeepassXC before 2.6, older Lastpass exports, and the existing test assets).Added
keepassxc-totp.csvandlastpass-totp.csvwith one test each; both fail without the change.green tests: all pass excepttest_import_gnome_keyring, which fails the same way without the change here (no keyring daemon). Imported both files into a pass store and decrypted the entries: theotpauth://line is there now (before: missing).