diff options
author | Werner Koch <[email protected]> | 2014-02-05 09:37:59 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-02-05 09:37:59 +0000 |
commit | 2c814806d759e5cf611200e8210137cf8502a672 (patch) | |
tree | 1622ede2fc1375c9489031b8d5e598d3e6d8bcc8 /common/openpgp-oid.c | |
parent | gpg: Add configure options to disable algorithms (diff) | |
download | gnupg-2c814806d759e5cf611200e8210137cf8502a672.tar.gz gnupg-2c814806d759e5cf611200e8210137cf8502a672.zip |
gpg: Change format for the key size in --list-key and --edit-key.
* g10/gpg.c (oLegacyListMode, opts, main): Add --legacy-list-mode.
* g10/options.h (struct opt): Add field legacy_list_mode.
* g10/keydb.h (PUBKEY_STRING_SIZE): New.
* g10/keyid.c (pubkey_string): New.
* g10/import.c (import_one, import_secret_one): Use pubkey_string.
* g10/keylist.c (print_seckey_info): Ditto.
(print_pubkey_info, print_card_key_info): Ditto.
(list_keyblock_print): Ditto.
* g10/mainproc.c (list_node): Ditto.
* g10/pkclist.c (do_edit_ownertrust, build_pk_list): Ditto.
* g10/keyedit.c (show_key_with_all_names): Ditto. Also change the
format.
(show_basic_key_info): Ditto.
* common/openpgp-oid.c (openpgp_curve_to_oid): Also allow "ed25519".
(openpgp_oid_to_curve): Downcase "ed25519"
--
For ECC it seems to be better to show the name of the curve and not
just the size of the prime field. The curve name does not anymore fit
into the "<size><letter>" descriptor (e.g. "2048R") and a fixed length
format does not work either. Thus the new format uses
"rsa2048" - RSA with 2048 bit
"elg1024" - Elgamal with 1024 bit
"ed25519" - ECC using the curve Ed25519.
"E_1.2.3.4" - ECC using the unsupported curve with OID "1.2.3.4".
unless --legacy-list-mode is given. In does not anymore line up
nicely in columns thus I expect further changes to this new format.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/openpgp-oid.c')
-rw-r--r-- | common/openpgp-oid.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/common/openpgp-oid.c b/common/openpgp-oid.c index 28567b7fe..a2a3617b6 100644 --- a/common/openpgp-oid.c +++ b/common/openpgp-oid.c @@ -275,7 +275,7 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits) if (!name) oidstr = NULL; - else if (!strcmp (name, "Ed25519")) + else if (!strcmp (name, "Ed25519") || !strcmp (name, "ed25519")) { oidstr = "1.3.6.1.4.1.11591.15.1"; nbits = 255; @@ -324,8 +324,7 @@ openpgp_curve_to_oid (const char *name, unsigned int *r_nbits) } -/* Map an OpenPGP OID to the Libgcrypt curve NAME. If R_NBITS is not - NULL store the bit size of the curve there. Returns "?" for +/* Map an OpenPGP OID to the Libgcrypt curve NAME. Returns "?" for unknown curve names. */ const char * openpgp_oid_to_curve (const char *oid) @@ -335,7 +334,7 @@ openpgp_oid_to_curve (const char *oid) if (!oid) name = ""; else if (!strcmp (oid, "1.3.6.1.4.1.11591.15.1")) - name = "Ed25519"; + name = "ed25519"; else if (!strcmp (oid, "1.2.840.10045.3.1.7")) name = "nistp256"; else if (!strcmp (oid, "1.3.132.0.10")) |