pubkey: Move sexp parsing for gcry_pk_getkey to the modules.
authorWerner Koch <wk@gnupg.org>
Tue, 8 Oct 2013 15:59:50 +0000 (17:59 +0200)
committerWerner Koch <wk@gnupg.org>
Tue, 8 Oct 2013 15:59:50 +0000 (17:59 +0200)
commit3816e46ce211e63adf46dbc775510aa137572248
tree7a4e51d84d2e0f83803f5865b58c8135f4a1ca5e
parentf79d3e13d3229115c47cbe5007647cb44105fe3f
pubkey: Move sexp parsing for gcry_pk_getkey to the modules.

* cipher/pubkey-util.c: New.
(_gcry_pk_util_get_nbits): New.  Based on code from gcry_pk_genkey.
(_gcry_pk_util_get_rsa_use_e): Ditto.
* cipher/pubkey.c (gcry_pk_genkey): Strip most code and pass.
* cipher/rsa.c (rsa_generate): Remove args ALGO, NBITS and EVALUE.
Call new fucntions to get these values.
* cipher/dsa.c (dsa_generate): Remove args ALGO, NBITS and EVALUE.
Call _gcry_pk_util_get_nbits to get nbits.  Always parse genparms.
* cipher/elgamal.c (elg_generate): Ditto.
* cipher/ecc.c (ecc_generate): Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/Makefile.am
cipher/dsa.c
cipher/ecc.c
cipher/elgamal.c
cipher/pubkey-internal.h
cipher/pubkey-util.c [new file with mode: 0644]
cipher/pubkey.c
cipher/rsa.c
src/cipher-proto.h