pubkey: Move sexp parsing for gcry_pk_verify to the modules.
authorWerner Koch <wk@gnupg.org>
Wed, 9 Oct 2013 13:05:26 +0000 (15:05 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 9 Oct 2013 13:05:26 +0000 (15:05 +0200)
commit94b652ecb006c29fa2ffb1badc9f02b758581737
tree14eb5e6121fafcf13d46eddb2e53d3b176ac6c8e
parent4645f3728bb0900591b0aef85831fdee52c59e3c
pubkey: Move sexp parsing for gcry_pk_verify to the modules.

* cipher/rsa.c (rsa_verify): Revamp.
* cipher/dsa.c (dsa_verify): Revamp.
* cipher/elgamal.c (elg_verify): Revamp.
* cipher/ecc.c (ecc_verify): Revamp.
* cipher/pubkey.c (sexp_to_sig): Remove.
(pss_verify_cmp): Move to pubkey-util.c
(sexp_data_to_mpi): Ditto.
(init_encoding_ctx): Ditto.
(gcry_pk_verify): Simplify.
* cipher/pubkey-util.c (_gcry_pk_util_init_encoding_ctx): Add. Take
from pubkey.c
(get_hash_algo): Ditto.
(_gcry_pk_util_data_to_mpi): Ditto.
(pss_verify_cmp): Ditto.
(_gcry_pk_util_extract_mpis): New.
(_gcry_pk_util_preparse_sigval): New.
(_gcry_pk_util_free_encoding_ctx): New.
* cipher/ecc-curves.c (_gcry_ecc_fill_in_curve): Make curve init
optional.

* src/g10lib.h (GCC_ATTR_SENTINEL): New.

* tests/basic.c (check_pubkey_sign): Print the algo name.
(main): Add option --pubkey.

Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/dsa.c
cipher/ecc-curves.c
cipher/ecc.c
cipher/elgamal.c
cipher/pubkey-internal.h
cipher/pubkey-util.c
cipher/pubkey.c
cipher/rsa.c
src/cipher-proto.h
src/g10lib.h
tests/basic.c