summaryrefslogtreecommitdiffstats
path: root/crypto/dsa/dsa_key.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-01-15 02:01:55 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-01-15 02:01:55 +0000
commit0e4aa0d2d2807e0cbeac29b65d2b9061daed8941 (patch)
treecec435e2a3ce007d0b1a7be92c4cf12cdc4bd1a5 /crypto/dsa/dsa_key.c
parent08cb96bba2831a8fc3dbda697ab65d64bb05a371 (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_key.c')
-rw-r--r--crypto/dsa/dsa_key.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c
index ef87c3e637..48ff1f423c 100644
--- a/crypto/dsa/dsa_key.c
+++ b/crypto/dsa/dsa_key.c
@@ -64,8 +64,17 @@
#include <openssl/dsa.h>
#include <openssl/rand.h>
+static int dsa_builtin_keygen(DSA *dsa);
+
int DSA_generate_key(DSA *dsa)
{
+ if(dsa->meth->dsa_keygen)
+ return dsa->meth->dsa_keygen(dsa);
+ return dsa_builtin_keygen(dsa);
+ }
+
+static int dsa_builtin_keygen(DSA *dsa)
+ {
int ok=0;
BN_CTX *ctx=NULL;
BIGNUM *pub_key=NULL,*priv_key=NULL;