mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Only ask S/MIME private key passphrase when it is encrypted #259
This commit is contained in:
parent
f06b6edef5
commit
f5f3a90275
1 changed files with 5 additions and 3 deletions
|
|
@ -1538,10 +1538,12 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
} else if (this.canSMimeSign()) {
|
||||
params.signCertificate = identity.smimeCertificate();
|
||||
params.signPrivateKey = identity.smimeKey();
|
||||
const pass = await AskPopupView.password('S/MIME key', 'CRYPTO/SIGN');
|
||||
if (identity.smimeKey().includes('-----BEGIN ENCRYPTED PRIVATE KEY-----')) {
|
||||
const pass = await AskPopupView.password('S/MIME private key', 'CRYPTO/SIGN');
|
||||
params.signPassphrase = pass?.password;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (encrypt) {
|
||||
Object.entries(PgpUserStore.getPublicKeyOfEmails(recipients) || {}).forEach(([k,v]) =>
|
||||
params.autocrypt.push({addr:k, keydata:v.replace(/-----(BEGIN|END) PGP PUBLIC KEY BLOCK-----/g, '').trim()})
|
||||
|
|
@ -1555,7 +1557,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
|||
params.encryptFingerprints = JSON.stringify(GnuPGUserStore.getPublicKeyFingerprints(recipients));
|
||||
// } else {
|
||||
// // S/MIME
|
||||
// params.encryptCertificates = '';
|
||||
// params.encryptCertificates = [];
|
||||
} else {
|
||||
throw 'Encryption with ' + encrypt + ' not yet implemented';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue