Link Here
|
1 |
Base: http://home.woolridge.ca/mutt/patches/patch-1.5.3.dw.confirm-crypt-hook.1 |
1 |
--- PATCHES Wed Mar 19 22:33:37 2003 |
2 |
http://home.woolridge.ca/mutt/patches/patch-1.5.3.dw.multiple-crypt-hook.1 |
2 |
+++ PATCHES Thu Mar 20 21:38:55 2003 |
3 |
http://home.woolridge.ca/mutt/patches/patch-1.5.3.dw.crypt-autoselectkey.1 |
|
|
4 |
|
5 |
--- PATCHES Tue Dec 17 10:47:20 2002 |
6 |
+++ PATCHES Fri Jan 24 11:27:21 2003 |
7 |
@@ -0,0 +1,3 @@ |
3 |
@@ -0,0 +1,3 @@ |
8 |
+patch-1.5.3.dw.crypt-autoselectkey.1 |
4 |
+patch-1.5.4.dw.confirm-crypt-hook.1 |
9 |
+patch-1.5.3.dw.confirm-crypt-hook.1 |
5 |
+patch-1.5.4.dw.multiple-crypt-hook.2 |
10 |
+patch-1.5.3.dw.multiple-crypt-hook.1 |
6 |
+patch-1.5.4.dw.crypt-autoselectkey.1 |
11 |
--- doc/manual.sgml.head Tue Dec 17 10:36:42 2002 |
7 |
--- doc/manual.sgml.head Tue Mar 4 08:49:49 2003 |
12 |
+++ doc/manual.sgml.head Fri Jan 24 11:26:59 2003 |
8 |
+++ doc/manual.sgml.head Thu Mar 20 21:38:47 2003 |
13 |
@@ -1423,7 +1423,9 @@ |
9 |
@@ -1422,7 +1422,9 @@ |
14 |
or because, for some reasons, you need to override the key Mutt would |
10 |
or because, for some reasons, you need to override the key Mutt would |
15 |
normally use. The crypt-hook command provides a method by which you can |
11 |
normally use. The crypt-hook command provides a method by which you can |
16 |
specify the ID of the public key to be used when encrypting messages to |
12 |
specify the ID of the public key to be used when encrypting messages to |
Link Here
|
19 |
+pattern; multiple matching pgp-hook's result in the use of multiple |
15 |
+pattern; multiple matching pgp-hook's result in the use of multiple |
20 |
+keyids for recipient. |
16 |
+keyids for recipient. |
21 |
|
17 |
|
22 |
<sect1>Adding key sequences to the keyboard buffer<label id="push"> |
18 |
The meaning of "key id" is to be taken broadly in this context: You |
23 |
<p> |
19 |
can either put a numerical key ID here, an e-mail address, or even |
24 |
--- doc/muttrc.man.head Mon Sep 9 21:28:35 2002 |
20 |
--- doc/muttrc.man.head Sun Dec 22 20:50:22 2002 |
25 |
+++ doc/muttrc.man.head Fri Jan 24 11:26:59 2003 |
21 |
+++ doc/muttrc.man.head Thu Mar 20 21:38:47 2003 |
26 |
@@ -287 +287,3 @@ |
22 |
@@ -286,7 +286,10 @@ |
27 |
-to a certain recipient. |
23 |
specify the ID of the public key to be used when encrypting messages |
28 |
+to a certain recipient. You may use multiple \fBpgp-hook\fPs with the |
24 |
to a certain recipient. The meaning of "key ID" is to be taken |
29 |
+same \fIpattern\fP; multiple matching \fBpgp-hook\fPs result in the use |
25 |
broadly: This can be a different e-mail address, a numerical key ID, |
30 |
+of multiple \fIkey-id\fPs for recipient. |
26 |
-or even just an arbitrary search string. |
31 |
--- hook.c Wed Dec 11 16:13:11 2002 |
27 |
+or even just an arbitrary search string. You may use multiple |
32 |
+++ hook.c Fri Jan 24 11:26:59 2003 |
28 |
+\fBpgp-hook\fPs with the same \fIpattern\fP; multiple matching |
33 |
@@ -118,7 +118,11 @@ |
29 |
+\fBpgp-hook\fPs result in the use of multiple \fIkey-id\fPs for |
|
|
30 |
+recipient. |
31 |
.TP |
32 |
\fBpush\fP \fIstring\fP |
33 |
This command adds the named \fIstring\fP to the keyboard buffer. |
34 |
--- hook.c Tue Jan 21 13:25:21 2003 |
35 |
+++ hook.c Thu Mar 20 21:38:47 2003 |
36 |
@@ -117,7 +117,11 @@ |
34 |
ptr->rx.not == not && |
37 |
ptr->rx.not == not && |
35 |
!mutt_strcmp (pattern.data, ptr->rx.pattern)) |
38 |
!mutt_strcmp (pattern.data, ptr->rx.pattern)) |
36 |
{ |
39 |
{ |
Link Here
|
42 |
{ |
45 |
{ |
43 |
/* these hooks allow multiple commands with the same |
46 |
/* these hooks allow multiple commands with the same |
44 |
* pattern, so if we've already seen this pattern/command pair, just |
47 |
* pattern, so if we've already seen this pattern/command pair, just |
45 |
@@ -445,9 +449,25 @@ |
48 |
@@ -443,9 +447,25 @@ |
|
|
49 |
return _mutt_string_hook (chs, M_ICONVHOOK); |
46 |
} |
50 |
} |
47 |
|
51 |
|
48 |
#if defined(HAVE_PGP) || defined(HAVE_SMIME) |
|
|
49 |
-char *mutt_crypt_hook (ADDRESS *adr) |
52 |
-char *mutt_crypt_hook (ADDRESS *adr) |
50 |
+LIST *mutt_crypt_hook (ADDRESS *adr) |
53 |
+LIST *mutt_crypt_hook (ADDRESS *adr) |
51 |
{ |
54 |
{ |
Link Here
|
68 |
+ } |
71 |
+ } |
69 |
+ return (key_list); |
72 |
+ return (key_list); |
70 |
} |
73 |
} |
71 |
#endif /* HAVE_PGP */ |
|
|
72 |
|
74 |
|
73 |
--- init.h Mon Dec 9 19:09:21 2002 |
75 |
#ifdef USE_SOCKET |
74 |
+++ init.h Fri Jan 24 11:27:21 2003 |
76 |
--- init.h Tue Mar 4 10:28:12 2003 |
75 |
@@ -1195,6 +1195,16 @@ |
77 |
+++ init.h Thu Mar 20 21:38:55 2003 |
76 |
|
78 |
@@ -1192,6 +1192,16 @@ |
77 |
#if defined(HAVE_PGP) || defined(HAVE_SMIME) |
79 |
** when you are at the end of a message and invoke the \fInext-page\fP |
78 |
# ifdef HAVE_PGP |
80 |
** function. |
|
|
81 |
*/ |
82 |
+ |
83 |
+ |
79 |
+ { "pgp_autoselectkey", DT_SYN, R_NONE, UL "crypt_autoselectkey", 0 }, |
84 |
+ { "pgp_autoselectkey", DT_SYN, R_NONE, UL "crypt_autoselectkey", 0 }, |
80 |
+# endif |
|
|
81 |
+ { "crypt_autoselectkey", DT_BOOL, R_NONE, OPTCRYPTAUTOSELECT, 0 }, |
85 |
+ { "crypt_autoselectkey", DT_BOOL, R_NONE, OPTCRYPTAUTOSELECT, 0 }, |
82 |
+ /* |
86 |
+ /* |
83 |
+ ** .pp |
87 |
+ ** .pp |
Link Here
|
85 |
+ ** one matching key is available. This may be useful in conjunction with |
89 |
+ ** one matching key is available. This may be useful in conjunction with |
86 |
+ ** the \fIcrypt-hook\fP command. |
90 |
+ ** the \fIcrypt-hook\fP command. |
87 |
+ */ |
91 |
+ */ |
88 |
+# ifdef HAVE_PGP |
|
|
89 |
{ "pgp_autosign", DT_SYN, R_NONE, UL "crypt_autosign", 0 }, |
92 |
{ "pgp_autosign", DT_SYN, R_NONE, UL "crypt_autosign", 0 }, |
90 |
# endif |
|
|
91 |
{ "crypt_autosign", DT_BOOL, R_NONE, OPTCRYPTAUTOSIGN, 0 }, |
93 |
{ "crypt_autosign", DT_BOOL, R_NONE, OPTCRYPTAUTOSIGN, 0 }, |
92 |
@@ -1220,6 +1230,17 @@ |
94 |
/* |
93 |
** requested as well. IF ``$$smime_is_default'' is set, then |
95 |
@@ -1216,6 +1226,15 @@ |
94 |
** OpenSSL is used instead to create S/MIME messages and settings can |
96 |
** then OpenSSL is used instead to create S/MIME messages and |
95 |
** be overridden by use of the \fIsmime-menu\fP. |
97 |
** settings can be overridden by use of the \fIsmime-menu\fP. |
|
|
98 |
** (Crypto only) |
96 |
+ */ |
99 |
+ */ |
97 |
+# ifdef HAVE_PGP |
|
|
98 |
+ { "pgp_confirmhook", DT_SYN, R_NONE, UL "crypt_confirmhook", 1 }, |
100 |
+ { "pgp_confirmhook", DT_SYN, R_NONE, UL "crypt_confirmhook", 1 }, |
99 |
+# endif |
|
|
100 |
+ { "crypt_confirmhook", DT_BOOL, R_NONE, OPTCRYPTCONFIRMHOOK, 1 }, |
101 |
+ { "crypt_confirmhook", DT_BOOL, R_NONE, OPTCRYPTCONFIRMHOOK, 1 }, |
101 |
+ /* |
102 |
+ /* |
102 |
+ ** .pp |
103 |
+ ** .pp |
Link Here
|
105 |
+ ** be presented. This is generally considered unsafe, especially where |
106 |
+ ** be presented. This is generally considered unsafe, especially where |
106 |
+ ** typos are concerned. |
107 |
+ ** typos are concerned. |
107 |
*/ |
108 |
*/ |
108 |
#ifdef HAVE_PGP |
|
|
109 |
{ "pgp_ignore_subkeys", DT_BOOL, R_NONE, OPTPGPIGNORESUB, 1}, |
109 |
{ "pgp_ignore_subkeys", DT_BOOL, R_NONE, OPTPGPIGNORESUB, 1}, |
110 |
--- mutt.h Fri Dec 6 17:37:21 2002 |
110 |
/* |
111 |
+++ mutt.h Fri Jan 24 11:27:21 2003 |
111 |
--- mutt.h Tue Mar 4 08:49:48 2003 |
112 |
@@ -431,6 +431,7 @@ |
112 |
+++ mutt.h Thu Mar 20 21:38:55 2003 |
|
|
113 |
@@ -425,6 +425,7 @@ |
114 |
|
113 |
/* PGP options */ |
115 |
/* PGP options */ |
114 |
|
116 |
|
115 |
#if defined(HAVE_PGP) || defined(HAVE_SMIME) |
|
|
116 |
+ OPTCRYPTAUTOSELECT, |
117 |
+ OPTCRYPTAUTOSELECT, |
117 |
OPTCRYPTAUTOSIGN, |
118 |
OPTCRYPTAUTOSIGN, |
118 |
OPTCRYPTAUTOENCRYPT, |
119 |
OPTCRYPTAUTOENCRYPT, |
119 |
OPTCRYPTREPLYENCRYPT, |
120 |
OPTCRYPTREPLYENCRYPT, |
120 |
@@ -442,6 +443,7 @@ |
121 |
@@ -434,6 +435,7 @@ |
|
|
122 |
OPTSMIMEISDEFAULT, |
121 |
OPTASKCERTLABEL, |
123 |
OPTASKCERTLABEL, |
122 |
OPTSDEFAULTDECRYPTKEY, |
124 |
OPTSDEFAULTDECRYPTKEY, |
123 |
#endif |
|
|
124 |
+ OPTCRYPTCONFIRMHOOK, |
125 |
+ OPTCRYPTCONFIRMHOOK, |
125 |
#ifdef HAVE_PGP |
|
|
126 |
OPTPGPIGNORESUB, |
126 |
OPTPGPIGNORESUB, |
127 |
OPTPGPLONGIDS, |
127 |
OPTPGPLONGIDS, |
128 |
--- pgp.c Mon Dec 16 16:27:26 2002 |
128 |
OPTPGPAUTOTRAD, |
129 |
+++ pgp.c Fri Jan 24 11:27:04 2003 |
129 |
--- pgp.c Tue Feb 25 22:28:54 2003 |
130 |
@@ -1051,6 +1051,8 @@ |
130 |
+++ pgp.c Thu Mar 20 21:40:39 2003 |
|
|
131 |
@@ -1014,6 +1014,8 @@ |
131 |
char *keyID, *keylist = NULL, *t; |
132 |
char *keyID, *keylist = NULL, *t; |
132 |
size_t keylist_size = 0; |
133 |
size_t keylist_size = 0; |
133 |
size_t keylist_used = 0; |
134 |
size_t keylist_used = 0; |
Link Here
|
136 |
ADDRESS *tmp = NULL, *addr = NULL; |
137 |
ADDRESS *tmp = NULL, *addr = NULL; |
137 |
ADDRESS **last = &tmp; |
138 |
ADDRESS **last = &tmp; |
138 |
ADDRESS *p, *q; |
139 |
ADDRESS *p, *q; |
139 |
@@ -1084,70 +1086,97 @@ |
140 |
@@ -1047,70 +1049,97 @@ |
140 |
char buf[LONG_STRING]; |
141 |
char buf[LONG_STRING]; |
141 |
|
142 |
|
142 |
q = p; |
143 |
q = p; |
Link Here
|
163 |
- if (is_numerical_keyid (keyID)) |
164 |
- if (is_numerical_keyid (keyID)) |
164 |
+ keyID = (char *)hook->data; |
165 |
+ keyID = (char *)hook->data; |
165 |
+ snprintf (buf, sizeof (buf), _("Use keyID = \"%s\" for %s?"), keyID, p->mailbox); |
166 |
+ snprintf (buf, sizeof (buf), _("Use keyID = \"%s\" for %s?"), keyID, p->mailbox); |
166 |
+ if (!option(OPTCRYPTCONFIRMHOOK) || (r = mutt_yesorno (buf, M_YES)) == M_YES) |
167 |
+ if (!option(OPTCRYPTCONFIRMHOOK) || (r = mutt_yesorno (buf, M_YES)) == M_YES) |
167 |
{ |
168 |
{ |
168 |
- if (strncmp (keyID, "0x", 2) == 0) |
169 |
- if (strncmp (keyID, "0x", 2) == 0) |
169 |
- keyID += 2; |
170 |
- keyID += 2; |
Link Here
|
281 |
|
282 |
|
282 |
} |
283 |
} |
283 |
rfc822_free_address (&tmp); |
284 |
rfc822_free_address (&tmp); |
284 |
diff -ru work.orig/mutt-1.5.3/pgpkey.c work/mutt-1.5.3/pgpkey.c |
285 |
--- pgpkey.c Tue Jan 21 13:25:21 2003 |
285 |
--- pgpkey.c Wed Dec 11 12:20:05 2002 |
286 |
+++ pgpkey.c Thu Mar 20 21:38:32 2003 |
286 |
+++ pgpkey.c Fri Jan 24 11:27:21 2003 |
287 |
@@ -435,8 +435,13 @@ |
287 |
@@ -435,6 +435,11 @@ |
|
|
288 |
return rv; |
288 |
return rv; |
289 |
} |
289 |
} |
290 |
|
290 |
|
Link Here
|
293 |
+ || (pgp_id_is_valid((uid)) \ |
293 |
+ || (pgp_id_is_valid((uid)) \ |
294 |
+ && pgp_id_is_strong((uid)))) |
294 |
+ && pgp_id_is_strong((uid)))) |
295 |
+ |
295 |
+ |
296 |
static pgp_key_t *pgp_select_key (pgp_key_t *keys, |
296 |
static pgp_key_t pgp_select_key (pgp_key_t keys, |
297 |
ADDRESS * p, const char *s) |
297 |
- ADDRESS * p, const char *s) |
|
|
298 |
+ ADDRESS * p, const char *s) |
298 |
{ |
299 |
{ |
|
|
300 |
int keymax; |
301 |
pgp_uid_t **KeyTable; |
299 |
@@ -450,6 +455,7 @@ |
302 |
@@ -450,6 +455,7 @@ |
300 |
pgp_uid_t *a; |
303 |
pgp_uid_t *a; |
301 |
int (*f) (const void *, const void *); |
304 |
int (*f) (const void *, const void *); |
Link Here
|
345 |
{ |
348 |
{ |
346 |
char *s = ""; |
349 |
char *s = ""; |
347 |
char buff[LONG_STRING]; |
350 |
char buff[LONG_STRING]; |
348 |
--- protos.h Wed Dec 11 23:31:25 2002 |
351 |
--- protos.h Thu Mar 6 22:24:46 2003 |
349 |
+++ protos.h Fri Jan 24 11:26:59 2003 |
352 |
+++ protos.h Thu Mar 20 21:38:47 2003 |
350 |
@@ -130,7 +130,7 @@ |
353 |
@@ -129,7 +129,7 @@ |
351 |
char *mutt_get_name (ADDRESS *); |
354 |
char *mutt_get_body_charset (char *, size_t, BODY *); |
|
|
355 |
const char *mutt_get_name (ADDRESS *); |
352 |
char *mutt_get_parameter (const char *, PARAMETER *); |
356 |
char *mutt_get_parameter (const char *, PARAMETER *); |
353 |
#if defined(HAVE_PGP) || defined(HAVE_SMIME) |
|
|
354 |
-char *mutt_crypt_hook (ADDRESS *); |
357 |
-char *mutt_crypt_hook (ADDRESS *); |
355 |
+LIST *mutt_crypt_hook (ADDRESS *); |
358 |
+LIST *mutt_crypt_hook (ADDRESS *); |
356 |
#endif /* HAVE_PGP */ |
|
|
357 |
char *mutt_make_date (char *, size_t); |
359 |
char *mutt_make_date (char *, size_t); |
358 |
|
360 |
|
|
|
361 |
const char *mutt_make_version (void); |