mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
[PM-21001] Move KM usage of encrypt service (#14541)
* Add new encrypt service functions * Undo changes * Cleanup * Fix build * Fix comments * Move KM usage of encrypt service * Fix build
This commit is contained in:
@@ -738,7 +738,7 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
const storePin = await this.shouldStoreKey(KeySuffixOptions.Pin, userId);
|
||||
if (storePin) {
|
||||
// Decrypt userKeyEncryptedPin with user key
|
||||
const pin = await this.encryptService.decryptToUtf8(
|
||||
const pin = await this.encryptService.decryptString(
|
||||
(await this.pinService.getUserKeyEncryptedPin(userId))!,
|
||||
key,
|
||||
);
|
||||
@@ -945,10 +945,9 @@ export class DefaultKeyService implements KeyServiceAbstraction {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (await this.encryptService.decryptToBytes(
|
||||
return (await this.encryptService.unwrapDecapsulationKey(
|
||||
new EncString(encryptedPrivateKey),
|
||||
key,
|
||||
"Content: Encrypted Private Key",
|
||||
)) as UserPrivateKey;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user