mirror of
https://github.com/bitwarden/browser
synced 2026-02-12 14:34:02 +00:00
[PM-24000] Await SdkLoadService.Ready before attempting to use the PureCrypto SDK
This commit is contained in:
@@ -227,12 +227,11 @@ export class EncryptServiceImplementation implements EncryptService {
|
|||||||
if (decapsulationKey == null) {
|
if (decapsulationKey == null) {
|
||||||
throw new Error("No decapsulationKey provided for decapsulation");
|
throw new Error("No decapsulationKey provided for decapsulation");
|
||||||
}
|
}
|
||||||
|
await SdkLoadService.Ready;
|
||||||
const keyBytes = PureCrypto.decapsulate_key_unsigned(
|
const keyBytes = PureCrypto.decapsulate_key_unsigned(
|
||||||
encryptedSharedKey.encryptedString,
|
encryptedSharedKey.encryptedString,
|
||||||
decapsulationKey,
|
decapsulationKey,
|
||||||
);
|
);
|
||||||
await SdkLoadService.Ready;
|
|
||||||
return new SymmetricCryptoKey(keyBytes);
|
return new SymmetricCryptoKey(keyBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user