From 09055aa0f7993aaf4dcffdd80d8192945ae6080a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 7 May 2014 13:39:28 +0200 Subject: [PATCH] gpg: Mark experimental algorithms in the key listing. * g10/keylist.c (list_keyblock_print): Remove duplicate curve name. Print a note for experimental algorithms. * g10/misc.c (print_pubkey_algo_note): Fix warning message. --- g10/keylist.c | 16 ++++------------ g10/misc.c | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/g10/keylist.c b/g10/keylist.c index 71f72e233..1ecfce998 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -1,6 +1,7 @@ /* keylist.c - Print information about OpenPGP keys * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, * 2008, 2010, 2012 Free Software Foundation, Inc. + * Copyright (C) 2013, 2014 Werner Koch * * This file is part of GnuPG. * @@ -822,18 +823,6 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, void *opaque) pubkey_string (pk, pkstrbuf, sizeof pkstrbuf), keystr_from_pk (pk), datestr_from_pk (pk)); - if (pk->pubkey_algo == PUBKEY_ALGO_ECDSA - || pk->pubkey_algo == PUBKEY_ALGO_EDDSA - || pk->pubkey_algo == PUBKEY_ALGO_ECDH) - { - char *curve = openpgp_oid_to_str (pk->pkey[0]); - const char *name = openpgp_oid_to_curve (curve); - if (!*name || *name == '?') - name = curve; - es_fprintf (es_stdout, " %s", name); - xfree (curve); - } - if (pk->flags.revoked) { es_fprintf (es_stdout, " ["); @@ -863,6 +852,9 @@ list_keyblock_print (KBNODE keyblock, int secret, int fpr, void *opaque) } #endif + if (pk->pubkey_algo >= 100) + es_fprintf (es_stdout, " [experimental algorithm %d]", pk->pubkey_algo); + es_fprintf (es_stdout, "\n"); if (fpr) diff --git a/g10/misc.c b/g10/misc.c index 77928aa6c..54ddad2d2 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -299,10 +299,10 @@ print_pubkey_algo_note (pubkey_algo_t algo) { warn=1; log_info (_("WARNING: using experimental public key algorithm %s\n"), - openpgp_cipher_algo_name (algo)); + openpgp_pk_algo_name (algo)); } } - else if (algo == 20) + else if (algo == PUBKEY_ALGO_ELGAMAL) { log_info (_("WARNING: Elgamal sign+encrypt keys are deprecated\n")); }