Skip to content

Commit

Permalink
fixup implement cache
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonThormeyer committed Oct 7, 2024
1 parent 0636748 commit 63c9520
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions crypto-ffi/src/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,7 @@ impl CoreCrypto {
expiry_sec: u32,
ciphersuite: Ciphersuite,
) -> CoreCryptoResult<E2eiEnrollment> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context
.e2ei_new_activation_enrollment(display_name, handle, team, expiry_sec, ciphersuite.into())
.await
Expand All @@ -1685,7 +1685,7 @@ impl CoreCrypto {
expiry_sec: u32,
ciphersuite: Ciphersuite,
) -> CoreCryptoResult<E2eiEnrollment> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context
.e2ei_new_rotate_enrollment(display_name, handle, team, expiry_sec, ciphersuite.into())
.await
Expand All @@ -1708,15 +1708,15 @@ impl CoreCrypto {
/// See [core_crypto::mls::MlsCentral::e2ei_register_acme_ca]
#[deprecated = "Please create a transaction in Core Crypto and call this method from it."]
pub async fn e2ei_register_acme_ca(&self, trust_anchor_pem: String) -> CoreCryptoResult<()> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
context.e2ei_register_acme_ca(trust_anchor_pem).await?;
Ok(context.finish().await?)
}

/// See [core_crypto::mls::MlsCentral::e2ei_register_intermediate_ca_pem]
#[deprecated = "Please create a transaction in Core Crypto and call this method from it."]
pub async fn e2ei_register_intermediate_ca(&self, cert_pem: String) -> CoreCryptoResult<Option<Vec<String>>> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context.e2ei_register_intermediate_ca_pem(cert_pem).await?.into();
context.finish().await?;
Ok(result)
Expand All @@ -1725,7 +1725,7 @@ impl CoreCrypto {
/// See [core_crypto::mls::MlsCentral::e2ei_register_crl]
#[deprecated = "Please create a transaction in Core Crypto and call this method from it."]
pub async fn e2ei_register_crl(&self, crl_dp: String, crl_der: Vec<u8>) -> CoreCryptoResult<CrlRegistration> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context.e2ei_register_crl(crl_dp, crl_der).await?.into();
context.finish().await?;
Ok(result)
Expand All @@ -1744,7 +1744,7 @@ impl CoreCrypto {
.transpose()
.map_err(CryptoError::from)?;

let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context
.e2ei_mls_init_only(
enrollment.0.write().await.deref_mut(),
Expand All @@ -1765,7 +1765,7 @@ impl CoreCrypto {
certificate_chain: String,
new_key_packages_count: u32,
) -> CoreCryptoResult<RotateBundle> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context
.e2ei_rotate_all(
enrollment.0.write().await.deref_mut(),
Expand All @@ -1786,7 +1786,7 @@ impl CoreCrypto {
.ok_or_else(|| CryptoError::LockPoisonError)?
.into_inner();

let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context.e2ei_enrollment_stash(enrollment).await?;
context.finish().await?;
Ok(result)
Expand All @@ -1795,7 +1795,7 @@ impl CoreCrypto {
/// See [core_crypto::mls::MlsCentral::e2ei_enrollment_stash_pop]
#[deprecated = "Please create a transaction in Core Crypto and call this method from it."]
pub async fn e2ei_enrollment_stash_pop(&self, handle: Vec<u8>) -> CoreCryptoResult<E2eiEnrollment> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context
.e2ei_enrollment_stash_pop(handle)
.await
Expand All @@ -1809,7 +1809,7 @@ impl CoreCrypto {
/// See [core_crypto::mls::MlsCentral::e2ei_conversation_state]
#[deprecated = "Please create a transaction in Core Crypto and call this method from it."]
pub async fn e2ei_conversation_state(&self, conversation_id: Vec<u8>) -> CoreCryptoResult<E2eiConversationState> {
let context = self.central.new_transaction().await;
let context = self.central.new_transaction().await?;
let result = context
.e2ei_conversation_state(&conversation_id)
.await
Expand Down Expand Up @@ -1965,7 +1965,7 @@ impl E2eiEnrollment {
cc: std::sync::Arc<CoreCrypto>,
challenge: Vec<u8>,
) -> CoreCryptoResult<()> {
let context = cc.central.new_transaction().await;
let context = cc.central.new_transaction().await?;
self.0
.write()
.await
Expand Down

0 comments on commit 63c9520

Please sign in to comment.