Fix/vault proof webkit - #1364
Open
joepio wants to merge 3 commits into
Open
Conversation
…ebCrypto The Cloud Vault key envelope wraps a drive key under a KEK derived from the agent's Ed25519 signature over a fixed message. `agentVaultProof` asked the signed-in agent's provider for that signature, which on WebKit is WebCrypto with a randomized nonce: a different valid signature every call. So in Safari the KEK never matched, restore-with-key failed with "no wrapper in this envelope accepted that credential", and a drive first enrolled from Safari got an envelope no device can open. Treat the proof like `privateDrive`: compute it once with noble (RFC 8032, matching ed25519_dalek on the server) from the raw key at sign-in, persist it in IDB beside the non-extractable keypair, and use that. When no stored proof exists, a live signature is only accepted if signing twice reproduces it; otherwise a clear "sign in again on this browser" error instead of a junk wrapper. Claude-Session: https://claude.ai/code/session_019asLKBrBWY5ovyeCgtmdSd
…sion Signing in with a passkey or secret proves the agent, but the backup sits behind the control-plane account, and a browser that never signed in to that account (or cleared its cookies) has no session. `ConnectDeviceStep` then asked the vault, got "no session", and showed "Your data is on another device" with nothing to do about it — while the backups were right there. The step now checks for a session first and, when there is none but a portal is known, says so and offers the way in: sign in on the portal (new tab, then "I've signed in" re-checks here) where this origin can hold the cookie, or the device-link panel where it cannot. `UseVaultBackup` gains `refresh` so the offer can re-read the vault once the session exists. `restoreFromVault` also asks for the session before waiting on the ClientDb, so a device with no session no longer sits through that wait to hear "no". Claude-Session: https://claude.ai/code/session_019asLKBrBWY5ovyeCgtmdSd
The step after sign-in listed everything at once: a title, two paragraphs, the account offer as a second card with its own title and explainer, the QR, the server form. Now it names one way in — restore from the backup, sign in to the account that keeps it, or failing both the second-device routes — and folds the rest under "…or bring it over from another device". LinkProviderPanel gains a compact mode (button and code only, no card), and turns "Failed to fetch" into a sentence. Claude-Session: https://claude.ai/code/session_019asLKBrBWY5ovyeCgtmdSd
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.
Related Issues
closes #number
Checklist