Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device | Pitfall with set_local_trust on Device that is triggering a full DeviceChange and can overwrite other changes. #4073

Open
BillCarsonFr opened this issue Oct 4, 2024 · 1 comment

Comments

@BillCarsonFr
Copy link
Member

BillCarsonFr commented Oct 4, 2024

There is a pitfall with Device and set_local_trust. If you keep a Device object around for some time then later on do a set_local_trust it is doing a full DeviceChanges that would overwrite changes that could have happens during that time (things like deleted olm_wedging_index withheld_code_sent)

Here

pub async fn set_local_trust(&self, trust_state: LocalTrust) -> StoreResult<()> {
self.inner.set_trust_state(trust_state);
let changes = Changes {
devices: DeviceChanges { changed: vec![self.inner.clone()], ..Default::default() },
..Default::default()
};

Exposed in sdk here

pub async fn set_local_trust(&self, trust_state: LocalTrust) -> Result<(), CryptoStoreError> {

@andybalaam
Copy link
Contributor

Device updates from keys_query do not have cryptographically-meaningful effects, so this is not too serious, except that we might forget a new signature. This does not happen very often.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants