ssh: Fix fingerprint computation for EdDSA key.
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 29 Sep 2015 06:33:59 +0000 (15:33 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 29 Sep 2015 06:33:59 +0000 (15:33 +0900)
* common/ssh-utils.c (get_fingerprint): Handle the prefix of 0x40.
* common/t-ssh-utils.c (sample_keys): Add a new key.

--

Also adding Ed25519 test key.

common/ssh-utils.c
common/t-ssh-utils.c

index fab798d..58586a1 100644 (file)
@@ -196,6 +196,8 @@ get_fingerprint (gcry_sexp_t key, void **r_fpr, size_t *r_len, int as_string)
               err = gpg_err_make (default_errsource, GPG_ERR_INV_SEXP);
               goto leave;
             }
+          blob++;
+          bloblen--;
           lenbuf[0] = bloblen >> 24;
           lenbuf[1] = bloblen >> 16;
           lenbuf[2] = bloblen >>  8;
index 9639584..961f451 100644 (file)
@@ -163,6 +163,25 @@ static struct { const char *key; const char *fpr; } sample_keys[] = {
     ")", /* Passphrase="abc" */
     "1e:a6:94:ab:bd:81:73:5f:22:bc:0e:c7:89:f6:68:df"
   },
+  { /* OpenSSH 6.7p1 generated key:  */
+    "(protected-private-key "
+    "(ecc "
+    "(curve Ed25519)"
+    "(flags eddsa)"
+    "(q #40A3577AA7830C50EBC15B538E9505DB2F0D2FFCD57EA477DD83dcaea530f3c277#)"
+    "(protected openpgp-s2k3-sha1-aes-cbc "
+    "("
+    "(sha1 #FA8123F1A37CBC1F# \"3812352\")"
+    "#7671C7387E2DD931CC62C35CBBE08A28#)"
+    "#75e928f4698172b61dffe9ef2ada1d3473f690f3879c5386e2717e5b2fa46884"
+    "b189ee409827aab0ff37f62996e040b5fa7e75fc4d8152c8734e2e648dff90c9"
+    "e8c3e39ea7485618d05c34b1b74ff59676e9a3d932245cc101b5904777a09f86#)"
+    "(protected-at \"20150928T050210\")"
+    ")"
+    "(comment \"eddsa w/o comment\")"
+    ")", /* Passphrase="abc" */
+    "f1:fa:c8:a6:40:bb:b9:a1:65:d7:62:65:ac:26:78:0e"
+  },
   {
     NULL,
     NULL