Skip to content

Commit c223af1

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

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

crypto/src/mls/session/credential.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::sync::Arc;
22

33
use openmls::prelude::{SignaturePublicKey, SignatureScheme};
4-
use openmls_traits::OpenMlsCryptoProvider as _;
54

65
use super::{Error, Result};
76
use crate::{
@@ -143,16 +142,7 @@ impl Session {
143142
}
144143

145144
// 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?;
145+
self.remove_keypackages_for(credential_ref).await?;
156146

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

0 commit comments

Comments
 (0)