* certcheck.c (do_encode_md): Support 160 bit ECDSA.
This commit is contained in:
Werner Koch 2007-04-18 13:03:35 +00:00
parent 685b56a0d3
commit 4c48abebfe
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2007-04-18 Werner Koch <wk@g10code.com>
* certcheck.c (do_encode_md): Support 160 bit ECDSA.
2007-04-13 Werner Koch <wk@g10code.com>
* call-agent.c (start_agent): Don't use log_error when using the

View File

@ -44,7 +44,7 @@ do_encode_md (gcry_md_hd_t md, int algo, int pkalgo, unsigned int nbits,
size_t nframe;
unsigned char *frame;
if (pkalgo == GCRY_PK_DSA)
if (pkalgo == GCRY_PK_DSA || pkalgo == GCRY_PK_ECDSA)
{
nframe = gcry_md_get_algo_dlen (algo);
if (nframe != 20)
@ -143,6 +143,12 @@ pk_algo_from_sexp (gcry_sexp_t pkey)
algo = GCRY_PK_RSA;
else if (n==3 && !memcmp (name, "dsa", 3))
algo = GCRY_PK_DSA;
else if (n==5 && !memcmp (name, "ecdsa", 5))
algo = GCRY_PK_ECDSA;
/* Because this function is called only for verification we can
assume that ECC actually means ECDSA. */
else if (n==3 && !memcmp (name, "ecc", 3))
algo = GCRY_PK_ECDSA;
else if (n==13 && !memcmp (name, "ambiguous-rsa", 13))
algo = GCRY_PK_RSA;
else