Skip to content

Fix/vault proof webkit - #1364

Open
joepio wants to merge 3 commits into
developfrom
fix/vault-proof-webkit
Open

Fix/vault proof webkit#1364
joepio wants to merge 3 commits into
developfrom
fix/vault-proof-webkit

Conversation

@joepio

@joepio joepio commented Sep 4, 2026

Copy link
Copy Markdown
Member

Related Issues

closes #number

Checklist

  • Add changelog entry linking to issue, describe API changes
  • Add or update tests if needed
  • Update docs if needed

…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

@sdurni-glitch sdurni-glitch left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

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.

2 participants