1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-19 02:44:01 +00:00

Fix typescript 7 incompatibilities in KM code (#18174)

* Fix platform tsgo compat

* Fix km tsgo compat

* Pass through null

* Undo platform changes
This commit is contained in:
Bernd Schoolmann
2026-01-12 10:14:32 +01:00
committed by jaasen-livefront
parent 348ed4b616
commit 43168dae46

View File

@@ -30,7 +30,7 @@ export class DefaultKeyGenerationService implements KeyGenerationService {
): Promise<{ salt: string; material: CsprngArray; derivedKey: SymmetricCryptoKey }> {
if (salt == null) {
const bytes = await this.cryptoFunctionService.randomBytes(32);
salt = Utils.fromBufferToUtf8(bytes);
salt = Utils.fromBufferToUtf8(bytes.buffer as ArrayBuffer);
}
const material = await this.cryptoFunctionService.aesGenerateKey(bitLength);
const key = await this.cryptoFunctionService.hkdf(material, salt, purpose, 64, "sha256");