#include <stdio.h>
#include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
+#ifdef OPENSSL_FIPS
+
/* Check that p is a safe prime and
* if g is 2, 3 or 5, check that is is a suitable generator
* where
if (q != NULL) BN_free(q);
return(ok);
}
+
+#endif
+#endif
#include <string.h>
#include <openssl/err.h>
#include <openssl/bn.h>
+#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
+#endif
#include <openssl/fips.h>
+#ifndef OPENSSL_NO_DH
+#ifdef OPENSSL_FIPS
+
/* We generate DH parameters as follows
* find a prime q which is prime_len/2 bits long.
* p=(2*q)+1 or (p-1)/2 = q
* order-q subgroup.
*/
-#ifdef OPENSSL_FIPS
-
DH *DH_generate_parameters(int prime_len, int generator,
void (*callback)(int,int,void *), void *cb_arg)
{
}
#endif
+#endif
#include <stdio.h>
#include <openssl/err.h>
#include <openssl/bn.h>
+#ifndef OPENSSL_NO_RAND
#include <openssl/rand.h>
+#endif
+#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
+#ifdef OPENSSL_FIPS
+
static int generate_key(DH *dh);
static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
static int dh_bn_mod_exp(const DH *dh, BIGNUM *r,
BN_MONT_CTX_free((BN_MONT_CTX *)dh->method_mont_p);
return(1);
}
+
+#endif
+#endif