summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-10-03 15:05:47 +0200
committerWerner Koch <wk@gnupg.org>2014-10-03 15:05:47 +0200
commitbc8583f247898a1fa45f6de834d34b335ab1952c (patch)
treea92bdd94e195a19f1f5cbd531151ddc9e5669c85
parentSome doc fixes and a fix for "make distcheck". (diff)
downloadgnupg2-bc8583f247898a1fa45f6de834d34b335ab1952c.tar.xz
gnupg2-bc8583f247898a1fa45f6de834d34b335ab1952c.zip
gpg: Allow creating a cert-only primary key.
* g10/keygen.c (ask_key_flags): Allow a 'c' in direct entry. -- GnuPG-bug-id: 1726
-rw-r--r--g10/keygen.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index 17d7ce121..229f2bfed 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -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;
}