B2CA-2702: Add web UI tol for backup & Restore - #163
Merged
Conversation
Found while building the web UI: - restore(): write the salutation as an ASCII digit instead of bytes.fromhex() on the odd-length "1"/"2" (which raises). - _decode_tlv(): use elif for the 1-byte / 2-byte long-length forms so the second branch no longer re-evaluates the reassigned length. - backup.py: also verify PW2 (0x82), required to read/write the private DOs 0x0101/0x0103. - restore(): stop writing the read-only signature counter (DO 0x93).
A browser-based backup/restore tool for the OpenPGP app, served at https://ledgerhq.github.io/app-openpgp/wui/ and linked from the docs. - Stack: Vite + React 18, Ledger's lumen design system (Tailwind), pnpm (exact version pinning). - Talks to the device over WebHID (the generic HID APDU interface) — the same channel pytools/backup.py uses; no firmware change required. - Backup (get_all -> version-1 JSON, native save dialog), restore (PUT DATA sequence + optional deterministic key regeneration from the seed), factory reset, key-slot selection; PIN dialogs and recovery hints, with graceful handling of the device-side crash that can occur during key regeneration. - APDU framing / TLV / data-object layer ported from pytools, covered by Vitest. A "?mock" dev preview opens the connected screen without a device. - Co-hosted on the existing GitHub Pages workflow (builds clients/wui into doc/html/build/wui/); pnpm-lock.yaml is excluded from the codespell and large-file pre-commit hooks.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #163 +/- ##
========================================
Coverage 40.19% 40.19%
========================================
Files 1 1
Lines 209 209
Branches 49 49
========================================
Hits 84 84
Misses 118 118
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
0pendev
self-requested a review
June 17, 2026 14:55
0pendev
approved these changes
Jun 17, 2026
0pendev
left a comment
There was a problem hiding this comment.
Both python and the new web client works without issue on my end.
Tested on Nano Gen5, Nano SP, Flex.
C code was edited but is only formatting fixes. Those changes are all present in a single commit.
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.
Description
Browser-based backup/restore tool based on Vite + React 18 + lumen
pytools: fix latent backup/restore bugs
Fix #160