[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] pki crypto: pki_key_ecdsa_name
[Thread Prev] | [Thread Next]
- Subject: [PATCH] pki crypto: pki_key_ecdsa_name
- From: Jon Simons <jon@xxxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 19 Mar 2014 19:52:20 -0700
- To: libssh@xxxxxxxxxx
Hi, Attached is a patch for a getter to retrieve the "ecdsa-sha2-nistpNNN" name of ECDSA keys, beyond just "ssh-ecdsa" made available with 'ssh_key_type_to_char'. -Jon
From 02f7fd33fe1141f9e307495712d793d227fa3a14 Mon Sep 17 00:00:00 2001 From: Jon Simons <jon@xxxxxxxxxxxxx> Date: Tue, 18 Feb 2014 03:54:11 -0800 Subject: [PATCH] pki crypto: pki_key_ecdsa_name Enable retrieving the "ecdsa-sha2-nistpNNN" name of ECDSA keys. Signed-off-by: Jon Simons <jon@xxxxxxxxxxxxx> --- include/libssh/libssh.h | 2 ++ src/pki_crypto.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index 9cd03ce..20b2d24 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -534,6 +534,8 @@ LIBSSH_API int ssh_pki_export_pubkey_base64(const ssh_key key, LIBSSH_API int ssh_pki_export_pubkey_file(const ssh_key key, const char *filename); +LIBSSH_API const char *pki_key_ecdsa_name(const ssh_key key); + LIBSSH_API void ssh_print_hexa(const char *descr, const unsigned char *what, size_t len); LIBSSH_API int ssh_send_ignore (ssh_session session, const char *data); LIBSSH_API int ssh_send_debug (ssh_session session, const char *message, int always_display); diff --git a/src/pki_crypto.c b/src/pki_crypto.c index cbd2c78..0602d69 100644 --- a/src/pki_crypto.c +++ b/src/pki_crypto.c @@ -105,6 +105,11 @@ static const char *pki_key_ecdsa_nid_to_name(int nid) return "unknown"; } +const char *pki_key_ecdsa_name(const ssh_key key) +{ + return pki_key_ecdsa_nid_to_name(key->ecdsa_nid); +} + static const char *pki_key_ecdsa_nid_to_char(int nid) { switch (nid) { -- 1.8.4.21.g992c386
Re: [PATCH] pki crypto: pki_key_ecdsa_name | Andreas Schneider <asn@xxxxxxxxxxxxxx> |