* [PATCH] mml2015-epg-sign does not use from header.
2009-01-28 11:57 ` Daniel Dehennin
@ 2009-01-28 11:59 ` Daniel Dehennin
2009-03-01 17:13 ` Daiki Ueno
` (2 more replies)
2009-01-28 12:00 ` [PATCH] Factor spliting mail addresses Daniel Dehennin
` (9 subsequent siblings)
10 siblings, 3 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 11:59 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
------------------------------------------------------------
revno: 113
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Tue 2009-01-27 19:44:28 +0100
message:
mml2015-epg-sign does not use from header.
* lisp/mml2015.el (mml2015-epg-sign): New variable 'sender'
is (message-options-get 'message-sender). Use it in place of
mml2015-signers.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus113.patch --]
[-- Type: text/x-patch, Size: 1319 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090127184428-\
# g31ccthfaksykt29
# target_branch: ../../gnus.head
# testament_sha1: c1cf3a01375bb35cd7bde5fa3102662608096e6a
# timestamp: 2009-01-28 11:48:57 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-27 18:44:28 +0000
@@ -1182,6 +1182,7 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
@@ -1191,8 +1192,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ sender t)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1207,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (list sender))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH] mml2015-epg-sign does not use from header.
2009-01-28 11:59 ` [PATCH] mml2015-epg-sign does " Daniel Dehennin
@ 2009-03-01 17:13 ` Daiki Ueno
2009-03-03 18:59 ` Daniel Dehennin
2009-04-13 20:31 ` Daniel Dehennin
2009-04-13 20:32 ` [PATCH] mml2015-epg-encrypt do not use from header to sign Daniel Dehennin
2 siblings, 1 reply; 53+ messages in thread
From: Daiki Ueno @ 2009-03-01 17:13 UTC (permalink / raw)
To: Daniel Dehennin; +Cc: ding
>>>>> In <87wscf3al8.fsf@hati.baby-gnu.org>
>>>>> Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote:
> * lisp/mml2015.el (mml2015-epg-sign): New variable 'sender'
> is (message-options-get 'message-sender). Use it in place of
> mml2015-signers.
Sorry for late response, and thanks for splitting your patch.
> --- lisp/mml2015.el 2009-01-22 07:02:15 +0000
> +++ lisp/mml2015.el 2009-01-27 18:44:28 +0000
> @@ -1182,6 +1182,7 @@
> (let* ((inhibit-redisplay t)
> (context (epg-make-context))
> (boundary (mml-compute-boundary cont))
> + (sender (message-options-get 'message-sender))
> signer-key
> (signers
> (or (message-options-get 'mml2015-epg-signers)
> @@ -1191,8 +1192,8 @@
> (epa-select-keys context "\
> Select keys for signing.
> If no one is selected, default secret key is used. "
> - mml2015-signers t)
> - (if mml2015-signers
> + sender t)
> + (if sender
> (delq nil
> (mapcar
> (lambda (signer)
> @@ -1206,7 +1207,7 @@
> signer)))
> (error "No secret key for %s" signer))
> signer-key)
> - mml2015-signers)))))))
> + (list sender))))))))
> signature micalg)
> (epg-context-set-armor context t)
> (epg-context-set-textmode context t)
Unfortunatelly, this patch looks unacceptable since it breaks the
compatibility of the user setting. Although I agree with that the
typical user would expect his From: line be used as the keygrip of the
signing key, existing users (including I) may have a setting of
mml2015-signers.
Why not adjust mml2015-signers to include the From: address instead of
entirely overwriting it? Like this:
(defun mml2015-epg-uniquify-keys (keys)
(let (key-id key-ids)
(delq nil (mapcar
(lambda (key)
(setq key-id (car (epg-key-sub-key-list key)))
(unless (member key-id key-ids)
(setq key-ids (cons key-id key-ids))
key))
keys))))
In mml2015-epg-sign:
- mml2015-signers)))))))
+ (append mml2015-signers (list sender)))))))))
...
+ (setq signers (mml2015-epg-uniquify-keys signers))
Regards,
--
Daiki Ueno
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH] mml2015-epg-sign does not use from header.
2009-03-01 17:13 ` Daiki Ueno
@ 2009-03-03 18:59 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-03-03 18:59 UTC (permalink / raw)
To: ding
Le 5660 Septembre 1993, Daiki Ueno a envoyé:
> Unfortunatelly, this patch looks unacceptable since it breaks the
> compatibility of the user setting. Although I agree with that the
[...]
> + (setq signers (mml2015-epg-uniquify-keys signers))
Ok, I'll post new patches soon, I'm quite busy for a couple of days.
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] mml2015-epg-sign does not use from header.
2009-01-28 11:59 ` [PATCH] mml2015-epg-sign does " Daniel Dehennin
2009-03-01 17:13 ` Daiki Ueno
@ 2009-04-13 20:31 ` Daniel Dehennin
2009-04-13 20:32 ` [PATCH] mml2015-epg-encrypt do not use from header to sign Daniel Dehennin
2 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:31 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
------------------------------------------------------------
revno: 134
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:04:07 +0200
message:
mml2015-epg-sign does not use from header.
* lisp/mml2015.el (mml2015-epg-sign): New variable 'sender'
is (message-options-get 'message-sender). Use it in addition to
mml2015-signers.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-134.patch --]
[-- Type: text/x-patch, Size: 1379 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413180407-\
# c8k3bhxwfy83520m
# target_branch: ../../gnus.head
# testament_sha1: a5b6834d5c550ff0991c0267d2ca24a941e55635
# timestamp: 2009-04-13 20:57:04 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:04:07 +0000
@@ -1182,6 +1182,7 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
@@ -1191,8 +1192,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (cons sender mml2015-signers) t)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1207,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] mml2015-epg-encrypt do not use from header to sign.
2009-01-28 11:59 ` [PATCH] mml2015-epg-sign does " Daniel Dehennin
2009-03-01 17:13 ` Daiki Ueno
2009-04-13 20:31 ` Daniel Dehennin
@ 2009-04-13 20:32 ` Daniel Dehennin
2 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:32 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 415 bytes --]
------------------------------------------------------------
revno: 135
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:06:53 +0200
message:
mml2015-epg-encrypt do not use from header to sign.
* lisp/mml2015.el (mml2015-epg-encrypt): New variable 'sender'
is (message-options-get 'message-sender). Use it in addition to
mml2015-signers.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-135.patch --]
[-- Type: text/x-patch, Size: 2819 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413180653-\
# v67k5z5akqbiffsa
# target_branch: ../../gnus.head
# testament_sha1: 2297afa76761151c604ef7a0985fb033bdc209dc
# timestamp: 2009-04-13 20:57:26 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:06:53 +0000
@@ -1182,6 +1182,7 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
@@ -1191,8 +1192,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (cons sender mml2015-signers) t)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1207,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,6 +1250,7 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (message-options-get 'message-sender))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
@@ -1266,9 +1268,9 @@
(read-string "Recipients: ")))
"[ \f\t\n\r\v,]+"))))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
(if mml2015-verbose
(setq recipients
(epa-select-keys context "\
@@ -1301,8 +1303,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (cons sender mml2015-signers) t)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1318,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Factor spliting mail addresses.
2009-01-28 11:57 ` Daniel Dehennin
2009-01-28 11:59 ` [PATCH] mml2015-epg-sign does " Daniel Dehennin
@ 2009-01-28 12:00 ` Daniel Dehennin
2009-04-13 20:32 ` Daniel Dehennin
2009-01-28 12:01 ` [PATCH] Cleanup selecting a key for sign and encryption Daniel Dehennin
` (8 subsequent siblings)
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:00 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 379 bytes --]
------------------------------------------------------------
revno: 115
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Tue 2009-01-27 20:40:52 +0100
message:
Factor spliting mail addresses.
* lisp/mml2015.el (mml2015-epg-split-addresses): Split a string of addresses.
(mml2015-epg-encrypt): Use it to set recipients.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus115.patch --]
[-- Type: text/x-patch, Size: 3616 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090127194052-\
# mnh8eg1sy9eldodg
# target_branch: ../../gnus.head
# testament_sha1: 09eb182f0e81f7faa1ebaa723bb27514223cb1a9
# timestamp: 2009-01-28 13:00:28 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-27 19:40:52 +0000
@@ -1025,6 +1025,18 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,6 +1194,7 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
@@ -1191,8 +1204,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ sender t)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1219,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (list sender))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,26 +1262,20 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (message-options-get 'message-sender))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients (list sender))))
(if mml2015-verbose
(setq recipients
(epa-select-keys context "\
@@ -1301,8 +1308,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ sender t)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1323,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (list sender))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Factor spliting mail addresses.
2009-01-28 12:00 ` [PATCH] Factor spliting mail addresses Daniel Dehennin
@ 2009-04-13 20:32 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:32 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
------------------------------------------------------------
revno: 136
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:07:37 +0200
message:
Factor spliting mail addresses.
* lisp/mml2015.el (mml2015-epg-split-addresses): Split a string of addresses.
(mml2015-epg-encrypt): Use it to set recipients.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-136.patch --]
[-- Type: text/x-patch, Size: 3793 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413180737-\
# rj1gz47cn7iha9zu
# target_branch: ../../gnus.head
# testament_sha1: 951a8dc52109b188478c54a7a6afb0eae4c80017
# timestamp: 2009-04-13 20:58:52 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:07:37 +0000
@@ -1025,6 +1025,18 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,6 +1194,7 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
@@ -1191,8 +1204,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (cons sender mml2015-signers) t)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1219,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,26 +1262,20 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (message-options-get 'message-sender))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
(if mml2015-verbose
(setq recipients
(epa-select-keys context "\
@@ -1301,8 +1308,8 @@
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (cons sender mml2015-signers) t)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1323,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Cleanup selecting a key for sign and encryption.
2009-01-28 11:57 ` Daniel Dehennin
2009-01-28 11:59 ` [PATCH] mml2015-epg-sign does " Daniel Dehennin
2009-01-28 12:00 ` [PATCH] Factor spliting mail addresses Daniel Dehennin
@ 2009-01-28 12:01 ` Daniel Dehennin
2009-04-13 20:32 ` Daniel Dehennin
2009-01-28 12:02 ` [PATCH] Only one sender Daniel Dehennin
` (7 subsequent siblings)
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:01 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 398 bytes --]
------------------------------------------------------------
revno: 116
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Tue 2009-01-27 22:36:43 +0100
message:
Cleanup selecting a key for sign and encryption.
* lisp/mml2015.el (mml2015-epg-prompt-select-keys): New function.
(mml2015-epg-sign): Use it.
(mml2015-epg-encrypt): Use it.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus116.patch --]
[-- Type: text/x-patch, Size: 5007 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090127213643-\
# wdsvibfo9rhmi3es
# target_branch: ../../gnus.head
# testament_sha1: f616e0abc7ccd21f7deb0f85564d74f5c0ff97ff
# timestamp: 2009-01-28 13:00:48 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-27 21:36:43 +0000
@@ -1025,6 +1025,43 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,17 +1219,15 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1241,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (list sender))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,32 +1284,23 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (message-options-get 'message-sender))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients (list sender))))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
(delq nil
(mapcar
@@ -1298,11 +1324,8 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1339,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (list sender))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Cleanup selecting a key for sign and encryption.
2009-01-28 12:01 ` [PATCH] Cleanup selecting a key for sign and encryption Daniel Dehennin
@ 2009-04-13 20:32 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:32 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 393 bytes --]
------------------------------------------------------------
revno: 137
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:17:09 +0200
message:
Cleanup selecting a key for sign and encryption.
* lisp/mml2015.el (mml2015-epg-prompt-select-keys): New function.
(mml2015-epg-sign): Use it.
(mml2015-epg-encrypt): Use it.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-137.patch --]
[-- Type: text/x-patch, Size: 5184 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413181709-\
# 6t1hgpg4585mapmw
# target_branch: ../../gnus.head
# testament_sha1: bd879ebf33dd7fbc8a6723fb4101951495e85b4a
# timestamp: 2009-04-13 20:59:19 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:17:09 +0000
@@ -1025,6 +1025,43 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,17 +1219,15 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (sender (message-options-get 'message-sender))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context (cons sender mml2015-signers) 'sign)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1241,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,32 +1284,23 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (message-options-get 'message-sender))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
(delq nil
(mapcar
@@ -1298,11 +1324,8 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context (cons sender mml2015-signers) 'sign)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1339,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Only one sender.
2009-01-28 11:57 ` Daniel Dehennin
` (2 preceding siblings ...)
2009-01-28 12:01 ` [PATCH] Cleanup selecting a key for sign and encryption Daniel Dehennin
@ 2009-01-28 12:02 ` Daniel Dehennin
2009-04-13 20:32 ` Daniel Dehennin
2009-01-28 12:02 ` Daniel Dehennin
` (6 subsequent siblings)
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:02 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 363 bytes --]
------------------------------------------------------------
revno: 117
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Tue 2009-01-27 23:21:03 +0100
message:
Only one sender.
* lisp/mml2015.el (mml2015-epg-sign): From header should have only one
sender address. Split it and fetch only the first one.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus117.patch --]
[-- Type: text/x-patch, Size: 5099 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090127222103-\
# i0pdjq2zftwgg39f
# target_branch: ../../gnus.head
# testament_sha1: 10084be917ad726f471ded442fee6ba6ce9122fd
# timestamp: 2009-01-28 13:01:10 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-27 22:21:03 +0000
@@ -1025,6 +1025,43 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,17 +1219,19 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1245,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ sender)))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,32 +1288,23 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (message-options-get 'message-sender))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients (list sender))))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
(delq nil
(mapcar
@@ -1298,11 +1328,8 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1343,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (list sender))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Only one sender.
2009-01-28 12:02 ` [PATCH] Only one sender Daniel Dehennin
@ 2009-04-13 20:32 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:32 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 358 bytes --]
------------------------------------------------------------
revno: 138
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:25:42 +0200
message:
Only one sender.
* lisp/mml2015.el (mml2015-epg-sign): From header should have only one
sender address. Split it and fetch only the first one.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-138.patch --]
[-- Type: text/x-patch, Size: 5281 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413182542-\
# i9jzkccgc9e1365g
# target_branch: ../../gnus.head
# testament_sha1: 8a13d89d874f9f0a56ce806e2856ec109d4ffa0c
# timestamp: 2009-04-13 21:00:07 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:25:42 +0000
@@ -1025,6 +1025,43 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,17 +1219,18 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context (cons sender mml2015-signers) 'sign)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1244,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,32 +1287,23 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (message-options-get 'message-sender))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
(delq nil
(mapcar
@@ -1298,11 +1327,8 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context (cons sender mml2015-signers) 'sign)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1342,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Only one sender.
2009-01-28 11:57 ` Daniel Dehennin
` (3 preceding siblings ...)
2009-01-28 12:02 ` [PATCH] Only one sender Daniel Dehennin
@ 2009-01-28 12:02 ` Daniel Dehennin
2009-04-13 20:32 ` Daniel Dehennin
2009-01-28 12:02 ` [PATCH] Factorize choosing a key Daniel Dehennin
` (5 subsequent siblings)
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:02 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
------------------------------------------------------------
revno: 118
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Tue 2009-01-27 23:23:42 +0100
message:
Only one sender.
* lisp/mml2015.el (mml2015-epg-encrypt): From header should have only one
sender address. Split it and fetch only the first one.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus118.patch --]
[-- Type: text/x-patch, Size: 5156 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090127222342-\
# 994z6t8g80vrzj9q
# target_branch: ../../gnus.head
# testament_sha1: 11829d0d11b87d6d050bbece843b2c5c4b5941e9
# timestamp: 2009-01-28 13:02:08 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-27 22:23:42 +0000
@@ -1025,6 +1025,43 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,17 +1219,19 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1245,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ sender)))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,32 +1288,26 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients sender)))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
(delq nil
(mapcar
@@ -1298,11 +1331,8 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (if sender
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1346,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ sender)))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Only one sender.
2009-01-28 12:02 ` Daniel Dehennin
@ 2009-04-13 20:32 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:32 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 361 bytes --]
------------------------------------------------------------
revno: 139
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:36:52 +0200
message:
Only one sender.
* lisp/mml2015.el (mml2015-epg-encrypt): From header should have only one
sender address. Split it and fetch only the first one.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-139.patch --]
[-- Type: text/x-patch, Size: 5677 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413183652-\
# eknu6ads6ixw2rhq
# target_branch: ../../gnus.head
# testament_sha1: 0493d007a40fbce120796830b4d9c6c787c2f8f8
# timestamp: 2009-04-13 21:01:02 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:36:52 +0000
@@ -1025,6 +1025,43 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,17 +1219,18 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context (cons sender mml2015-signers) 'sign)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1206,7 +1244,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1246,35 +1284,28 @@
(goto-char (point-max))))
(defun mml2015-epg-encrypt (cont &optional sign)
- (let ((inhibit-redisplay t)
- (context (epg-make-context))
- (config (epg-configuration))
- (recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key signer-key)
+ (let* ((inhibit-redisplay t)
+ (context (epg-make-context))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
+ (recipients (message-options-get 'mml2015-epg-recipients))
+ cipher signers
+ (boundary (mml-compute-boundary cont))
+ recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
(delq nil
(mapcar
@@ -1298,11 +1329,8 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
+ (mml2015-epg-prompt-select-keys context (cons sender mml2015-signers) 'sign)
+ (if (or sender mml2015-signers)
(delq nil
(mapcar
(lambda (signer)
@@ -1316,7 +1344,7 @@
signer)))
(error "No secret key for %s" signer))
signer-key)
- mml2015-signers)))))))
+ (cons sender mml2015-signers))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Factorize choosing a key.
2009-01-28 11:57 ` Daniel Dehennin
` (4 preceding siblings ...)
2009-01-28 12:02 ` Daniel Dehennin
@ 2009-01-28 12:02 ` Daniel Dehennin
2009-04-13 20:33 ` Daniel Dehennin
2009-01-28 12:02 ` [PATCH] mml2015-epg-choose-keys handle the verbose selection of keys Daniel Dehennin
` (4 subsequent siblings)
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:02 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]
------------------------------------------------------------
revno: 119
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Tue 2009-01-27 23:46:04 +0100
message:
Factorize choosing a key.
* lisp/mml2015.el (mml2015-epg-choose-keys): New function.
(mml2015-epg-encrypt): Use it.
(mml2015-epg-encrypt): Use it.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus119.patch --]
[-- Type: text/x-patch, Size: 7038 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090127224604-\
# q8ho2n9lhg5bku2x
# target_branch: ../../gnus.head
# testament_sha1: 7968a974221474ca570e1db2a8d8fa64d78e3f5f
# timestamp: 2009-01-28 13:02:16 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-27 22:46:04 +0000
@@ -1025,6 +1025,70 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (setq key (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (unless (or key
+ (y-or-n-p
+ (format
+ "No %s key for %s; skip it? "
+ key-type-name name)))
+ (error "No %s key for %s" key-type-name name))
+ key)
+ names)))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,31 +1246,19 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (mml2015-epg-choose-keys context sender 'sign)))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,46 +1301,28 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients sender)))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
+ (mml2015-epg-choose-keys context recipients 'encrypt))
(unless recipients
(error "No recipient specified")))
(message-options-set 'mml2015-epg-recipients recipients))
@@ -1298,25 +1332,8 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-prompt-select-keys context sender 'sign)
+ (mml2015-epg-choose-keys context sender 'sign)))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Factorize choosing a key.
2009-01-28 12:02 ` [PATCH] Factorize choosing a key Daniel Dehennin
@ 2009-04-13 20:33 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:33 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 366 bytes --]
------------------------------------------------------------
revno: 140
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:38:15 +0200
message:
Factorize choosing a key.
* lisp/mml2015.el (mml2015-epg-choose-keys): New function.
(mml2015-epg-encrypt): Use it.
(mml2015-epg-encrypt): Use it.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-140.patch --]
[-- Type: text/x-patch, Size: 7349 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413183815-\
# py6tj057jlml4f05
# target_branch: ../../gnus.head
# testament_sha1: 53d16ca70e4a4f5db511988154036c3775a1c060
# timestamp: 2009-04-13 21:04:19 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:38:15 +0000
@@ -1025,6 +1025,70 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (setq key (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (unless (or key
+ (y-or-n-p
+ (format
+ "No %s key for %s; skip it? "
+ key-type-name name)))
+ (error "No %s key for %s" key-type-name name))
+ key)
+ names)))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,31 +1246,17 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign)))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1246,49 +1296,30 @@
(goto-char (point-max))))
(defun mml2015-epg-encrypt (cont &optional sign)
- (let ((inhibit-redisplay t)
- (context (epg-make-context))
- (config (epg-configuration))
- (recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key signer-key)
+ (let* ((inhibit-redisplay t)
+ (context (epg-make-context))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
+ (recipients (message-options-get 'mml2015-epg-recipients))
+ cipher signers
+ (boundary (mml-compute-boundary cont))
+ recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
(if mml2015-verbose
(setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
+ (mml2015-epg-prompt-select-keys context recipients 'encrypt))
(setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
+ (mml2015-epg-choose-keys context recipients 'encrypt))
(unless recipients
(error "No recipient specified")))
(message-options-set 'mml2015-epg-recipients recipients))
@@ -1298,25 +1329,7 @@
(message-options-set
'mml2015-epg-signers
(if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign)))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] mml2015-epg-choose-keys handle the verbose selection of keys.
2009-01-28 11:57 ` Daniel Dehennin
` (5 preceding siblings ...)
2009-01-28 12:02 ` [PATCH] Factorize choosing a key Daniel Dehennin
@ 2009-01-28 12:02 ` Daniel Dehennin
2009-04-13 20:33 ` Daniel Dehennin
2009-01-28 12:02 ` [PATCH] Fix variable name, only one sender Daniel Dehennin
` (3 subsequent siblings)
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:02 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 538 bytes --]
------------------------------------------------------------
revno: 120
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Wed 2009-01-28 01:53:31 +0100
message:
mml2015-epg-choose-keys handle the verbose selection of keys.
* lisp/mml2015.el (mml2015-epg-choose-keys): Modify to handle mml2015-verbose.
Fix y-or-n-p question, y mean abort sending mail.
(mml2015-epg-sign): No need to check for mml2015-verbose.
(mml2015-epg-encrypt): No need to check for mml2015-verbose.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus120.patch --]
[-- Type: text/x-patch, Size: 7481 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090128005331-\
# 8o7gdc2i1y196zef
# target_branch: ../../gnus.head
# testament_sha1: 383c8784df954f7dfc77bfa5c36f60ec1f874be0
# timestamp: 2009-01-28 13:02:26 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-28 00:53:31 +0000
@@ -1025,6 +1025,83 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq t
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (if (and
+ ;; Fail to fetch a key
+ (not (setq key
+ ;; Does name have any key ?
+ (and (epg-list-keys context name key-type)
+ (or (and (not mml2015-verbose)
+ (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (mml2015-epg-find-usable-key
+ (mml2015-epg-prompt-select-keys context name usage)
+ usage)
+ ;; Avoid error if the user don't select a
+ ;; key because epa-select-keys returns nil
+ t))))
+ ;; No key, ask to abord
+ (y-or-n-p
+ (format
+ "No %s key for %s; abort? "
+ key-type-name name)))
+ (error "No %s key for %s: aborted" key-type-name name))
+ key)
+ names))))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,31 +1259,17 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context sender 'sign))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1249,74 +1312,34 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
(recipients (message-options-get 'mml2015-epg-recipients))
cipher signers
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
- (if mml2015-verbose
- (setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
- (setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
- (unless recipients
- (error "No recipient specified")))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients sender)))
+ (setq recipients
+ (mml2015-epg-choose-keys context recipients 'encrypt))
+ (unless recipients
+ (error "No recipient specified"))
(message-options-set 'mml2015-epg-recipients recipients))
(when sign
(setq signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context sender 'sign))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] mml2015-epg-choose-keys handle the verbose selection of keys.
2009-01-28 12:02 ` [PATCH] mml2015-epg-choose-keys handle the verbose selection of keys Daniel Dehennin
@ 2009-04-13 20:33 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:33 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
------------------------------------------------------------
revno: 141
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:46:39 +0200
message:
mml2015-epg-choose-keys handle the verbose selection of keys.
* lisp/mml2015.el (mml2015-epg-choose-keys): Modify to handle mml2015-verbose.
Fix y-or-n-p question, y mean abort sending mail.
(mml2015-epg-sign): No need to check for mml2015-verbose.
(mml2015-epg-encrypt): No need to check for mml2015-verbose.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-141.patch --]
[-- Type: text/x-patch, Size: 7912 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413184639-\
# 0ej3g3ykoh0rpai7
# target_branch: ../../gnus.head
# testament_sha1: 60a9c5404d32ba705d74d2815da5cad517e3af6d
# timestamp: 2009-04-13 21:04:47 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:46:39 +0000
@@ -1025,6 +1025,83 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq t
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (if (and
+ ;; Fail to fetch a key
+ (not (setq key
+ ;; Does name have any key ?
+ (and (epg-list-keys context name key-type)
+ (or (and (not mml2015-verbose)
+ (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (mml2015-epg-find-usable-key
+ (mml2015-epg-prompt-select-keys context name usage)
+ usage)
+ ;; Avoid error if the user don't select a
+ ;; key because epa-select-keys returns nil
+ t))))
+ ;; No key, ask to abord
+ (y-or-n-p
+ (format
+ "No %s key for %s; abort? "
+ key-type-name name)))
+ (error "No %s key for %s: aborted" key-type-name name))
+ key)
+ names))))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,31 +1259,16 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
signer-key
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1246,77 +1308,36 @@
(goto-char (point-max))))
(defun mml2015-epg-encrypt (cont &optional sign)
- (let ((inhibit-redisplay t)
- (context (epg-make-context))
- (config (epg-configuration))
- (recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key signer-key)
+ (let* ((inhibit-redisplay t)
+ (context (epg-make-context))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
+ (recipients (message-options-get 'mml2015-epg-recipients))
+ cipher signers
+ (boundary (mml-compute-boundary cont))
+ recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
- (if mml2015-verbose
- (setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
- (setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
- (unless recipients
- (error "No recipient specified")))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
+ (setq recipients
+ (mml2015-epg-choose-keys context recipients 'encrypt))
+ (unless recipients
+ (error "No recipient specified"))
(message-options-set 'mml2015-epg-recipients recipients))
(when sign
(setq signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Fix variable name, only one sender.
2009-01-28 11:57 ` Daniel Dehennin
` (6 preceding siblings ...)
2009-01-28 12:02 ` [PATCH] mml2015-epg-choose-keys handle the verbose selection of keys Daniel Dehennin
@ 2009-01-28 12:02 ` Daniel Dehennin
2009-01-28 12:02 ` [PATCH] Remove useless variables Daniel Dehennin
` (2 subsequent siblings)
10 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:02 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
------------------------------------------------------------
revno: 121
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Wed 2009-01-28 01:57:05 +0100
message:
Fix variable name, only one sender.
* lisp/mml2015.el (mml2015-epg-sign): Replace signers with signer.
(mml2015-epg-encrypt): Replace signers with signer.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus121.patch --]
[-- Type: text/x-patch, Size: 7943 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090128005705-\
# bdb8zjv8jl3dkyx8
# target_branch: ../../gnus.head
# testament_sha1: 1859325a10218af10aeacbb25a5f32e8af2a9a3d
# timestamp: 2009-01-28 13:02:40 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-28 00:57:05 +0000
@@ -1025,6 +1025,83 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq t
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (if (and
+ ;; Fail to fetch a key
+ (not (setq key
+ ;; Does name have any key ?
+ (and (epg-list-keys context name key-type)
+ (or (and (not mml2015-verbose)
+ (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (mml2015-epg-find-usable-key
+ (mml2015-epg-prompt-select-keys context name usage)
+ usage)
+ ;; Avoid error if the user don't select a
+ ;; key because epa-select-keys returns nil
+ t))))
+ ;; No key, ask to abord
+ (y-or-n-p
+ (format
+ "No %s key for %s; abort? "
+ key-type-name name)))
+ (error "No %s key for %s: aborted" key-type-name name))
+ key)
+ names))))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,35 +1259,21 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
+ (config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
signer-key
- (signers
- (or (message-options-get 'mml2015-epg-signers)
+ (signer
+ (or (message-options-get 'mml2015-epg-signer)
(message-options-set
- 'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ 'mml2015-epg-signer
+ (mml2015-epg-choose-keys context sender 'sign))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
- (epg-context-set-signers context signers)
+ (epg-context-set-signers context signer)
(if mml2015-cache-passphrase
(epg-context-set-passphrase-callback
context
@@ -1249,75 +1312,35 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
(recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
+ cipher signer
(boundary (mml-compute-boundary cont))
recipient-key signer-key)
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
- (if mml2015-verbose
- (setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
- (setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
- (unless recipients
- (error "No recipient specified")))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients sender)))
+ (setq recipients
+ (mml2015-epg-choose-keys context recipients 'encrypt))
+ (unless recipients
+ (error "No recipient specified"))
(message-options-set 'mml2015-epg-recipients recipients))
(when sign
- (setq signers
- (or (message-options-get 'mml2015-epg-signers)
+ (setq signer
+ (or (message-options-get 'mml2015-epg-signer)
(message-options-set
- 'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
- (epg-context-set-signers context signers))
+ 'mml2015-epg-signer
+ (mml2015-epg-choose-keys context sender 'sign))))
+ (epg-context-set-signers context signer))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
(if mml2015-cache-passphrase
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Remove useless variables
2009-01-28 11:57 ` Daniel Dehennin
` (7 preceding siblings ...)
2009-01-28 12:02 ` [PATCH] Fix variable name, only one sender Daniel Dehennin
@ 2009-01-28 12:02 ` Daniel Dehennin
2009-04-13 20:33 ` Daniel Dehennin
2009-01-28 12:03 ` [PATCH] Permit to select a key if more than one match a mail address Daniel Dehennin
2009-04-13 20:31 ` mml2015-epg-sign do not use from header Daniel Dehennin
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:02 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 381 bytes --]
------------------------------------------------------------
revno: 122
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Wed 2009-01-28 01:58:55 +0100
message:
Remove useless variables
* lisp/mml2015.el (mml2015-epg-sign): Remove variable signer-key.
(mml2015-epg-encrypt): Remove variables signer-key and recipient-key.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus122.patch --]
[-- Type: text/x-patch, Size: 7985 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090128005855-\
# ztz9z6fz1fuf18x9
# target_branch: ../../gnus.head
# testament_sha1: 8c253d125ee3216224f3336db7039f0b889dbc74
# timestamp: 2009-01-28 13:02:48 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-28 00:58:55 +0000
@@ -1025,6 +1025,83 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq t
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (if (and
+ ;; Fail to fetch a key
+ (not (setq key
+ ;; Does name have any key ?
+ (and (epg-list-keys context name key-type)
+ (or (and (not mml2015-verbose)
+ (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (mml2015-epg-find-usable-key
+ (mml2015-epg-prompt-select-keys context name usage)
+ usage)
+ ;; Avoid error if the user don't select a
+ ;; key because epa-select-keys returns nil
+ t))))
+ ;; No key, ask to abord
+ (y-or-n-p
+ (format
+ "No %s key for %s; abort? "
+ key-type-name name)))
+ (error "No %s key for %s: aborted" key-type-name name))
+ key)
+ names))))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,35 +1259,20 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
- signer-key
- (signers
- (or (message-options-get 'mml2015-epg-signers)
+ (config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
+ (signer
+ (or (message-options-get 'mml2015-epg-signer)
(message-options-set
- 'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ 'mml2015-epg-signer
+ (mml2015-epg-choose-keys context sender 'sign))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
- (epg-context-set-signers context signers)
+ (epg-context-set-signers context signer)
(if mml2015-cache-passphrase
(epg-context-set-passphrase-callback
context
@@ -1249,75 +1311,34 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
(recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key signer-key)
+ cipher signer
+ (boundary (mml-compute-boundary cont)))
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
- (if mml2015-verbose
- (setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
- (setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
- (unless recipients
- (error "No recipient specified")))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients sender)))
+ (setq recipients
+ (mml2015-epg-choose-keys context recipients 'encrypt))
+ (unless recipients
+ (error "No recipient specified"))
(message-options-set 'mml2015-epg-recipients recipients))
(when sign
- (setq signers
- (or (message-options-get 'mml2015-epg-signers)
+ (setq signer
+ (or (message-options-get 'mml2015-epg-signer)
(message-options-set
- 'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
- (epg-context-set-signers context signers))
+ 'mml2015-epg-signer
+ (mml2015-epg-choose-keys context sender 'sign))))
+ (epg-context-set-signers context signer))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
(if mml2015-cache-passphrase
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Remove useless variables
2009-01-28 12:02 ` [PATCH] Remove useless variables Daniel Dehennin
@ 2009-04-13 20:33 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:33 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 376 bytes --]
------------------------------------------------------------
revno: 142
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:49:22 +0200
message:
Remove useless variables
* lisp/mml2015.el (mml2015-epg-sign): Remove variable signer-key.
(mml2015-epg-encrypt): Remove variables signer-key and recipient-key.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-142.patch --]
[-- Type: text/x-patch, Size: 7884 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413184922-\
# ctebq2id4u22jc1q
# target_branch: ../../gnus.head
# testament_sha1: 8e08acbed0400aaf7c3737f2f3f434ae19dd8345
# timestamp: 2009-04-13 21:05:47 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:49:22 +0000
@@ -1025,6 +1025,83 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq t
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (if (and
+ ;; Fail to fetch a key
+ (not (setq key
+ ;; Does name have any key ?
+ (and (epg-list-keys context name key-type)
+ (or (and (not mml2015-verbose)
+ (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (mml2015-epg-find-usable-key
+ (mml2015-epg-prompt-select-keys context name usage)
+ usage)
+ ;; Avoid error if the user don't select a
+ ;; key because epa-select-keys returns nil
+ t))))
+ ;; No key, ask to abord
+ (y-or-n-p
+ (format
+ "No %s key for %s; abort? "
+ key-type-name name)))
+ (error "No %s key for %s: aborted" key-type-name name))
+ key)
+ names))))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,31 +1259,15 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
- signer-key
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1246,77 +1307,35 @@
(goto-char (point-max))))
(defun mml2015-epg-encrypt (cont &optional sign)
- (let ((inhibit-redisplay t)
- (context (epg-make-context))
- (config (epg-configuration))
- (recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key signer-key)
+ (let* ((inhibit-redisplay t)
+ (context (epg-make-context))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
+ (recipients (message-options-get 'mml2015-epg-recipients))
+ cipher signers
+ (boundary (mml-compute-boundary cont)))
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
- (if mml2015-verbose
- (setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
- (setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
- (unless recipients
- (error "No recipient specified")))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
+ (setq recipients
+ (mml2015-epg-choose-keys context recipients 'encrypt))
+ (unless recipients
+ (error "No recipient specified"))
(message-options-set 'mml2015-epg-recipients recipients))
(when sign
(setq signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Permit to select a key if more than one match a mail address.
2009-01-28 11:57 ` Daniel Dehennin
` (8 preceding siblings ...)
2009-01-28 12:02 ` [PATCH] Remove useless variables Daniel Dehennin
@ 2009-01-28 12:03 ` Daniel Dehennin
2009-04-13 20:33 ` Daniel Dehennin
2009-04-13 20:31 ` mml2015-epg-sign do not use from header Daniel Dehennin
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-01-28 12:03 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 471 bytes --]
------------------------------------------------------------
revno: 123
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: gnus.mml2015
timestamp: Wed 2009-01-28 02:09:27 +0100
message:
Permit to select a key if more than one match a mail address.
* lisp/mml2015.el (mml2015-epg-prompt-if-mutli-keys): New variable.
(mml2015-epg-choose-keys): If a name has more than one key and if the
user want it, prompt to select the one to use.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus123.patch --]
[-- Type: text/x-patch, Size: 8650 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090128010927-\
# 26t6dicbleuq378h
# target_branch: ../../gnus.head
# testament_sha1: 8f60d6ad2c8071a47704d48d5223b7dad88f9dcd
# timestamp: 2009-01-28 13:02:57 +0100
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090126152327-\
# ccpvwbbxys1zto9f
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-01-28 01:09:27 +0000
@@ -990,6 +990,11 @@
(defvar mml2015-epg-secret-key-id-list nil)
+(defvar mml2015-epg-prompt-if-mutli-keys t
+ "If t, the default, and there is more than one key to sign or encrypt a
+message, call mml2015-epg-prompt-select-key to select which one to choose.
+If nil, do not prompt for a key, usually, the first one will be used.")
+
(defun mml2015-epg-passphrase-callback (context key-id ignore)
(if (eq key-id 'SYM)
(epg-passphrase-callback-function context key-id nil)
@@ -1025,6 +1030,87 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq t
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (if (and
+ ;; Fail to fetch a key
+ (not (setq key
+ ;; Does name have any key ?
+ (and (epg-list-keys context name key-type)
+ (or (and (not mml2015-verbose)
+ ;; prompt if more than one key ?
+ (or (= 1
+ (length (epg-list-keys context name key-type)))
+ (not mml2015-epg-prompt-if-multi-keys))
+ (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (mml2015-epg-find-usable-key
+ (mml2015-epg-prompt-select-keys context name usage)
+ usage)
+ ;; Avoid error if the user don't select a
+ ;; key because epa-select-keys returns nil
+ t))))
+ ;; No key, ask to abord
+ (y-or-n-p
+ (format
+ "No %s key for %s; abort? "
+ key-type-name name)))
+ (error "No %s key for %s: aborted" key-type-name name))
+ key)
+ names))))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,35 +1268,20 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
- signer-key
- (signers
- (or (message-options-get 'mml2015-epg-signers)
+ (config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
+ (signer
+ (or (message-options-get 'mml2015-epg-signer)
(message-options-set
- 'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ 'mml2015-epg-signer
+ (mml2015-epg-choose-keys context sender 'sign))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
- (epg-context-set-signers context signers)
+ (epg-context-set-signers context signer)
(if mml2015-cache-passphrase
(epg-context-set-passphrase-callback
context
@@ -1249,75 +1320,34 @@
(let ((inhibit-redisplay t)
(context (epg-make-context))
(config (epg-configuration))
+ (sender (list (car
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender)))))
(recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key signer-key)
+ cipher signer
+ (boundary (mml-compute-boundary cont)))
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
- (if mml2015-verbose
- (setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
- (setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
- (unless recipients
- (error "No recipient specified")))
+ (unless sender
+ (error "Message sender not set"))
+ (setq recipients (nconc recipients sender)))
+ (setq recipients
+ (mml2015-epg-choose-keys context recipients 'encrypt))
+ (unless recipients
+ (error "No recipient specified"))
(message-options-set 'mml2015-epg-recipients recipients))
(when sign
- (setq signers
- (or (message-options-get 'mml2015-epg-signers)
+ (setq signer
+ (or (message-options-get 'mml2015-epg-signer)
(message-options-set
- 'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
- (epg-context-set-signers context signers))
+ 'mml2015-epg-signer
+ (mml2015-epg-choose-keys context sender 'sign))))
+ (epg-context-set-signers context signer))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
(if mml2015-cache-passphrase
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH] Permit to select a key if more than one match a mail address.
2009-01-28 12:03 ` [PATCH] Permit to select a key if more than one match a mail address Daniel Dehennin
@ 2009-04-13 20:33 ` Daniel Dehennin
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:33 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 466 bytes --]
------------------------------------------------------------
revno: 143
committer: Daniel Dehennin <daniel.dehennin@baby-gnu.org>
branch nick: mml2015
timestamp: Mon 2009-04-13 20:50:33 +0200
message:
Permit to select a key if more than one match a mail address.
* lisp/mml2015.el (mml2015-epg-prompt-if-mutli-keys): New variable.
(mml2015-epg-choose-keys): If a name has more than one key and if the
user want it, prompt to select the one to use.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Gnus-mm2015-143.patch --]
[-- Type: text/x-patch, Size: 8549 bytes --]
# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: daniel.dehennin@baby-gnu.org-20090413185033-\
# h1lmms72gr14teu8
# target_branch: ../../gnus.head
# testament_sha1: 6b25a12c4b5fc431faafe4a2c181a59b13f2ec3b
# timestamp: 2009-04-13 21:06:10 +0200
# source_branch: .
# base_revision_id: daniel.dehennin@baby-gnu.org-20090412231027-\
# rhtvglq3r87nljez
#
# Begin patch
=== modified file 'lisp/mml2015.el'
--- lisp/mml2015.el 2009-01-22 07:02:15 +0000
+++ lisp/mml2015.el 2009-04-13 18:50:33 +0000
@@ -990,6 +990,11 @@
(defvar mml2015-epg-secret-key-id-list nil)
+(defvar mml2015-epg-prompt-if-mutli-keys t
+ "If t, the default, and there is more than one key to sign or encrypt a
+message, call mml2015-epg-prompt-select-key to select which one to choose.
+If nil, do not prompt for a key, usually, the first one will be used.")
+
(defun mml2015-epg-passphrase-callback (context key-id ignore)
(if (eq key-id 'SYM)
(epg-passphrase-callback-function context key-id nil)
@@ -1025,6 +1030,87 @@
(setq pointer (cdr pointer))))
(setq keys (cdr keys)))))
+(defun mml2015-epg-split-addresses (config addresses)
+ "Split a string of addresses delimited by [ \f\t\n\r\v,]+."
+ (apply #'nconc
+ (mapcar
+ (lambda (recipient)
+ (or (epg-expand-group config recipient)
+ (list (concat "<" recipient ">"))))
+ (split-string
+ (or addresses
+ (read-string "Addresses: "))
+ "[ \f\t\n\r\v,]+"))))
+
+(defun mml2015-epg-prompt-select-keys (context &optional names usage)
+ "Return a key matching NAME.
+USAGE is nil or encrypt to search private keyring.
+USAGE is t or sign to search secret keyring.
+Mostly a wrapper around epa-select-keys."
+ (let ((action (cond
+ ((memq usage '(t sign)) "signing")
+ ((memq usage '(nil encrypt)) "encryption")
+ (t "encryption")))
+ (key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (no-selection (cond
+ ((memq usage '(t sign)) "default secret key is used")
+ ((memq usage '(nil encrypt)) "symmetric encryption will be performed")
+ (t "symmetric encryption will be performed"))))
+ (epa-select-keys context
+ (format "\
+Select a key for %s.
+If no one is selected, %s
+If more than one is select, first one is used. "
+ action no-selection)
+ names key-type)))
+
+(defun mml2015-epg-choose-keys (context &optional names usage)
+"Return a list of keys for each NAMES matching USAGE."
+ (let ((key-type (cond
+ ((memq usage '(t sign)) 'secret)
+ ((memq usage '(nil encrypt)) 'public)
+ (t 'public)))
+ (key-type-name (cond
+ ((memq usage '(t sign)) "secret")
+ ((memq usage '(nil encrypt)) "public")
+ (t "public")))
+ key)
+ (if names
+ (delq t
+ (delq nil
+ (mapcar
+ (lambda (name)
+ (if (and
+ ;; Fail to fetch a key
+ (not (setq key
+ ;; Does name have any key ?
+ (and (epg-list-keys context name key-type)
+ (or (and (not mml2015-verbose)
+ ;; prompt if more than one key ?
+ (or (= 1
+ (length (epg-list-keys context name key-type)))
+ (not mml2015-epg-prompt-if-multi-keys))
+ (mml2015-epg-find-usable-key
+ (epg-list-keys context name key-type)
+ usage))
+ (mml2015-epg-find-usable-key
+ (mml2015-epg-prompt-select-keys context name usage)
+ usage)
+ ;; Avoid error if the user don't select a
+ ;; key because epa-select-keys returns nil
+ t))))
+ ;; No key, ask to abord
+ (y-or-n-p
+ (format
+ "No %s key for %s; abort? "
+ key-type-name name)))
+ (error "No %s key for %s: aborted" key-type-name name))
+ key)
+ names))))))
+
(defun mml2015-epg-decrypt (handle ctl)
(catch 'error
(let ((inhibit-redisplay t)
@@ -1182,31 +1268,15 @@
(let* ((inhibit-redisplay t)
(context (epg-make-context))
(boundary (mml-compute-boundary cont))
- signer-key
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
(signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1246,77 +1316,35 @@
(goto-char (point-max))))
(defun mml2015-epg-encrypt (cont &optional sign)
- (let ((inhibit-redisplay t)
- (context (epg-make-context))
- (config (epg-configuration))
- (recipients (message-options-get 'mml2015-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key signer-key)
+ (let* ((inhibit-redisplay t)
+ (context (epg-make-context))
+ (config (epg-configuration))
+ (sender (car (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-sender))))
+ (recipients (message-options-get 'mml2015-epg-recipients))
+ cipher signers
+ (boundary (mml-compute-boundary cont)))
(unless recipients
(setq recipients
- (apply #'nconc
- (mapcar
- (lambda (recipient)
- (or (epg-expand-group config recipient)
- (list (concat "<" recipient ">"))))
- (split-string
- (or (message-options-get 'message-recipients)
- (message-options-set 'message-recipients
- (read-string "Recipients: ")))
- "[ \f\t\n\r\v,]+"))))
+ (mml2015-epg-split-addresses
+ config
+ (message-options-get 'message-recipients)))
(when mml2015-encrypt-to-self
- (unless mml2015-signers
- (error "mml2015-signers not set"))
- (setq recipients (nconc recipients mml2015-signers)))
- (if mml2015-verbose
- (setq recipients
- (epa-select-keys context "\
-Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed. "
- recipients))
- (setq recipients
- (delq nil
- (mapcar
- (lambda (recipient)
- (setq recipient-key (mml2015-epg-find-usable-key
- (epg-list-keys context recipient)
- 'encrypt))
- (unless (or recipient-key
- (y-or-n-p
- (format "No public key for %s; skip it? "
- recipient)))
- (error "No public key for %s" recipient))
- recipient-key)
- recipients)))
- (unless recipients
- (error "No recipient specified")))
+ (unless (or sender mml2015-signers)
+ (error "Message sender and mml2015-signers not set"))
+ (setq recipients (nconc recipients (cons sender mml2015-signers))))
+ (setq recipients
+ (mml2015-epg-choose-keys context recipients 'encrypt))
+ (unless recipients
+ (error "No recipient specified"))
(message-options-set 'mml2015-epg-recipients recipients))
(when sign
(setq signers
(or (message-options-get 'mml2015-epg-signers)
(message-options-set
'mml2015-epg-signers
- (if mml2015-verbose
- (epa-select-keys context "\
-Select keys for signing.
-If no one is selected, default secret key is used. "
- mml2015-signers t)
- (if mml2015-signers
- (delq nil
- (mapcar
- (lambda (signer)
- (setq signer-key (mml2015-epg-find-usable-key
- (epg-list-keys context signer t)
- 'sign))
- (unless (or signer-key
- (y-or-n-p
- (format
- "No secret key for %s; skip it? "
- signer)))
- (error "No secret key for %s" signer))
- signer-key)
- mml2015-signers)))))))
+ (mml2015-epg-choose-keys context (cons sender mml2015-signers) 'sign))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: mml2015-epg-sign do not use from header
2009-01-28 11:57 ` Daniel Dehennin
` (9 preceding siblings ...)
2009-01-28 12:03 ` [PATCH] Permit to select a key if more than one match a mail address Daniel Dehennin
@ 2009-04-13 20:31 ` Daniel Dehennin
2009-04-13 22:48 ` Daiki Ueno
10 siblings, 1 reply; 53+ messages in thread
From: Daniel Dehennin @ 2009-04-13 20:31 UTC (permalink / raw)
To: ding
Le 5628 Septembre 1993, Daniel Dehennin a envoyé:
> Hello,
>
> After setting up a bzr repository to track my changes, I can provide
> step by step modifications.
>
> The 11 following patches permit to:
> - use from header to sign message
> - factorize some code
> - ask the user about the key to use if more than one match
I take a long time before coming back to this issue, following are a set
of new patch against HEAD which add support for mml2015-signers.
As I don't use mml2015-signers, let me know if it's ok.
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: mml2015-epg-sign do not use from header
2009-04-13 20:31 ` mml2015-epg-sign do not use from header Daniel Dehennin
@ 2009-04-13 22:48 ` Daiki Ueno
0 siblings, 0 replies; 53+ messages in thread
From: Daiki Ueno @ 2009-04-13 22:48 UTC (permalink / raw)
To: Daniel Dehennin; +Cc: ding
>>>>> In <87ljq4gury.fsf@hati.baby-gnu.org>
>>>>> Daniel Dehennin <daniel.dehennin@baby-gnu.org> wrote:
> I take a long time before coming back to this issue, following are a set
> of new patch against HEAD which add support for mml2015-signers.
Thanks, but I personally say that you have gone too far.
> As I don't use mml2015-signers, let me know if it's ok.
Please try it by yourself--I meant in the previous mail that if you
appended message-sender to mml2015-signers properly, the rest of your
patches would make little sense (from the user's perspective) because
there is already proper handling of mml2015-signers.
Summary:
* Gnus-mm2015-134.patch, Gnus-mm2015-135.patch:
Worth being installed with a little modification (to uniquify the
elements of mml2015-signers, to enclose the message-sender with angle
brackets to let GnuPG understand it is an emal address, etc.)
* Gnus-mm2015-137.patch, Gnus-mm2015-138.patch, Gnus-mm2015-140.patch,
Gnus-mm2015-141.patch:
We don't want them right now.
Regards,
--
Daiki Ueno
^ permalink raw reply [flat|nested] 53+ messages in thread