aboutsummaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-11-27 13:53:34 +0000
committerDavid Shaw <[email protected]>2003-11-27 13:53:34 +0000
commit973c868961233686b4072c56f641ec70ba27f783 (patch)
tree12e4bd901ba10bc7bf27d989bcb234c4e5af1c99 /g10/getkey.c
parent* configure.ac: Use MSG_NOTICE instead of MSG_WARN for less serious (diff)
downloadgnupg-973c868961233686b4072c56f641ec70ba27f783.tar.gz
gnupg-973c868961233686b4072c56f641ec70ba27f783.zip
* keygen.c (ask_algo): Remove ability to generate Elgamal sign+encrypt
keys. * getkey.c (merge_selfsigs_main, merge_selfsigs_subkey): Disallow use of sign+encrypt Elgamal keys.
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 72b80ba76..d1be8e51e 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1677,6 +1677,11 @@ merge_selfsigs_main( KBNODE keyblock, int *r_revoked )
if ( x ) /* mask it down to the actual allowed usage */
key_usage &= x;
}
+
+ /* Type 20 Elgamal keys are not usable. */
+ if(pk->pubkey_algo==PUBKEY_ALGO_ELGAMAL)
+ key_usage=0;
+
pk->pubkey_usage = key_usage;
if ( !key_expire_seen ) {
@@ -1893,6 +1898,13 @@ merge_selfsigs_subkey( KBNODE keyblock, KBNODE subnode )
if ( x ) /* mask it down to the actual allowed usage */
key_usage &= x;
}
+
+ /* Type 20 Elgamal subkeys or any subkey on a type 20 primary are
+ not usable. */
+ if(mainpk->pubkey_algo==PUBKEY_ALGO_ELGAMAL
+ || subpk->pubkey_algo==PUBKEY_ALGO_ELGAMAL)
+ key_usage=0;
+
subpk->pubkey_usage = key_usage;
p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL);