1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 03:33:54 +00:00

Move asymmetric crypto functions out of crypto service (#10903)

This commit is contained in:
Bernd Schoolmann
2024-10-01 08:47:41 -07:00
committed by GitHub
parent f2339b0586
commit dafe795854
36 changed files with 126 additions and 152 deletions

View File

@@ -117,10 +117,13 @@ export class OrganizationAuthRequestService {
);
// Decrypt user key with decrypted org private key
const decValue = await this.cryptoService.rsaDecrypt(encryptedUserKey, decOrgPrivateKey);
const decValue = await this.encryptService.rsaDecrypt(
new EncString(encryptedUserKey),
decOrgPrivateKey,
);
const userKey = new SymmetricCryptoKey(decValue);
// Re-encrypt user Key with the Device Public Key
return await this.cryptoService.rsaEncrypt(userKey.key, devicePubKey);
return await this.encryptService.rsaEncrypt(userKey.key, devicePubKey);
}
}