From 975e6c1c058543c1d1a6f566177701f5ff4c2eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garci=CC=81a?= Date: Thu, 28 Mar 2024 13:49:39 +0100 Subject: [PATCH] Lift comments --- crates/bitwarden/src/auth/tde.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/bitwarden/src/auth/tde.rs b/crates/bitwarden/src/auth/tde.rs index 919ec25e1..1a3de3026 100644 --- a/crates/bitwarden/src/auth/tde.rs +++ b/crates/bitwarden/src/auth/tde.rs @@ -6,6 +6,9 @@ use bitwarden_crypto::{ use crate::{error::Result, Client}; +/// This function generates a new user key and key pair, initializes the client's crypto with the +/// generated user key, and encrypts the user key with the organization public key for admin +/// password reset. If remember_device is true, it also generates a device key. pub(super) fn make_register_tde_keys( client: &mut Client, org_public_key: String, @@ -15,8 +18,6 @@ pub(super) fn make_register_tde_keys( let mut rng = rand::thread_rng(); - // Generate a new user key and key pair, and encrypt the user key with the org public key for - // admin password reset let user_key = UserKey::new(SymmetricCryptoKey::generate(&mut rng)); let key_pair = user_key.make_key_pair()?; @@ -29,8 +30,6 @@ pub(super) fn make_register_tde_keys( None }; - // Initialize the crypto with the generated user key, this way it doesn't need to leave the - // client client.initialize_user_crypto_decrypted_key(user_key.0, key_pair.private.clone())?; Ok(RegisterTdeKeyResponse {