Commit c553b330 authored by Mark Andrews's avatar Mark Andrews
Browse files

1836. [cleanup] Silence compiler warnings in hash_test.c.

parent b4fcb547
1836. [cleanup] Silence compiler warnings in hash_test.c.
1835. [bug] Update dnssec-signzone's usage message. [RT #13657]
1834. [bug] Bad memset in rdata_test.c. [RT #13658]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: hash_test.c,v 1.10 2004/03/05 04:58:37 marka Exp $ */
/* $Id: hash_test.c,v 1.11 2005/03/16 13:40:14 marka Exp $ */
#include <config.h>
......@@ -50,7 +50,7 @@ main(int argc, char **argv) {
isc_hmacmd5_t hmacmd5;
unsigned char digest[20];
unsigned char buffer[1024];
const unsigned char *s;
const char *s;
unsigned char key[20];
UNUSED(argc);
......@@ -58,21 +58,21 @@ main(int argc, char **argv) {
s = "abc";
isc_sha1_init(&sha1);
strcpy(buffer, s);
memcpy(buffer, s, strlen(s));
isc_sha1_update(&sha1, buffer, strlen(s));
isc_sha1_final(&sha1, digest);
print_digest(buffer, "sha1", digest, 5);
s = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
isc_sha1_init(&sha1);
strcpy(buffer, s);
memcpy(buffer, s, strlen(s));
isc_sha1_update(&sha1, buffer, strlen(s));
isc_sha1_final(&sha1, digest);
print_digest(buffer, "sha1", digest, 5);
s = "abc";
isc_md5_init(&md5);
strcpy(buffer, s);
memcpy(buffer, s, strlen(s));
isc_md5_update(&md5, buffer, strlen(s));
isc_md5_final(&md5, digest);
print_digest(buffer, "md5", digest, 4);
......@@ -83,7 +83,7 @@ main(int argc, char **argv) {
s = "Hi There";
memset(key, 0x0b, 16);
isc_hmacmd5_init(&hmacmd5, key, 16);
strcpy(buffer, s);
memcpy(buffer, s, strlen(s));
isc_hmacmd5_update(&hmacmd5, buffer, strlen(s));
isc_hmacmd5_sign(&hmacmd5, digest);
print_digest(buffer, "hmacmd5", digest, 4);
......@@ -91,7 +91,7 @@ main(int argc, char **argv) {
s = "what do ya want for nothing?";
strcpy(key, "Jefe");
isc_hmacmd5_init(&hmacmd5, key, 4);
strcpy(buffer, s);
memcpy(buffer, s, strlen(s));
isc_hmacmd5_update(&hmacmd5, buffer, strlen(s));
isc_hmacmd5_sign(&hmacmd5, digest);
print_digest(buffer, "hmacmd5", digest, 4);
......@@ -103,7 +103,7 @@ main(int argc, char **argv) {
"\335\335\335\335\335\335\335\335\335\335";
memset(key, 0xaa, 16);
isc_hmacmd5_init(&hmacmd5, key, 16);
strcpy(buffer, s);
memcpy(buffer, s, strlen(s));
isc_hmacmd5_update(&hmacmd5, buffer, strlen(s));
isc_hmacmd5_sign(&hmacmd5, digest);
print_digest(buffer, "hmacmd5", digest, 4);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment