[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.0-2-g7089dcc

by Werner Koch cvs at cvs.gnupg.org
Mon Sep 11 11:33:07 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, STABLE-BRANCH-2-2 has been updated
       via  7089dcc54099a4909ce7d386c07ab87e1398e2eb (commit)
      from  9e3d41bf727fcf12f7cf05926890c687125c2902 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7089dcc54099a4909ce7d386c07ab87e1398e2eb
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Sep 11 11:29:13 2017 +0200

    gpg: Fix key generation with only an email part.
    
    * g10/keygen.c (proc_parameter_file): Special case the email only
    case.
    --
    
    Using a parameter file like
    
      %ask-passphrase
      key-type:      RSA
      key-length:    2048
      key-usage:     sign
      subkey-type:   RSA
      subkey-length: 2048
      subkey-usage:  encrypt
      name-email:    foo at example.org
    
    with "gpg --gen-key --patch" the result was this key
    
      pub   rsa2048 2017-09-11 [SC]
            63A8C1BA12CC289A0E8072C971C7F8D4A18CE0BE
      uid           [ultimate]  <foo at example.org>
      sub   rsa2048 2017-09-11 [E]
    
    At least the the extra leading space the left angle bracket is wrong.
    Further some mail providers reject keys which consist of more than
    just a plain mail address.  Using just a mail address is anyway the
    new new suggested content for a user id.  With this patch the key
    will be
    
      pub   rsa2048 2017-09-11 [SC]
            B302343C20EA6DECDB6A155135352F2520397080
      uid           [ultimate] foo at example.org
      sub   rsa2048 2017-09-11 [E]
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/g10/keygen.c b/g10/keygen.c
index 6a3d323..08bc621 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -3530,7 +3530,14 @@ proc_parameter_file (ctrl_t ctrl, struct para_data_s *para, const char *fname,
 	  if( s2 )
 	    p = stpcpy(stpcpy(stpcpy(p," ("), s2 ),")");
 	  if( s3 )
-	    p = stpcpy(stpcpy(stpcpy(p," <"), s3 ),">");
+            {
+              /* If we have only the email part, do not add the space
+               * and the angle brackets.  */
+              if (*p)
+                p = stpcpy(stpcpy(stpcpy(p," <"), s3 ),">");
+              else
+                p = stpcpy (p, s3);
+            }
           append_to_parameter (para, r);
 	  have_user_id=1;
 	}

-----------------------------------------------------------------------

Summary of changes:
 g10/keygen.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list