Add hack to allow using an "ecc" key for "ecdsa" or "ecdh".
authorWerner Koch <wk@gnupg.org>
Thu, 11 Apr 2013 22:16:24 +0000 (00:16 +0200)
committerWerner Koch <wk@gnupg.org>
Fri, 12 Apr 2013 16:18:11 +0000 (18:18 +0200)
commitaf8a79aea80217a0c85a592db1fa001792a6bf0f
tree70a1d95d59c391a9e03f2816f72c68f78923662e
parent1f3cfad66456dd6f2e48f20b8eb0c51343449a1c
Add hack to allow using an "ecc" key for "ecdsa" or "ecdh".

* cipher/pubkey.c (sexp_to_key): Add optional arg USE.
(gcry_pk_encrypt, gcry_pk_decrypt): Call sexp_to_key with usage sign.
(gcry_pk_sign, gcry_pk_verify): Call sexp_to_key with usage encrypt.
* tests/basic.c (show_sexp): New.
(check_pubkey_sign): Print test number and add cases for ecc.
(check_pubkey_sign_ecdsa): New.
(do_check_one_pubkey): Divert to new function.
--

The problem we try to address is that in the mdoule specs both, ECDSA
and ECDH have the same alias name "ecc".  This patch allows to use for
example gcry_pk_verify with a key that has only "ecc" in it.

Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/pubkey.c
doc/gcrypt.texi
tests/basic.c