HomePhabricator

pki: Fix accidental ECC switch case fallthroughs into ed25119 cases when built…

Authored by jvijtiuk on Dec 28 2017, 8:45 PM.

Description

pki: Fix accidental ECC switch case fallthroughs into ed25119 cases when built without ECC

Summary:
When ed25519 was introduced in commit 93c7b81b4ea1046bd2f65f4a510d5966786e8d3d,
the ed25519 case was added after the ecdsa case in src/pki.c. The ecdsa case seems to
have relied on falling through to report an error, when HAVE_ECC is not defined.
If HAVE_ECC is not defined, but ecdsa keys are used, with for example,
ssh_pki_import_pubkey_file, the code fallthroughs into the ed25519 case.

Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>

Test Plan: Unit tests passed. No memory leaks found with valgrind.

Reviewers: asn

Differential Revision: https://bugs.libssh.org/D13
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>