X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=inline;f=tests%2Ftest-hmac-md5.c;h=4b6e43ab138e2ca45080dc682689b63e8ed4ec48;hb=ac01a4aaec3f7b63a8110268615b9b7f4e9f41f4;hp=e3cf76b513b09cb2db331e7b050d20493283a560;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/tests/test-hmac-md5.c b/tests/test-hmac-md5.c index e3cf76b51..4b6e43ab1 100644 --- a/tests/test-hmac-md5.c +++ b/tests/test-hmac-md5.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 Free Software Foundation + * Copyright (C) 2005, 2010 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,21 +46,21 @@ main (int argc, char *argv[]) if (hmac_md5 (key, key_len, data, data_len, out) != 0) { - printf ("call failure\n"); - return 1; + printf ("call failure\n"); + return 1; } if (memcmp (digest, out, 16) != 0) { - size_t i; - printf ("hash 1 mismatch. expected:\n"); - for (i = 0; i < 16; i++) - printf ("%02x ", digest[i] & 0xFF); - printf ("\ncomputed:\n"); - for (i = 0; i < 16; i++) - printf ("%02x ", out[i] & 0xFF); - printf ("\n"); - return 1; + size_t i; + printf ("hash 1 mismatch. expected:\n"); + for (i = 0; i < 16; i++) + printf ("%02x ", digest[i] & 0xFF); + printf ("\ncomputed:\n"); + for (i = 0; i < 16; i++) + printf ("%02x ", out[i] & 0xFF); + printf ("\n"); + return 1; } } @@ -81,21 +81,21 @@ main (int argc, char *argv[]) if (hmac_md5 (key, key_len, data, data_len, out) != 0) { - printf ("call failure\n"); - return 1; + printf ("call failure\n"); + return 1; } if (memcmp (digest, out, 16) != 0) { - size_t i; - printf ("hash 2 mismatch. expected:\n"); - for (i = 0; i < 16; i++) - printf ("%02x ", digest[i] & 0xFF); - printf ("\ncomputed:\n"); - for (i = 0; i < 16; i++) - printf ("%02x ", out[i] & 0xFF); - printf ("\n"); - return 1; + size_t i; + printf ("hash 2 mismatch. expected:\n"); + for (i = 0; i < 16; i++) + printf ("%02x ", digest[i] & 0xFF); + printf ("\ncomputed:\n"); + for (i = 0; i < 16; i++) + printf ("%02x ", out[i] & 0xFF); + printf ("\n"); + return 1; } } @@ -125,21 +125,21 @@ main (int argc, char *argv[]) if (hmac_md5 (key, key_len, data, data_len, out) != 0) { - printf ("call failure\n"); - return 1; + printf ("call failure\n"); + return 1; } if (memcmp (digest, out, 16) != 0) { - size_t i; - printf ("hash 3 mismatch. expected:\n"); - for (i = 0; i < 16; i++) - printf ("%02x ", digest[i] & 0xFF); - printf ("\ncomputed:\n"); - for (i = 0; i < 16; i++) - printf ("%02x ", out[i] & 0xFF); - printf ("\n"); - return 1; + size_t i; + printf ("hash 3 mismatch. expected:\n"); + for (i = 0; i < 16; i++) + printf ("%02x ", digest[i] & 0xFF); + printf ("\ncomputed:\n"); + for (i = 0; i < 16; i++) + printf ("%02x ", out[i] & 0xFF); + printf ("\n"); + return 1; } }