Skip to content

Commit f6e27a8

Browse files
committed
chore: use new api in Session::remove_credential
1 parent c6e7270 commit f6e27a8

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

crypto/src/mls/session/credential.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,7 @@ impl Session {
143143
}
144144

145145
// remove any key packages generated by this credential
146-
let keypackages = self.find_all_keypackages(&self.crypto_provider.keystore()).await?;
147-
let keypackages_from_this_credential = keypackages.iter().filter_map(|(_stored_key_package, key_package)| {
148-
credentials
149-
.iter()
150-
.any(|credential| key_package.leaf_node().credential() == credential.mls_credential())
151-
// if computing the hash reference fails, we will just not delete the key package
152-
.then(|| key_package.hash_ref(self.crypto_provider.crypto()).ok()).flatten()
153-
});
154-
self.prune_keypackages(&self.crypto_provider, keypackages_from_this_credential)
155-
.await?;
146+
self.remove_keypackages_for(credential_ref).await?;
156147

157148
// remove all credentials associated with this ref
158149
// only remove the actual credential after the keypackages are all gone,

0 commit comments

Comments
 (0)