diff options
author | Werner Koch <wk@gnupg.org> | 2013-09-07 10:06:46 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2013-09-18 21:03:40 +0200 |
commit | 85722afb379f7a392a8117b895de273fd88c4ebc (patch) | |
tree | 41723f41081f114b43f37c2acc49a57cd988d5d6 /src/cipher-proto.h | |
parent | 89103ce00e862cc709e80fa41f2ee13d54093ec5 (diff) | |
download | libgcrypt-85722afb379f7a392a8117b895de273fd88c4ebc.tar.gz |
pk: Simplify the public key dispatcher pubkey.c.
* src/cipher-proto.h (gcry_pk_spec_t): Add fields ALGO and FLAGS.
* cipher/dsa.c (_gcry_pubkey_spec_dsa): Set these fields.
* cipher/ecc.c (_gcry_pubkey_spec_ecdsa): Ditto.
(_gcry_pubkey_spec_ecdh): Ditto.
* cipher/rsa.c (_gcry_pubkey_spec_rsa): Ditto.
* cipher/elgamal.c (_gcry_pubkey_spec_elg): Ditto
(_gcry_pubkey_spec_elg_e): New.
* cipher/pubkey.c: Change most code to replace the former module
system by a simpler system to gain information about the algorithms.
(disable_pubkey_algo): SImplified. Not anymore thread-safe, though.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/cipher-proto.h')
-rw-r--r-- | src/cipher-proto.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cipher-proto.h b/src/cipher-proto.h index eec3d354..a641a079 100644 --- a/src/cipher-proto.h +++ b/src/cipher-proto.h @@ -122,6 +122,12 @@ typedef gcry_sexp_t (*pk_get_curve_param_t)(const char *name); /* Module specification structure for public key algoritms. */ typedef struct gcry_pk_spec { + int algo; + struct { + unsigned int disabled:1; + unsigned int fips:1; + } flags; + int use; const char *name; const char **aliases; const char *elements_pkey; @@ -129,7 +135,6 @@ typedef struct gcry_pk_spec const char *elements_enc; const char *elements_sig; const char *elements_grip; - int use; gcry_pk_generate_t generate; gcry_pk_check_secret_key_t check_secret_key; gcry_pk_encrypt_t encrypt; @@ -181,9 +186,6 @@ gcry_error_t _gcry_md_register (gcry_md_spec_t *cipher, md_extra_spec_t *extraspec, unsigned int *algorithm_id, gcry_module_t *module); -gcry_error_t _gcry_pk_register (gcry_pk_spec_t *cipher, - unsigned int *algorithm_id, - gcry_module_t *module); /* The selftest functions. */ gcry_error_t _gcry_cipher_selftest (int algo, int extended, |