ssh: Simplify the curve name lookup. master
authorWerner Koch <wk@gnupg.org>
Thu, 17 Jan 2019 14:42:33 +0000 (15:42 +0100)
committerWerner Koch <wk@gnupg.org>
Thu, 17 Jan 2019 14:58:30 +0000 (15:58 +0100)
commitd93797c8a7892fe26672c551017468e9f8099ef6
tree829c23a93e51abadcc1c87d6a073b2f0df349977
parentdafffa95b2317bcb80fff1fd6d2bc7b4e6b1e206
ssh: Simplify the curve name lookup.

* agent/command-ssh.c (struct ssh_key_type_spec): Add field
alt_curve_name.
(ssh_key_types): Add some alternate curve names.
(ssh_identifier_from_curve_name): Lookup also bey alternative names
and return the canonical name.
(ssh_key_to_blob): Simplify the ECDSA case by using gcry_pk_get_curve
instead of the explicit mapping.
(ssh_receive_key): Likewise.  Use ssh_identifier_from_curve_name to
validate the curve name.  Remove the reverse mapping because since
GnuPG-2.2 Libgcrypt 1.7 is required.
(ssh_handler_request_identities): Log an error message.
--

This change will make it easier to support other curves, in particular
those from tokens.  Libgcrypt has a large list of alias names which we
now use to to make the mapping more flexible.

Signed-off-by: Werner Koch <wk@gnupg.org>
agent/command-ssh.c