Zero out private key parameters in clearPrivateParams
This commit is contained in:
parent
889e0c4930
commit
26d107b856
|
@ -388,7 +388,11 @@ SecretKey.prototype.clearPrivateParams = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
const algo = enums.write(enums.publicKey, this.algorithm);
|
const algo = enums.write(enums.publicKey, this.algorithm);
|
||||||
this.params = this.params.slice(0, crypto.getPubKeyParamTypes(algo).length);
|
const publicParamCount = crypto.getPubKeyParamTypes(algo).length;
|
||||||
|
this.params.slice(publicParamCount).forEach(param => {
|
||||||
|
param.data.fill(0);
|
||||||
|
});
|
||||||
|
this.params.length = publicParamCount;
|
||||||
this.isEncrypted = true;
|
this.isEncrypted = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user