From 679cd9efd8e369f7a727314bb2bab00da211b999 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 6 Jan 2012 21:54:39 +0100 Subject: pki: Fix build if you don't have ECC support. --- src/pki.c | 8 -------- src/pki_crypto.c | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/pki.c b/src/pki.c index 1ebc84a2..ff8a5aac 100644 --- a/src/pki.c +++ b/src/pki.c @@ -730,7 +730,6 @@ int ssh_pki_import_pubkey_blob(const ssh_string key_blob, ssh_buffer buffer; ssh_string type_s = NULL; enum ssh_keytypes_e type; - int nid; int rc; if (key_blob == NULL || pkey == NULL) { @@ -761,13 +760,6 @@ int ssh_pki_import_pubkey_blob(const ssh_string key_blob, ssh_pki_log("Unknown key type found!"); goto fail; } - if (type == SSH_KEYTYPE_ECDSA) { - nid = pki_key_ecdsa_nid_from_name(ssh_string_get_char(type_s)); - if (nid == -1) { - ssh_pki_log("Unknown nid found!"); - goto fail; - } - } ssh_string_free(type_s); rc = pki_import_pubkey_buffer(buffer, type, pkey); diff --git a/src/pki_crypto.c b/src/pki_crypto.c index e6763217..0e54a38b 100644 --- a/src/pki_crypto.c +++ b/src/pki_crypto.c @@ -403,6 +403,7 @@ int pki_key_generate_dss(ssh_key key, int parameter){ return SSH_OK; } +#ifdef HAVE_OPENSSL_ECC int pki_key_generate_ecdsa(ssh_key key, int parameter) { int nid; int ok; @@ -436,6 +437,7 @@ int pki_key_generate_ecdsa(ssh_key key, int parameter) { return SSH_OK; } +#endif int pki_key_compare(const ssh_key k1, const ssh_key k2, @@ -654,7 +656,9 @@ fail: ssh_key_free(key); DSA_free(dsa); RSA_free(rsa); +#ifdef HAVE_OPENSSL_ECC EC_KEY_free(ecdsa); +#endif return NULL; } -- cgit