agent: Fix agent_is_eddsa_key.

* agent/findkey.c (agent_is_eddsa_key): Implemented.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2014-01-16 09:07:11 +09:00
parent c5e41f539b
commit 9c731bbedf
1 changed files with 3 additions and 7 deletions

View File

@ -812,14 +812,10 @@ agent_is_eddsa_key (gcry_sexp_t s_key)
return 0;
if (key_parms_from_sexp (s_key, NULL, algoname, sizeof algoname, NULL, 0))
return 0; /* Error - assume it is not an DSA key. */
return 0; /* Error - assume it is not an EdDSA key. */
if (!strcmp (algoname, "dsa"))
return GCRY_PK_DSA;
else if (!strcmp (algoname, "ecc"))
return GCRY_PK_ECDSA; /* FIXME: Check for the EdDSA flag. */
else if (!strcmp (algoname, "ecdsa"))
return GCRY_PK_ECDSA;
if (!strcmp (algoname, "eddsa"))
return 1;
else
return 0;
}