1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-08 19:02:06 +03:00

pki: Add NULL check in ssh_pki_key_ecdsa_name()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-10-01 19:21:13 +02:00
parent f8b70d6a73
commit fb70d0fb41

View File

@@ -91,10 +91,13 @@ enum ssh_keytypes_e pki_privatekey_type_from_string(const char *privkey) {
*/ */
const char *ssh_pki_key_ecdsa_name(const ssh_key key) const char *ssh_pki_key_ecdsa_name(const ssh_key key)
{ {
if (key == NULL) {
return NULL;
}
#ifdef HAVE_ECC /* FIXME Better ECC check needed */ #ifdef HAVE_ECC /* FIXME Better ECC check needed */
return pki_key_ecdsa_nid_to_name(key->ecdsa_nid); return pki_key_ecdsa_nid_to_name(key->ecdsa_nid);
#else #else
(void) key; /* unused */
return NULL; return NULL;
#endif #endif
} }