tests: hostapd and MIB ctrl_iface command with open network
[mech_eap.git] / tests / test-md4.c
index 4058486..e3e63ed 100644 (file)
@@ -1,15 +1,9 @@
 /*
  * Test program for MD4 (test vectors from RFC 1320)
- * Copyright (c) 2006, Jouni Malinen <j@w1.fi>
+ * Copyright (c) 2006-2009, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #include "includes.h"
@@ -21,7 +15,7 @@ int main(int argc, char *argv[])
 {
        struct {
                char *data;
-               u8 *hash;
+               char *hash;
        } tests[] = {
                {
                        "",
@@ -67,10 +61,10 @@ int main(int argc, char *argv[])
        size_t len[2];
        int errors = 0;
 
-       for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
+       for (i = 0; i < ARRAY_SIZE(tests); i++) {
                printf("MD4 test case %d:", i);
 
-               addr[0] = tests[i].data;
+               addr[0] = (u8 *) tests[i].data;
                len[0] = strlen(tests[i].data);
                md4_vector(1, addr, len, hash);
                if (memcmp(hash, tests[i].hash, 16) != 0) {
@@ -80,9 +74,9 @@ int main(int argc, char *argv[])
                        printf(" OK");
 
                if (len[0]) {
-                       addr[0] = tests[i].data;
+                       addr[0] = (u8 *) tests[i].data;
                        len[0] = strlen(tests[i].data);
-                       addr[1] = tests[i].data + 1;
+                       addr[1] = (u8 *) tests[i].data + 1;
                        len[1] = strlen(tests[i].data) - 1;
                        md4_vector(1, addr, len, hash);
                        if (memcmp(hash, tests[i].hash, 16) != 0) {