mutt stable branch with some hacks
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Introduce an oppenc_mode parameter

It's added to the parameter lists through the call stack down to the
find_keys calls.

No functionality is implemented yet. This patch is separated just to
keep other patches more readable.

+47 -33
+8 -6
crypt-gpgme.c
··· 4305 4305 } 4306 4306 4307 4307 /* This routine attempts to find the keyids of the recipients of a 4308 - message. It returns NULL if any of the keys can not be found. */ 4309 - static char *find_keys (ADDRESS *adrlist, unsigned int app) 4308 + message. It returns NULL if any of the keys can not be found. 4309 + If oppenc_mode is true, only keys that can be determined without 4310 + prompting will be used. */ 4311 + static char *find_keys (ADDRESS *adrlist, unsigned int app, int oppenc_mode) 4310 4312 { 4311 4313 char *keyID, *keylist = NULL, *t; 4312 4314 size_t keylist_size = 0; ··· 4409 4411 return (keylist); 4410 4412 } 4411 4413 4412 - char *pgp_gpgme_findkeys (ADDRESS *adrlist) 4414 + char *pgp_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode) 4413 4415 { 4414 - return find_keys (adrlist, APPLICATION_PGP); 4416 + return find_keys (adrlist, APPLICATION_PGP, oppenc_mode); 4415 4417 } 4416 4418 4417 - char *smime_gpgme_findkeys (ADDRESS *adrlist) 4419 + char *smime_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode) 4418 4420 { 4419 - return find_keys (adrlist, APPLICATION_SMIME); 4421 + return find_keys (adrlist, APPLICATION_SMIME, oppenc_mode); 4420 4422 } 4421 4423 4422 4424 #ifdef HAVE_GPGME_OP_EXPORT_KEYS
+2 -2
crypt-gpgme.h
··· 24 24 void pgp_gpgme_init (void); 25 25 void smime_gpgme_init (void); 26 26 27 - char *pgp_gpgme_findkeys (ADDRESS *adrlist); 28 - char *smime_gpgme_findkeys (ADDRESS *adrlist); 27 + char *pgp_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode); 28 + char *smime_gpgme_findkeys (ADDRESS *adrlist, int oppenc_mode); 29 29 30 30 BODY *pgp_gpgme_encrypt_message (BODY *a, char *keylist, int sign); 31 31 BODY *smime_gpgme_build_smime_entity (BODY *a, char *keylist);
+2 -2
crypt-mod-pgp-classic.c
··· 46 46 return pgp_application_pgp_handler (m, s); 47 47 } 48 48 49 - static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist) 49 + static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode) 50 50 { 51 - return pgp_findKeys (adrlist); 51 + return pgp_findKeys (adrlist, oppenc_mode); 52 52 } 53 53 54 54 static BODY *crypt_mod_pgp_sign_message (BODY *a)
+2 -2
crypt-mod-pgp-gpgme.c
··· 70 70 pgp_gpgme_invoke_import (fname); 71 71 } 72 72 73 - static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist) 73 + static char *crypt_mod_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode) 74 74 { 75 - return pgp_gpgme_findkeys (adrlist); 75 + return pgp_gpgme_findkeys (adrlist, oppenc_mode); 76 76 } 77 77 78 78 static BODY *crypt_mod_pgp_sign_message (BODY *a)
+2 -2
crypt-mod-smime-classic.c
··· 46 46 return smime_application_smime_handler (m, s); 47 47 } 48 48 49 - static char *crypt_mod_smime_findkeys (ADDRESS *adrlist) 49 + static char *crypt_mod_smime_findkeys (ADDRESS *adrlist, int oppenc_mode) 50 50 { 51 - return smime_findKeys (adrlist); 51 + return smime_findKeys (adrlist, oppenc_mode); 52 52 } 53 53 54 54 static BODY *crypt_mod_smime_sign_message (BODY *a)
+2 -2
crypt-mod-smime-gpgme.c
··· 55 55 return smime_gpgme_application_handler (m, s); 56 56 } 57 57 58 - static char *crypt_mod_smime_findkeys (ADDRESS *adrlist) 58 + static char *crypt_mod_smime_findkeys (ADDRESS *adrlist, int oppenc_mode) 59 59 { 60 - return smime_gpgme_findkeys (adrlist); 60 + return smime_gpgme_findkeys (adrlist, oppenc_mode); 61 61 } 62 62 63 63 static BODY *crypt_mod_smime_sign_message (BODY *a)
+1 -1
crypt-mod.h
··· 43 43 typedef BODY *(*crypt_func_pgp_traditional_encryptsign_t) (BODY *a, int flags, 44 44 char *keylist); 45 45 typedef BODY *(*crypt_func_pgp_make_key_attachment_t) (char *tempf); 46 - typedef char *(*crypt_func_findkeys_t) (ADDRESS *adrlist); 46 + typedef char *(*crypt_func_findkeys_t) (ADDRESS *adrlist, int oppenc_mode); 47 47 typedef BODY *(*crypt_func_sign_message_t) (BODY *a); 48 48 typedef BODY *(*crypt_func_pgp_encrypt_message_t) (BODY *a, char *keylist, 49 49 int sign);
+2 -2
crypt.c
··· 737 737 if ((WithCrypto & APPLICATION_PGP) 738 738 && (msg->security & APPLICATION_PGP)) 739 739 { 740 - if ((*keylist = crypt_pgp_findkeys (adrlist)) == NULL) 740 + if ((*keylist = crypt_pgp_findkeys (adrlist, 0)) == NULL) 741 741 { 742 742 rfc822_free_address (&adrlist); 743 743 return (-1); ··· 747 747 if ((WithCrypto & APPLICATION_SMIME) 748 748 && (msg->security & APPLICATION_SMIME)) 749 749 { 750 - if ((*keylist = crypt_smime_findkeys (adrlist)) == NULL) 750 + if ((*keylist = crypt_smime_findkeys (adrlist, 0)) == NULL) 751 751 { 752 752 rfc822_free_address (&adrlist); 753 753 return (-1);
+10 -6
cryptglue.c
··· 199 199 } 200 200 201 201 /* This routine attempts to find the keyids of the recipients of a 202 - message. It returns NULL if any of the keys can not be found. */ 203 - char *crypt_pgp_findkeys (ADDRESS *adrlist) 202 + message. It returns NULL if any of the keys can not be found. 203 + If oppenc_mode is true, only keys that can be determined without 204 + prompting will be used. */ 205 + char *crypt_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode) 204 206 { 205 207 if (CRYPT_MOD_CALL_CHECK (PGP, findkeys)) 206 - return (CRYPT_MOD_CALL (PGP, findkeys)) (adrlist); 208 + return (CRYPT_MOD_CALL (PGP, findkeys)) (adrlist, oppenc_mode); 207 209 208 210 return NULL; 209 211 } ··· 333 335 } 334 336 335 337 /* This routine attempts to find the keyids of the recipients of a 336 - message. It returns NULL if any of the keys can not be found. */ 337 - char *crypt_smime_findkeys (ADDRESS *adrlist) 338 + message. It returns NULL if any of the keys can not be found. 339 + If oppenc_mode is true, only keys that can be determined without 340 + prompting will be used. */ 341 + char *crypt_smime_findkeys (ADDRESS *adrlist, int oppenc_mode) 338 342 { 339 343 if (CRYPT_MOD_CALL_CHECK (SMIME, findkeys)) 340 - return (CRYPT_MOD_CALL (SMIME, findkeys)) (adrlist); 344 + return (CRYPT_MOD_CALL (SMIME, findkeys)) (adrlist, oppenc_mode); 341 345 342 346 return NULL; 343 347 }
+8 -4
mutt_crypt.h
··· 210 210 BODY *crypt_pgp_make_key_attachment (char *tempf); 211 211 212 212 /* This routine attempts to find the keyids of the recipients of a 213 - message. It returns NULL if any of the keys can not be found. */ 214 - char *crypt_pgp_findkeys (ADDRESS *adrlist); 213 + message. It returns NULL if any of the keys can not be found. 214 + If oppenc_mode is true, only keys that can be determined without 215 + prompting will be used. */ 216 + char *crypt_pgp_findkeys (ADDRESS *adrlist, int oppenc_mode); 215 217 216 218 /* Create a new body with a PGP signed message from A. */ 217 219 BODY *crypt_pgp_sign_message (BODY *a); ··· 259 261 char *crypt_smime_ask_for_key (char *prompt, char *mailbox, short public); 260 262 261 263 /* This routine attempts to find the keyids of the recipients of a 262 - message. It returns NULL if any of the keys can not be found. */ 263 - char *crypt_smime_findkeys (ADDRESS *adrlist); 264 + message. It returns NULL if any of the keys can not be found. 265 + If oppenc_mode is true, only keys that can be determined without 266 + prompting will be used. */ 267 + char *crypt_smime_findkeys (ADDRESS *adrlist, int oppenc_mode); 264 268 265 269 /* fixme: Needs documentation. */ 266 270 BODY *crypt_smime_sign_message (BODY *a);
+3 -1
pgp.c
··· 1182 1182 1183 1183 /* This routine attempts to find the keyids of the recipients of a message. 1184 1184 * It returns NULL if any of the keys can not be found. 1185 + * If oppenc_mode is true, only keys that can be determined without 1186 + * prompting will be used. 1185 1187 */ 1186 - char *pgp_findKeys (ADDRESS *adrlist) 1188 + char *pgp_findKeys (ADDRESS *adrlist, int oppenc_mode) 1187 1189 { 1188 1190 char *keyID, *keylist = NULL; 1189 1191 size_t keylist_size = 0;
+1 -1
pgp.h
··· 51 51 pgp_key_t pgp_getkeybyaddr (ADDRESS *, short, pgp_ring_t); 52 52 pgp_key_t pgp_getkeybystr (char *, short, pgp_ring_t); 53 53 54 - char *pgp_findKeys (ADDRESS *adrlist); 54 + char *pgp_findKeys (ADDRESS *adrlist, int oppenc_mode); 55 55 56 56 void pgp_forget_passphrase (void); 57 57 int pgp_application_pgp_handler (BODY *, STATE *);
+3 -1
smime.c
··· 729 729 730 730 /* This routine attempts to find the keyids of the recipients of a message. 731 731 * It returns NULL if any of the keys can not be found. 732 + * If oppenc_mode is true, only keys that can be determined without 733 + * prompting will be used. 732 734 */ 733 735 734 - char *smime_findKeys (ADDRESS *adrlist) 736 + char *smime_findKeys (ADDRESS *adrlist, int oppenc_mode) 735 737 { 736 738 char *keyID, *keylist = NULL; 737 739 size_t keylist_size = 0;
+1 -1
smime.h
··· 50 50 51 51 char* smime_ask_for_key (char *, char *, short); 52 52 53 - char *smime_findKeys (ADDRESS *adrlist); 53 + char *smime_findKeys (ADDRESS *adrlist, int oppenc_mode); 54 54 55 55 void smime_invoke_import (char *, char *); 56 56