diff options
author | heinz <heinz@pkgsrc.org> | 2003-11-27 23:46:36 +0000 |
---|---|---|
committer | heinz <heinz@pkgsrc.org> | 2003-11-27 23:46:36 +0000 |
commit | b35693ec32639cbd0e49535dd9fb59a472ae6619 (patch) | |
tree | 18e626198761f045267164d6fdbf7388eeecf014 /security/gnupg/patches | |
parent | 58bee3466217fe9cf85502cc3f0c98d369ab01fa (diff) | |
download | pkgsrc-b35693ec32639cbd0e49535dd9fb59a472ae6619.tar.gz |
Add improved patch for compromised ElGamal signing keys from
gnupg-devel at gnupg org. The old patch didn't completely disable usage
of the compromised keys.
Move the old and new fix to the patches/ directory.
Diffstat (limited to 'security/gnupg/patches')
-rw-r--r-- | security/gnupg/patches/patch-ai | 35 | ||||
-rw-r--r-- | security/gnupg/patches/patch-aj | 43 |
2 files changed, 78 insertions, 0 deletions
diff --git a/security/gnupg/patches/patch-ai b/security/gnupg/patches/patch-ai new file mode 100644 index 00000000000..52deafefc02 --- /dev/null +++ b/security/gnupg/patches/patch-ai @@ -0,0 +1,35 @@ +$NetBSD: patch-ai,v 1.1 2003/11/27 23:46:36 heinz Exp $ + +--- g10/keygen.c.orig Mon Jul 28 20:34:41 2003 ++++ g10/keygen.c +@@ -958,8 +958,6 @@ ask_algo (int addmode, unsigned int *r_u + tty_printf( _(" (%d) DSA (sign only)\n"), 2 ); + if( addmode ) + tty_printf( _(" (%d) ElGamal (encrypt only)\n"), 3 ); +- if (opt.expert) +- tty_printf( _(" (%d) ElGamal (sign and encrypt)\n"), 4 ); + tty_printf( _(" (%d) RSA (sign only)\n"), 5 ); + if (addmode) + tty_printf( _(" (%d) RSA (encrypt only)\n"), 6 ); +@@ -989,21 +987,6 @@ ask_algo (int addmode, unsigned int *r_u + algo = PUBKEY_ALGO_RSA; + *r_usage = PUBKEY_USAGE_SIG; + break; +- } +- else if( algo == 4 && opt.expert) +- { +- tty_printf(_( +-"The use of this algorithm is only supported by GnuPG. You will not be\n" +-"able to use this key to communicate with PGP users. This algorithm is also\n" +-"very slow, and may not be as secure as the other choices.\n")); +- +- if( cpr_get_answer_is_yes("keygen.algo.elg_se", +- _("Create anyway? "))) +- { +- algo = PUBKEY_ALGO_ELGAMAL; +- *r_usage = PUBKEY_USAGE_ENC | PUBKEY_USAGE_SIG; +- break; +- } + } + else if( algo == 3 && addmode ) { + algo = PUBKEY_ALGO_ELGAMAL_E; diff --git a/security/gnupg/patches/patch-aj b/security/gnupg/patches/patch-aj new file mode 100644 index 00000000000..5f26d5ca4e5 --- /dev/null +++ b/security/gnupg/patches/patch-aj @@ -0,0 +1,43 @@ +$NetBSD: patch-aj,v 1.1 2003/11/27 23:46:36 heinz Exp $ + +--- g10/getkey.c.orig Mon Jul 28 20:34:41 2003 ++++ g10/getkey.c +@@ -1049,7 +1049,11 @@ get_seckey_byname2( GETKEY_CTX *retctx, + ctx.items[0].mode = KEYDB_SEARCH_MODE_FIRST; + rc = lookup( &ctx, &kb, 1 ); + if (!rc && sk ) +- sk_from_block ( &ctx, sk, kb ); ++ { ++ sk_from_block ( &ctx, sk, kb ); ++ if(sk->pubkey_algo==PUBKEY_ALGO_ELGAMAL) ++ rc=G10ERR_UNU_SECKEY; ++ } + release_kbnode ( kb ); + get_seckey_end( &ctx ); + } +@@ -1655,6 +1659,11 @@ merge_selfsigs_main( KBNODE keyblock, in + 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 ) { +@@ -1869,6 +1878,13 @@ merge_selfsigs_subkey( KBNODE keyblock, + 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); |