feat(desktop): #142 PR-A — per-install device identity (enrollment + KEY-16 signing) #147
No reviewers
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit!147
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/desktop-device-identity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part 1 of 3 for #142 slice 1, restructured after a code sweep found the pairing UI has missing desktop prerequisites (discovery posted on #142).
Foundations this PR lands
ed25519module (ed25519-dalek 2.2.0): raw 32-byte public keys and 64-byte signatures — byte-for-byte compatible with the server's Ed25519VerificationKey2020 verifier (chosen over ML-DSA for the device key specifically because the Rust crate emits raw ML-DSA keys while the .NET verifier requires X.509/DER — an interop gap not worth solving for the device-auth signature).complete_login(email + OIDC),save_session(wallet flow), and session-restore inget_current_user.sign_data— was a placeholder that always errored; now signs with the device Ed25519 key (the KEY-16 surface pairing approvals will use).list_devices/revoke_device/ensure_device_enrolledcommands — the Settings → Devices section previously invoked commands that did not exist (dead UI); it now works end-to-end.Also fixed: pre-existing cargo-test compile breakage in failsulit-crypto (shamir/ml_kem tests never updated for Zeroizing returns —
cargo testhas been red in that crate).Known pre-existing, untouched:
symmetric::test_vector_bcrypt_hkdfKAT fails (bcrypt 0.15.1, file untouched since March). KAT hygiene lands with #15's KDF-floor work where the KATs are regenerated anyway.Tests: cargo test — src-tauri 15/15, failsulit-crypto 33/34 (the pre-existing KAT). vitest 1283 pass / 1 skip (3 new). Typecheck clean; lint 0 errors.
Next in the series: PR-B master-key lifecycle (generate at onboarding, keyring storage, load at unlock,
pair_wrap_master_key) → PR-C pairing UI (initiator QR + approver sheet).Slice-1 prerequisite discovery: the desktop never enrolled devices, never sent the fingerprint header, and sign_data was a placeholder that always errored — so the server could never resolve an enrolled device and the Settings -> Devices section invoked Rust commands that did not exist. Foundations landed here (PR-B master-key lifecycle and PR-C pairing UI build on this): - failsulit-crypto: ed25519 module (ed25519-dalek 2.2.0) — raw 32-byte keys / 64-byte sigs, byte-compatible with the server's Ed25519VerificationKey2020 verifier; 5 unit tests - DeviceService: stable per-install device id (uuid) + Ed25519 signing key persisted in the OS keychain (never rotate silently); fingerprint = hex(SHA-256('FailSulit-Desktop/<ver>|device-id')) mirrors the server's DeviceFingerprint.Compute; idempotent enrollment (409 resolves the existing row); 5 tests against an in-memory store (no OS keychain in cargo test) - ApiClient: X-SSDID-Device-ID header on every request + new 409 Conflict error mapping - Enrollment hooks: best-effort at complete_login (email/OIDC), save_session (wallet), and session restore — failures never block login - Real sign_data command (Ed25519 via device key, KEY-16 surface) - New devices commands (list_devices / revoke_device / ensure_device_enrolled) — revives the dead Devices section end-to-end - DevicesList: aria-label on the icon-only revoke button (a11y); DevicesList.test.tsx (3 tests); tauri mock cases for the new commands Also fixes pre-existing cargo-test compile breakage in failsulit-crypto (shamir/ml_kem tests never updated for Zeroizing returns — cargo test has been red in this crate). Known pre-existing (untouched, noted): symmetric::test_vector_bcrypt_hkdf KAT fails (bcrypt 0.15.1, file untouched since March) — KAT hygiene lands with #15's KDF-floor work where KATs are regenerated anyway. cargo test: src-tauri 15/15, failsulit-crypto 33/34 (1 pre-existing). vitest: 1283 pass / 1 skip (3 new); typecheck clean; lint 0 errors.