Add comments to test_ciphersuite_change()
[openssl.git] / test / bftest.c
index 2bba06010087179d8a954e2c3e9f6c6e2d256769..a7e0bf1cd1a651509d769240f5be25390bb37378 100644 (file)
 #include <stdlib.h>
 #include <openssl/opensslconf.h> /* To see if OPENSSL_NO_BF is defined */
 
-#include "test_main_custom.h"
 #include "testutil.h"
 
 #include "../e_os.h"
 
-#ifdef OPENSSL_NO_BF
-int main(int argc, char *argv[])
-{
-    printf("No BF support\n");
-    return (0);
-}
-#else
+#ifndef OPENSSL_NO_BF
 # include <openssl/blowfish.h>
 
 # ifdef CHARSET_EBCDIC
@@ -339,14 +332,14 @@ static int test_bf_ecb(int n)
 
 static int test_bf_set_key(int n)
 {
-    int i, ret = 1;
+    int ret = 1;
     BF_KEY key;
     unsigned char out[8];
 
     BF_set_key(&key, n+1, key_test);
     BF_ecb_encrypt(key_data, out, &key, BF_ENCRYPT);
     /* mips-sgi-irix6.5-gcc  vv  -mabi=64 bug workaround */
-    if (!TEST_mem_eq(out, 8, &(key_out[i = n][0]), 8))
+    if (!TEST_mem_eq(out, 8, &(key_out[n][0]), 8))
         ret = 0;
 
     return ret;
@@ -440,10 +433,11 @@ static int test_bf_ofb64(void)
 
     return ret;
 }
+#endif
 
 int test_main(int argc, char *argv[])
 {
-    int ret;
+#ifndef OPENSSL_NO_BF
 # ifdef CHARSET_EBCDIC
     int n;
 
@@ -461,10 +455,7 @@ int test_main(int argc, char *argv[])
     ADD_TEST(test_bf_ofb64);
 
     if (argc > 1)
-        ret = print_test_data();
-    else
-        ret = run_tests(argv[0]);
-
-    return ret;
-}
+        return print_test_data();
 #endif
+    return run_tests(argv[0]);
+}