1
0
mirror of https://github.com/bitwarden/browser synced 2026-03-01 19:11:22 +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 GitHub
parent 404d925f84
commit 3563b935d1

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");