Fix unit-tests when no-srp configured
authorRich Salz <rsalz@openssl.org>
Wed, 26 Apr 2017 15:21:29 +0000 (11:21 -0400)
committerRich Salz <rsalz@openssl.org>
Wed, 26 Apr 2017 15:21:29 +0000 (11:21 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3274)

test/srptest.c

index c908c393affafa7a4b096afa5fee2f59b036f4ed..d28c3bcafcc44519056d44a7137258c573264071 100644 (file)
@@ -8,22 +8,15 @@
  */
 
 #include <openssl/opensslconf.h>
-#ifdef OPENSSL_NO_SRP
+# include "testutil.h"
 
+#ifdef OPENSSL_NO_SRP
 # include <stdio.h>
-
-int main(int argc, char *argv[])
-{
-    printf("No SRP support\n");
-    return (0);
-}
-
 #else
 
 # include <openssl/srp.h>
 # include <openssl/rand.h>
 # include <openssl/err.h>
-# include "testutil.h"
 
 static void showbn(const char *name, const BIGNUM *bn)
 {
@@ -276,10 +269,14 @@ static int run_srp_tests(void)
 
     return 1;
 }
+#endif
 
 void register_tests(void)
 {
+#ifdef OPENSSL_NO_SRP
+    printf("No SRP support\n");
+#else
     ADD_TEST(run_srp_tests);
     ADD_TEST(run_srp_kat);
-}
 #endif
+}