From 5c067d54d349fdfb3243634789c8841515d2c28f Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 29 Sep 2015 15:33:59 +0900 Subject: [PATCH] ssh: Fix fingerprint computation for EdDSA key. * 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 | 2 ++ common/t-ssh-utils.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/common/ssh-utils.c b/common/ssh-utils.c index fab798dc7..58586a1aa 100644 --- a/common/ssh-utils.c +++ b/common/ssh-utils.c @@ -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; diff --git a/common/t-ssh-utils.c b/common/t-ssh-utils.c index 9639584d9..961f451dc 100644 --- a/common/t-ssh-utils.c +++ b/common/t-ssh-utils.c @@ -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