]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - lib/md5-test.c
SourceFormat Enforcement
[thirdparty/squid.git] / lib / md5-test.c
index ba4a90a72c51c43e0f9a564d6019149fc2da32bf..52739744b69d46e2a8b61b6cda2c379973898e8a 100644 (file)
@@ -1,11 +1,13 @@
 /*
- * COMPILE WITH:
- *      gcc -Wall md5-test.c -I../include md5.o
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
-#include "config.h"
+#include "squid.h"
 #include "md5.h"
-#include "stdio.h"
 
 static void MDPrint(unsigned char digest[16]);
 static void MDString(char *string);
@@ -16,9 +18,9 @@ MDString(char *string)
     MD5_CTX context;
     unsigned char digest[16];
     unsigned int len = strlen(string);
-    MD5Init(&context);
-    MD5Update(&context, string, len);
-    MD5Final(digest, &context);
+    xMD5Init(&context);
+    xMD5Update(&context, string, len);
+    xMD5Final(digest, &context);
     printf("MD5 (\"%s\") = ", string);
     MDPrint(digest);
     printf("\n");
@@ -29,7 +31,7 @@ MDPrint(unsigned char digest[16])
 {
     unsigned int i;
     for (i = 0; i < 16; i++)
-       printf("%02x", digest[i]);
+        printf("%02x", digest[i]);
 }
 
 int
@@ -41,10 +43,9 @@ main(int argc, char **argv)
     MDString("abc");
     MDString("message digest");
     MDString("abcdefghijklmnopqrstuvwxyz");
-    MDString
-       ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
-    MDString
-       ("1234567890123456789012345678901234567890\
-1234567890123456789012345678901234567890");
+    MDString("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
+    MDString("1234567890123456789012345678901234567890"
+             "1234567890123456789012345678901234567890");
     return 0;
 }
+