Skip to content

Commit

Permalink
fix(email): use decrypted private key
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCatLady committed Oct 25, 2021
1 parent ab20c21 commit ef191ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/lib/email/openpgpEncrypt.ts
Expand Up @@ -51,11 +51,12 @@ class PGPEncryptor extends Transform {

// Only sign the message if private key and password exist
if (this._signingKey && this._password) {
privateKey = await openpgp.readPrivateKey({
armoredKey: this._signingKey,
privateKey = await openpgp.decryptKey({
privateKey: await openpgp.readPrivateKey({
armoredKey: this._signingKey,
}),
passphrase: this._password,
});

await openpgp.decryptKey({ privateKey, passphrase: this._password });
}

const emailPartDelimiter = '\r\n\r\n';
Expand Down

0 comments on commit ef191ce

Please sign in to comment.