sshkey: Fix loading of ECDSA keys from files

This commit is contained in:
Tobias Brunner
2014-06-18 09:16:24 +02:00
parent 1cda692110
commit 846fd70eec
2 changed files with 3 additions and 3 deletions
@@ -140,8 +140,8 @@ static sshkey_public_key_t *load_from_stream(FILE *file)
char line[1024], *token; char line[1024], *token;
while (!public && fgets(line, sizeof(line), file)) while (!public && fgets(line, sizeof(line), file))
{ /* the format is: ssh-[rsa|ecdsa-...] <key(base64)> <identifier> */ { /* the format is: ssh-rsa|ecdsa-... <key(base64)> <identifier> */
if (!strpfx(line, "ssh-")) if (!strpfx(line, "ssh-rsa") && !strpfx(line, ECDSA_PREFIX))
{ {
continue; continue;
} }
@@ -27,7 +27,7 @@
typedef struct sshkey_public_key_t sshkey_public_key_t; typedef struct sshkey_public_key_t sshkey_public_key_t;
/** /**
* Public key implementation supporting RFC 4253 decoding. * Public key implementation supporting RFC 4253/RFC 5656 decoding.
*/ */
struct sshkey_public_key_t { struct sshkey_public_key_t {