From 6168ad134a5aa7357c23637630796e0984165dab Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sat, 21 Jun 2014 13:51:38 -0700 Subject: [PATCH] Enable %a format string for all pgp command configs. (closes #3699) Currently, the documentation states that, with the exception of pgp_getkeys_command, all the PGP format commands should be available to the pgp_*_command configuration variables. However, the %a format is actually only enabled for pgp_clearsign_command, pgp_encrypt_sign_command, and pgp_sign_command. Philip Rinn discovered this problem when he was trying to add a "--encrypt-to %a" to pgp_encrypt_only_command. Rather than just fix the one configuration he was having the problem with, this patch enables %a usage for all of them. (With the exception of the documented pgp_getkeys_command.) --- pgpinvoke.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pgpinvoke.c b/pgpinvoke.c index d4c320a9..73341922 100644 --- a/pgpinvoke.c +++ b/pgpinvoke.c @@ -201,7 +201,7 @@ pid_t pgp_invoke_decode (FILE **pgpin, FILE **pgpout, FILE **pgperr, const char *fname, short need_passphrase) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - need_passphrase, fname, NULL, NULL, NULL, + need_passphrase, fname, NULL, PgpSignAs, NULL, PgpDecodeCommand); } @@ -210,7 +210,7 @@ pid_t pgp_invoke_verify (FILE **pgpin, FILE **pgpout, FILE **pgperr, const char *fname, const char *sig_fname) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 0, fname, sig_fname, NULL, NULL, PgpVerifyCommand); + 0, fname, sig_fname, PgpSignAs, NULL, PgpVerifyCommand); } pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, @@ -218,7 +218,7 @@ pid_t pgp_invoke_decrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, const char *fname) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 1, fname, NULL, NULL, NULL, PgpDecryptCommand); + 1, fname, NULL, PgpSignAs, NULL, PgpDecryptCommand); } pid_t pgp_invoke_sign (FILE **pgpin, FILE **pgpout, FILE **pgperr, @@ -240,7 +240,7 @@ pid_t pgp_invoke_encrypt (FILE **pgpin, FILE **pgpout, FILE **pgperr, PgpEncryptSignCommand); else return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 0, fname, NULL, NULL, uids, + 0, fname, NULL, PgpSignAs, uids, PgpEncryptOnlyCommand); } @@ -269,6 +269,7 @@ void pgp_invoke_import (const char *fname) mutt_quote_filename (_fname, sizeof (_fname), fname); cctx.fname = _fname; + cctx.signas = PgpSignAs; mutt_pgp_command (cmd, sizeof (cmd), &cctx, PgpImportCommand); mutt_system (cmd); @@ -319,7 +320,7 @@ pid_t pgp_invoke_export (FILE **pgpin, FILE **pgpout, FILE **pgperr, const char *uids) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 0, NULL, NULL, NULL, uids, + 0, NULL, NULL, PgpSignAs, uids, PgpExportCommand); } @@ -328,7 +329,7 @@ pid_t pgp_invoke_verify_key (FILE **pgpin, FILE **pgpout, FILE **pgperr, const char *uids) { return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 0, NULL, NULL, NULL, uids, + 0, NULL, NULL, PgpSignAs, uids, PgpVerifyKeyCommand); } @@ -350,7 +351,7 @@ pid_t pgp_invoke_list_keys (FILE **pgpin, FILE **pgpout, FILE **pgperr, } return pgp_invoke (pgpin, pgpout, pgperr, pgpinfd, pgpoutfd, pgperrfd, - 0, NULL, NULL, NULL, uids, + 0, NULL, NULL, PgpSignAs, uids, keyring == PGP_SECRING ? PgpListSecringCommand : PgpListPubringCommand); } -- 2.40.0