Following the license change, modify the boilerplates in crypto/
[openssl.git] / test / hmactest.c
index d7e68b4cd710c5bfe89308ec57ff10bd4b85558c..47d812da54be1b39d78ad0d68323e83b0813d91d 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Licensed under the OpenSSL license (the "License").  You may not use
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include "../e_os.h"
+#include "internal/nelem.h"
 
 # include <openssl/hmac.h>
 # include <openssl/sha.h>
@@ -23,7 +23,6 @@
 #  include <openssl/ebcdic.h>
 # endif
 
-#include "test_main.h"
 #include "testutil.h"
 
 # ifndef OPENSSL_NO_MD5
@@ -106,7 +105,7 @@ static int test_hmac_md5(int idx)
 }
 # endif
 
-static int test_hmac_bad()
+static int test_hmac_bad(void)
 {
     HMAC_CTX *ctx = NULL;
     int ret = 0;
@@ -126,7 +125,7 @@ err:
     return ret;
 }
 
-static int test_hmac_run()
+static int test_hmac_run(void)
 {
     char *p;
     HMAC_CTX *ctx = NULL;
@@ -181,7 +180,7 @@ err:
 }
 
 
-static int test_hmac_single_shot()
+static int test_hmac_single_shot(void)
 {
     char *p;
 
@@ -195,7 +194,7 @@ static int test_hmac_single_shot()
 }
 
 
-static int test_hmac_copy()
+static int test_hmac_copy(void)
 {
     char *p;
     HMAC_CTX *ctx = NULL, *ctx2 = NULL;
@@ -233,16 +232,17 @@ static char *pt(unsigned char *md, unsigned int len)
 
     for (i = 0; i < len; i++)
         sprintf(&(buf[i * 2]), "%02x", md[i]);
-    return (buf);
+    return buf;
 }
 # endif
 
-void register_tests(void)
+int setup_tests(void)
 {
     ADD_ALL_TESTS(test_hmac_md5, 4);
     ADD_TEST(test_hmac_single_shot);
     ADD_TEST(test_hmac_bad);
     ADD_TEST(test_hmac_run);
     ADD_TEST(test_hmac_copy);
+    return 1;
 }