unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, stepnem@gmail.com, 40118@debbugs.gnu.org,
	boudiccas@skimble.plus.com
Subject: bug#40118: 27.0.90; Signing emails with gpg
Date: Thu, 16 Apr 2020 12:38:13 +0200	[thread overview]
Message-ID: <m2wo6fiulm.fsf@gmail.com> (raw)
In-Reply-To: <83pnc7enyx.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 16 Apr 2020 13:15:02 +0300")

>>>>> On Thu, 16 Apr 2020 13:15:02 +0300, Eli Zaretskii <eliz@gnu.org> said:

    >> From: Robert Pluim <rpluim@gmail.com>
    >> Cc: stepnem@gmail.com,  40118@debbugs.gnu.org,  boudiccas@skimble.plus.com
    >> Date: Thu, 16 Apr 2020 11:44:51 +0200
    >> 
    >> In emacs-26, mml-secure-epg-sign could specify that a message should
    >> be signed with a key based on the senderʼs email address. If the
    >> variable governing that was nil, it was left to gpg to figure out the
    >> key to use. Normally that means gpg uses its default key.
    >> 
    >> In emacs-27, mml-secure-epg-sign now checks explicitly whether that
    >> variable is nil, and refuses to continue.

    Eli> Why was this change in behavior made in Emacs 27?

I donʼt know. Lars? (and why only for signing and not encrypting?)

    commit 9c81149ae9165b0f017d60d141221b340879baef
    Author: Lars Ingebrigtsen <larsi@gnus.org>
    Date:   Wed Oct 9 21:55:41 2019 +0200

        Make mml-secure-epg-sign bug out if we can't find an identity

        * lisp/gnus/mml-sec.el (mml-secure-epg-sign): Bug out if we
        couldn't find anything to sign with instead of silently pretending
        to sign.

    >> With an error message that in at least 50% of the cases points the
    >> user to the wrong user option. This is a regression from emacs-26.
    >> 
    >> Fixing the error message is easy. Iʼm proposing that by default the
    >> senderʼs email address is used to determine the key to use, since
    >> thatʼs what almost everyone will want. People who donʼt want that can
    >> control the behaviour by either adding keys to
    >> 'mml-secure-openpgp-signers' or by setting 'mm-sign-option' to
    >> 'guided.

    Eli> I'd prefer to have a behavior that didn't require any changes, if
    Eli> possible.  Thus the above question.  If having a compatible behavior
    Eli> is impractical, then let's discuss what would the lesser evil.

setting mml-secure-smime-sign-with-sender and
mml-secure-openpgp-sign-with-sender to t gets us back to the previous
behaviour in the default case. People that didnʼt want that behaviour
would already have set mml-secure-openpgp-signers and/or
mm-sign-option.

Actually, setting those two options to t would result in a behaviour
change for people who use mml-secure-{openpgp,smime}-signers to select a
signing key thatʼs not the same as the one for the sender. I think
those people fall in the 'know what theyʼre doing' category, and they
can set them back to nil.

I think the absolute minimum we should do for emacs-27 is this:

diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 740e1d2b72..395c1e8253 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -946,12 +946,14 @@ mml-secure-epg-sign
 	 signature micalg)
     (unless signers
       (let ((maybe-msg
-             (if mml-secure-smime-sign-with-sender
+             (if (or mml-secure-smime-sign-with-sender
+                     mml-secure-openpgp-sign-with-sender)
                  "."
-               "; try setting `mml-secure-smime-sign-with-sender'.")))
-        ;; If `mml-secure-smime-sign-with-sender' is already non-nil
-        ;; then there's no point advising the user to examine it.  If
-        ;; there are any other variables worth examining, please
+               "; try setting `mml-secure-smime-sign-with-sender' or 'mml-secure-openpgp-sign-with-sender'.")))
+        ;; If `mml-secure-smime-sign-with-sender' or
+        ;; `mml-secure-openpgp-sign-with-sender' are already non-nil
+        ;; then there's no point advising the user to examine them.
+        ;; If there are any other variables worth examining, please
         ;; improve this error message by having it mention them.
         (error "Couldn't find any signer names%s" maybe-msg)))
     (when (eq 'OpenPGP protocol)





  reply	other threads:[~2020-04-16 10:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 14:51 bug#40118: 27.0.90; Signing emails with gpg Sharon Kimble
2020-04-14 11:10 ` Štěpán Němec
2020-04-15 16:37   ` Robert Pluim
2020-04-15 16:45     ` Eli Zaretskii
2020-04-16  9:44       ` Robert Pluim
2020-04-16 10:15         ` Eli Zaretskii
2020-04-16 10:38           ` Robert Pluim [this message]
2020-04-17 15:11             ` Robert Pluim
2020-04-20 10:52               ` Robert Pluim
2020-04-20 16:24                 ` Eli Zaretskii
2020-04-20 16:58                   ` Robert Pluim
2020-04-30  4:33             ` Lars Ingebrigtsen
2020-04-30  7:37               ` Robert Pluim
2020-04-30 22:03                 ` Lars Ingebrigtsen
2020-05-05 12:46                   ` Robert Pluim
2020-05-05 15:06                     ` Eli Zaretskii
2020-05-05 15:23                       ` Robert Pluim
2020-05-05 16:07                         ` Eli Zaretskii
2020-09-30 14:57                         ` Lars Ingebrigtsen
2020-09-30 16:44                           ` Robert Pluim
2020-10-01  0:16                             ` Lars Ingebrigtsen
2020-10-01 17:41                               ` Robert Pluim
2020-10-01 17:43                                 ` Lars Ingebrigtsen
2020-10-02  8:49                                   ` Robert Pluim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2wo6fiulm.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=40118@debbugs.gnu.org \
    --cc=boudiccas@skimble.plus.com \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=stepnem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).