sshkey: Fix loading of ECDSA keys from files
authorTobias Brunner <tobias@strongswan.org>
Thu, 3 Apr 2014 07:23:55 +0000 (09:23 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 18 Jun 2014 07:16:24 +0000 (09:16 +0200)
src/libstrongswan/plugins/sshkey/sshkey_builder.c
src/libstrongswan/plugins/sshkey/sshkey_builder.h

index 245e0f9..4a9f5b8 100644 (file)
@@ -140,8 +140,8 @@ static sshkey_public_key_t *load_from_stream(FILE *file)
        char line[1024], *token;
 
        while (!public && fgets(line, sizeof(line), file))
-       {       /* the format is: ssh-[rsa|ecdsa-...] <key(base64)> <identifier> */
-               if (!strpfx(line, "ssh-"))
+       {       /* the format is: ssh-rsa|ecdsa-... <key(base64)> <identifier> */
+               if (!strpfx(line, "ssh-rsa") && !strpfx(line, ECDSA_PREFIX))
                {
                        continue;
                }
index 7225f55..20979c2 100644 (file)
@@ -27,7 +27,7 @@
 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 {