gpg: Allow creating a cert-only primary key.
authorWerner Koch <wk@gnupg.org>
Fri, 3 Oct 2014 13:05:47 +0000 (15:05 +0200)
committerWerner Koch <wk@gnupg.org>
Fri, 3 Oct 2014 13:05:47 +0000 (15:05 +0200)
* g10/keygen.c (ask_key_flags): Allow a 'c' in direct entry.
--

GnuPG-bug-id: 1726

g10/keygen.c

index 17d7ce1..229f2bf 100644 (file)
@@ -1718,6 +1718,13 @@ ask_key_flags(int algo,int subkey)
                 current |= PUBKEY_USAGE_ENC;
               else if ((*s == 'a' || *s == 'A') && (possible&PUBKEY_USAGE_AUTH))
                 current |= PUBKEY_USAGE_AUTH;
+              else if (!subkey && *s == 'c')
+                {
+                  /* Accept 'c' for the primary key because USAGE_CERT
+                     will will be set anyway.  This is for folks who
+                     want to experiment with a cert-only primary key.  */
+                  current |= PUBKEY_USAGE_CERT;
+                }
             }
           break;
         }