diff --git a/crates/matrix-sdk-crypto/src/identities/manager.rs b/crates/matrix-sdk-crypto/src/identities/manager.rs index 90b55ce1335..d585cd9ff25 100644 --- a/crates/matrix-sdk-crypto/src/identities/manager.rs +++ b/crates/matrix-sdk-crypto/src/identities/manager.rs @@ -1965,7 +1965,7 @@ pub(crate) mod tests { assert!(!first_device.is_cross_signed_by_owner(&identity)); let remember_previous_identity = other_identity.clone(); - // We receive a new keys update for that user, with no identity anymore + // We receive updated keys for that user, with no identity anymore. // Notice that there is no server API to delete identity, but we want to test // here that a home server cannot clear the identity and serve a new one // after that would get automatically approved. diff --git a/crates/matrix-sdk-crypto/src/identities/user.rs b/crates/matrix-sdk-crypto/src/identities/user.rs index 121de43dc34..5c97d033961 100644 --- a/crates/matrix-sdk-crypto/src/identities/user.rs +++ b/crates/matrix-sdk-crypto/src/identities/user.rs @@ -606,7 +606,10 @@ impl ReadOnlyUserIdentity { ) -> Result { master_key.verify_subkey(&self_signing_key)?; - // The pin is maintained. + // We update the identity with the new master and self signing key, but we keep + // the previous pinned master key. + // This identity will have a pin violation until the new master key is pinned + // (see [`has_pin_violation`]). let pinned_master_key = self.pinned_master_key.read().unwrap().clone(); let new = Self {