New function DSA_dup_DH, and fixes for bugs that were found
[openssl.git] / crypto / dh / dh_gen.c
index 466f2bf06f51cd71820ea3c8ed5255dbea4f03f1..b7bcd2c7a4183b44b622dab42b7c5a1e4779435a 100644 (file)
@@ -58,8 +58,8 @@
 
 #include <stdio.h>
 #include "cryptlib.h"
-#include "bn.h"
-#include "dh.h"
+#include <openssl/bn.h>
+#include <openssl/dh.h>
 
 /* We generate DH parameters as follows
  * find a prime q which is prime_len/2 bits long.
  * this generator function can take a very very long time to run.
  */
 
-DH *DH_generate_parameters(prime_len,generator,callback,cb_arg)
-int prime_len;
-int generator;
-void (*callback)(P_I_I_P);
-char *cb_arg;
+DH *DH_generate_parameters(int prime_len, int generator,
+            void (*callback)(int,int,void *), void *cb_arg)
        {
        BIGNUM *p=NULL,*t1,*t2;
        DH *ret=NULL;
@@ -95,6 +92,7 @@ char *cb_arg;
        BN_CTX *ctx=NULL;
 
        ret=DH_new();
+       if (ret == NULL) goto err;
        ctx=BN_CTX_new();
        if (ctx == NULL) goto err;
        t1= &(ctx->bn[0]);