Skip to content

feat(crypto): gossip the dehydrated device pickle key (MSC3814) when verifying a device - #6909

Draft
ara4n wants to merge 1 commit into
mainfrom
matthew/dehydration-gossip-on-verify
Draft

feat(crypto): gossip the dehydrated device pickle key (MSC3814) when verifying a device#6909
ara4n wants to merge 1 commit into
mainfrom
matthew/dehydration-gossip-on-verify

Conversation

@ara4n

@ara4n ara4n commented Aug 24, 2026

Copy link
Copy Markdown
Member

When verifying one of our own devices, also request the MSC3814 dehydrated device pickle key (alongside cross-signing keys and the backup recovery key), and serve/import it via secret gossip, so a freshly-verified device can manage the dehydrated device without reading Secret Storage.

The key is stored under its Secret Storage name (org.matrix.msc3814) and imported directly into the crypto store rather than parked in the secret inbox, since there is no user decision to make.

Part of element-hq/element-meta#2703. The companion change gossiping the key when it changes is stacked on this PR.

This code was largely written with Claude, and rebased/revalidated against current main (crypto tests pass locally with --features experimental-push-secrets).

🤖 Generated with Claude Code

…vice

Make the dehydrated device pickle key a gossipable secret so a user's own
verified devices can share it instead of each reading it from Secret Storage:
export_secret/import_secret handle the custom secret name org.matrix.msc3814
(loading/saving Changes.dehydrated_device_pickle_key), and accept_secret already
routes received secrets to import_secret. On verification, request_missing_secrets
also requests the dehydration key if we don't have it, so verifying a device
hands it the key.

Fixes element-hq/element-meta#2703.
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.40230% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.12%. Comparing base (7d19b2f) to head (7a34033).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk-crypto/src/store/mod.rs 97.14% 0 Missing and 2 partials ⚠️
crates/matrix-sdk-crypto/src/verification/mod.rs 60.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6909      +/-   ##
==========================================
- Coverage   90.12%   90.12%   -0.01%     
==========================================
  Files         407      407              
  Lines      115984   116071      +87     
  Branches   115984   116071      +87     
==========================================
+ Hits       104535   104609      +74     
- Misses       7526     7532       +6     
- Partials     3923     3930       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing matthew/dehydration-gossip-on-verify (7a34033) with main (7d19b2f)

Open in CodSpeed

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.

1 participant