aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-10-01 19:21:13 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-10-24 09:48:35 +0200
commitfb70d0fb41ac51d6d8e4a4de23b3cc72beae1329 (patch)
treea74aa2cd24c73afa42f27dba00a5a27341bb832f /src
parentf8b70d6a73171ecc43b73f5b1f3e7da09ba942d7 (diff)
downloadlibssh-fb70d0fb41ac51d6d8e4a4de23b3cc72beae1329.tar.gz
libssh-fb70d0fb41ac51d6d8e4a4de23b3cc72beae1329.tar.xz
libssh-fb70d0fb41ac51d6d8e4a4de23b3cc72beae1329.zip
pki: Add NULL check in ssh_pki_key_ecdsa_name()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/pki.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pki.c b/src/pki.c
index d5c13048..d420e792 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -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)
{
+ if (key == NULL) {
+ return NULL;
+ }
+
#ifdef HAVE_ECC /* FIXME Better ECC check needed */
return pki_key_ecdsa_nid_to_name(key->ecdsa_nid);
#else
- (void) key; /* unused */
return NULL;
#endif
}