From: Chris Duncan Date: Tue, 2 Sep 2025 20:41:50 +0000 (-0700) Subject: Clear entropy after using it to create new wallet. X-Git-Tag: v0.10.5~35^2~8 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=ecac92adb52d36343761d35422bac92627455255;p=libnemo.git Clear entropy after using it to create new wallet. --- diff --git a/src/lib/vault/vault-worker.ts b/src/lib/vault/vault-worker.ts index 170d7c9..d0554af 100644 --- a/src/lib/vault/vault-worker.ts +++ b/src/lib/vault/vault-worker.ts @@ -123,6 +123,7 @@ export class VaultWorker { return Bip39.fromEntropy(entropy) .then(bip39 => this.#load(type, key, keySalt, bip39.phrase, mnemonicSalt)) .then(({ iv, salt, encrypted }) => { + entropy.fill(0) if (this.#seed == null || this.#mnemonic == null) { throw new Error('Failed to generate seed and mnemonic') } @@ -359,7 +360,6 @@ export class VaultWorker { } return crypto.subtle .deriveKey(derivationAlgorithm, derivationKey, derivedKeyType, false, [purpose]) - .then(derivedKey => derivedKey) }) .catch(err => { throw new Error(err)