diff options
author | Geoff Thorpe <geoff@openssl.org> | 2003-01-15 02:01:55 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2003-01-15 02:01:55 +0000 |
commit | 0e4aa0d2d2807e0cbeac29b65d2b9061daed8941 (patch) | |
tree | cec435e2a3ce007d0b1a7be92c4cf12cdc4bd1a5 /crypto/dsa/dsa_gen.c | |
parent | 08cb96bba2831a8fc3dbda697ab65d64bb05a371 (diff) |
As with RSA, which was modified recently, this change makes it possible to
override key-generation implementations by placing handlers in the methods
for DSA and DH. Also, parameter generation for DSA and DH is possible by
another new handler for each method.
Diffstat (limited to 'crypto/dsa/dsa_gen.c')
-rw-r--r-- | crypto/dsa/dsa_gen.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c index ca2c867089..4b9aff3689 100644 --- a/crypto/dsa/dsa_gen.c +++ b/crypto/dsa/dsa_gen.c @@ -80,10 +80,25 @@ #include <openssl/rand.h> #include <openssl/sha.h> +static int dsa_builtin_paramgen(DSA *ret, int bits, + unsigned char *seed_in, int seed_len, + int *counter_ret, unsigned long *h_ret, BN_GENCB *cb); + int DSA_generate_parameters_ex(DSA *ret, int bits, unsigned char *seed_in, int seed_len, int *counter_ret, unsigned long *h_ret, BN_GENCB *cb) { + if(ret->meth->dsa_paramgen) + return ret->meth->dsa_paramgen(ret, bits, seed_in, seed_len, + counter_ret, h_ret, cb); + return dsa_builtin_paramgen(ret, bits, seed_in, seed_len, + counter_ret, h_ret, cb); + } + +static int dsa_builtin_paramgen(DSA *ret, int bits, + unsigned char *seed_in, int seed_len, + int *counter_ret, unsigned long *h_ret, BN_GENCB *cb) + { int ok=0; unsigned char seed[SHA_DIGEST_LENGTH]; unsigned char md[SHA_DIGEST_LENGTH]; |