Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Bren2010 committed Feb 26, 2024
1 parent 3992d09 commit f31bd7d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
12 changes: 10 additions & 2 deletions interop_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,11 @@ impl MlsClient for MlsClientImpl {
// Store keys so OpenMLS can find them.
crypto_provider
.key_store()
.store(my_key_package.hpke_init_key().as_slice(), &private_key, None)
.store(
my_key_package.hpke_init_key().as_slice(),
&private_key,
None,
)
.map_err(|_| Status::aborted("failed to interact with the key store"))?;

// Store the key package in the key store with the hash reference as id
Expand All @@ -425,7 +429,11 @@ impl MlsClient for MlsClientImpl {
// The key is the public key.
crypto_provider
.key_store()
.store::<HpkePrivateKey>(my_key_package.hpke_init_key().as_slice(), &private_key, None)
.store::<HpkePrivateKey>(
my_key_package.hpke_init_key().as_slice(),
&private_key,
None,
)
.map_err(into_status)?;

let welcome_msg = MlsMessageIn::tls_deserialize(&mut request.welcome.as_slice())
Expand Down
6 changes: 5 additions & 1 deletion openmls/src/key_packages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,11 @@ impl KeyPackageBuilder {
// The key is the public key.
provider
.key_store()
.store::<HpkePrivateKey>(key_package.hpke_init_key().as_slice(), &init_private_key, expiration)
.store::<HpkePrivateKey>(
key_package.hpke_init_key().as_slice(),
&init_private_key,
expiration,
)
.map_err(KeyPackageNewError::KeyStoreError)?;

Ok(key_package)
Expand Down
4 changes: 3 additions & 1 deletion openmls/src/treesync/node/encryption_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,9 @@ pub mod test_utils {
pub fn write_keys_from_key_store(provider: &impl OpenMlsProvider, encryption_key: HpkeKeyPair) {
let keypair = EncryptionKeyPair::from(encryption_key);

keypair.write_to_key_store(provider.key_store(), None).unwrap();
keypair
.write_to_key_store(provider.key_store(), None)
.unwrap();
}
}

Expand Down
7 changes: 6 additions & 1 deletion traits/src/key_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ pub trait OpenMlsKeyStore {
/// serialization for ID `k`.
///
/// Returns an error if storing fails.
fn store<V: MlsEntity>(&self, k: &[u8], v: &V, expiration: Option<u64>) -> Result<(), Self::Error>
fn store<V: MlsEntity>(
&self,
k: &[u8],
v: &V,
expiration: Option<u64>,
) -> Result<(), Self::Error>
where
Self: Sized;

Expand Down

0 comments on commit f31bd7d

Please sign in to comment.