[PATCH HEAD] a typo in a message

Ineiev ineiev at gnu.org
Fri Oct 7 08:06:42 CEST 2016


On Thu, Oct 06, 2016 at 08:25:04PM +0200, Werner Koch wrote:
> On Thu,  6 Oct 2016 08:43, ineiev at gnu.org said:
> > +        log_info (_("WARNING: Encrypting to %s, "
> > +                    "a key with all user IDs revoked\n"),
> 
> Actually there should be no such message.  Gpg should never allow to
> encrypt to a revoked key.  "Can't encrypted because of a revoked key"
> (or "...due to a key with no valid user ids")

Like this?

diff --git a/g10/tofu.c b/g10/tofu.c
index c100c43..858cde6 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -3052,9 +3052,13 @@ tofu_register_encryption (ctrl_t ctrl,
       free_user_id_list = 1;

       if (! user_id_list)
-        log_info (_("WARNING: Encrypting to %s, which has no"
-                    "non-revoked user ids.\n"),
-                  keystr (pk->keyid));
+        {
+          log_error (_("error encrypting to %s: the key has no "
+                       "usable user IDs.\n"),
+                        keystr (pk->keyid));
+          rc = gpg_error (GPG_ERR_UNUSABLE_PUBKEY);
+          goto die;
+        }
     }

   fingerprint = hexfingerprint (pk, NULL, 0);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: </pipermail/attachments/20161007/c2328cd8/attachment.sig>


More information about the Gnupg-devel mailing list