[svn] GnuPG - r4653 - in trunk: . g10
svn author wk
cvs at cvs.gnupg.org
Wed Dec 12 18:41:06 CET 2007
Author: wk
Date: 2007-12-12 18:41:05 +0100 (Wed, 12 Dec 2007)
New Revision: 4653
Modified:
trunk/NEWS
trunk/g10/ChangeLog
trunk/g10/misc.c
Log:
Allow type 20 keys only with option --rfc2440.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2007-12-12 16:47:52 UTC (rev 4652)
+++ trunk/NEWS 2007-12-12 17:41:05 UTC (rev 4653)
@@ -14,7 +14,8 @@
* The envvars XAUTHORITY and PINENTRY_USER_DATA are now passed to the
pinentry.
- * Allow encryption using Elgamal keys with the algorithm id 20.
+ * Allow encryption with legacy Elgamal sign+encrypt keys with option
+ --rfc2440.
* Fixed the auto creation of the key stub for smartcards.
Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog 2007-12-12 16:47:52 UTC (rev 4652)
+++ trunk/g10/ChangeLog 2007-12-12 17:41:05 UTC (rev 4653)
@@ -1,3 +1,10 @@
+2007-12-12 Werner Koch <wk at g10code.com>
+
+ * misc.c (print_pubkey_algo_note): Print a warning if a type 20
+ key is used.
+ (openpgp_pk_test_algo, openpgp_pk_test_algo2)
+ (openpgp_pk_algo_usage): Allow type 20 keys only in rfc2440 mode.
+
2007-12-12 David Shaw <dshaw at jabberwocky.com> (wk)
* trustdb.c (sanitize_regexp): New. Protect against dangerous
Modified: trunk/g10/misc.c
===================================================================
--- trunk/g10/misc.c 2007-12-12 16:47:52 UTC (rev 4652)
+++ trunk/g10/misc.c 2007-12-12 17:41:05 UTC (rev 4653)
@@ -289,6 +289,10 @@
gcry_pk_algo_name (algo));
}
}
+ else if (algo == 20)
+ {
+ log_info (_("WARNING: Elgamal sign+encrypt keys are deprecated\n"));
+ }
}
void
@@ -387,6 +391,10 @@
int
openpgp_pk_test_algo( int algo )
{
+ /* Dont't allow type 20 keys unless in rfc2440 mode. */
+ if (!RFC2440 && algo == 20)
+ return gpg_error (GPG_ERR_PUBKEY_ALGO);
+
if (algo == GCRY_PK_ELG_E)
algo = GCRY_PK_ELG;
@@ -400,6 +408,10 @@
{
size_t use_buf = use;
+ /* Dont't allow type 20 keys unless in rfc2440 mode. */
+ if (!RFC2440 && algo == 20)
+ return gpg_error (GPG_ERR_PUBKEY_ALGO);
+
if (algo == GCRY_PK_ELG_E)
algo = GCRY_PK_ELG;
@@ -427,6 +439,9 @@
use = PUBKEY_USAGE_CERT | PUBKEY_USAGE_SIG;
break;
case PUBKEY_ALGO_ELGAMAL:
+ if (RFC2440)
+ use = PUBKEY_USAGE_ENC;
+ break;
case PUBKEY_ALGO_ELGAMAL_E:
use = PUBKEY_USAGE_ENC;
break;
More information about the Gnupg-commits
mailing list