From d5f1ede14ba5899ee95cc4c06ceb7dfbe37a03cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garci=CC=81a?= Date: Thu, 3 Oct 2024 15:00:45 +0200 Subject: [PATCH] Rename --- crates/bitwarden-crypto/src/service/context.rs | 4 ++-- crates/bitwarden-crypto/src/service/mod.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/bitwarden-crypto/src/service/context.rs b/crates/bitwarden-crypto/src/service/context.rs index f0a3d3bec..f3e8c8877 100644 --- a/crates/bitwarden-crypto/src/service/context.rs +++ b/crates/bitwarden-crypto/src/service/context.rs @@ -2,7 +2,7 @@ use std::sync::RwLockReadGuard; use rsa::Oaep; -use super::RustCryptoServiceKeys; +use super::Keys; use crate::{ service::{key_store::KeyStore, AsymmetricKeyRef, SymmetricKeyRef}, AsymmetricCryptoKey, AsymmetricEncString, CryptoError, EncString, SymmetricCryptoKey, @@ -11,7 +11,7 @@ use crate::{ pub struct CryptoServiceContext<'a, SymmKeyRef: SymmetricKeyRef, AsymmKeyRef: AsymmetricKeyRef> { // We hold a RwLock read guard to avoid having any nested //calls locking it again and potentially causing a deadlock - pub(super) global_keys: RwLockReadGuard<'a, RustCryptoServiceKeys>, + pub(super) global_keys: RwLockReadGuard<'a, Keys>, pub(super) local_symmetric_keys: Box>, pub(super) local_asymmetric_keys: Box>, diff --git a/crates/bitwarden-crypto/src/service/mod.rs b/crates/bitwarden-crypto/src/service/mod.rs index a00ca6b8d..793935b94 100644 --- a/crates/bitwarden-crypto/src/service/mod.rs +++ b/crates/bitwarden-crypto/src/service/mod.rs @@ -17,7 +17,7 @@ use key_store::KeyStore; pub struct CryptoService { // We use an Arc<> to make it easier to pass this service around, as we can // clone it instead of passing references - key_stores: Arc>>, + key_stores: Arc>>, } impl std::fmt::Debug @@ -29,7 +29,7 @@ impl std::fmt::Debug } // This is just a wrapper around the keys so we only deal with one RwLock -pub(crate) struct RustCryptoServiceKeys +pub(crate) struct Keys { symmetric_keys: Box>, asymmetric_keys: Box>, @@ -41,7 +41,7 @@ impl #[allow(clippy::new_without_default)] pub fn new() -> Self { Self { - key_stores: Arc::new(RwLock::new(RustCryptoServiceKeys { + key_stores: Arc::new(RwLock::new(Keys { symmetric_keys: create_key_store(), asymmetric_keys: create_key_store(), })),