fix(email): use decrypted private key (#2232)

This commit is contained in:
TheCatLady
2021-10-26 05:49:27 -04:00
committed by GitHub
parent 216447121b
commit 8d2968572a

View File

@@ -51,11 +51,12 @@ class PGPEncryptor extends Transform {
// Only sign the message if private key and password exist // Only sign the message if private key and password exist
if (this._signingKey && this._password) { if (this._signingKey && this._password) {
privateKey = await openpgp.readPrivateKey({ privateKey = await openpgp.decryptKey({
armoredKey: this._signingKey, privateKey: await openpgp.readPrivateKey({
armoredKey: this._signingKey,
}),
passphrase: this._password,
}); });
await openpgp.decryptKey({ privateKey, passphrase: this._password });
} }
const emailPartDelimiter = '\r\n\r\n'; const emailPartDelimiter = '\r\n\r\n';