#include <openssl/err.h>
#include "testutil.h"
-#ifdef OPENSSL_NO_DH
-int main(int argc, char *argv[])
-{
- printf("No DH support\n");
- return EXIT_SUCCESS;
-}
-#else
+#ifndef OPENSSL_NO_DH
# include <openssl/dh.h>
static int cb(int p, int n, BN_GENCB *arg);
-static const char rnd_seed[] =
- "string to make the random number generator think it has randomness";
-
static int dh_test(void)
{
BN_GENCB *_cb = NULL;
int i, alen, blen, aout, bout;
int ret = 0;
- RAND_seed(rnd_seed, sizeof rnd_seed);
-
if (!TEST_ptr(_cb = BN_GENCB_new()))
goto err;
BN_GENCB_set(_cb, &cb, NULL);
TEST_error("Test failed RFC5114 set %d\n", i + 1);
return 0;
}
+#endif
-void register_tests(void)
+int setup_tests(void)
{
+#ifdef OPENSSL_NO_DH
+ TEST_note("No DH support");
+#else
ADD_TEST(dh_test);
ADD_TEST(rfc5114_test);
-}
#endif
+ return 1;
+}