From 48aca98cd52f439acf2af9faa27d7d6c7a4735c5 Mon Sep 17 00:00:00 2001 From: Jon Simons Date: Fri, 4 Apr 2014 15:37:43 -0700 Subject: pki crypto: expose new ssh_pki_key_ecdsa_name API Enable retrieving the "ecdsa-sha2-nistpNNN" name of ECDSA keys with a new 'ssh_pki_key_ecdsa_name' API. This gives more information than the 'ssh_key_type_to_char' API, which yields "ssh-ecdsa" for ECDSA keys. The motivation is that this info is useful to have in a server context. The torture_pki unit test is updated to include the new API, and a few more passes are added to additionally test 384 and 521-bit keys. Signed-off-by: Jon Simons Reviewed-by: Andreas Schneider --- include/libssh/libssh.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h index ea63feeb..a166d054 100644 --- a/include/libssh/libssh.h +++ b/include/libssh/libssh.h @@ -557,6 +557,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 *ssh_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); -- cgit