sshkey: Fix loading of ECDSA keys from files
This commit is contained in:
@@ -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 {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user