diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-04-28 23:58:42 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-04-28 23:58:42 +0000 |
commit | 48aee63b37d493ee0a8f116cfe010e7a5298dbab (patch) | |
tree | 36c398d07c4886dc9b4c495a5dc8016c00c6b129 /bin | |
parent | 9fca906a9d37b7c5a8f630e68bb0228787ce23ef (diff) |
Use the FOO_DIGEST_LENGTH macros
Diffstat (limited to 'bin')
-rw-r--r-- | bin/md5/md5.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/bin/md5/md5.c b/bin/md5/md5.c index f81f7404353..d4351d3bb77 100644 --- a/bin/md5/md5.c +++ b/bin/md5/md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.c,v 1.27 2004/03/03 22:00:06 millert Exp $ */ +/* $OpenBSD: md5.c,v 1.28 2004/04/28 23:58:41 millert Exp $ */ /* * Copyright (c) 2001, 2003 Todd C. Miller <Todd.Miller@courtesan.com> @@ -38,8 +38,8 @@ union ANY_CTX { MD5_CTX md5; - SHA1_CTX sha1; RMD160_CTX rmd160; + SHA1_CTX sha1; }; struct hash_functions { @@ -55,29 +55,29 @@ struct hash_functions { struct hash_functions functions[] = { { "MD5", - 32, + MD5_DIGEST_LENGTH * 2, (void (*)(void *))MD5Init, (void (*)(void *, const unsigned char *, unsigned int))MD5Update, (char *(*)(void *, char *))MD5End, (char *(*)(char *, char *))MD5File, (char *(*)(const unsigned char *, unsigned int, char *))MD5Data }, { - "SHA1", - 40, - (void (*)(void *))SHA1Init, - (void (*)(void *, const unsigned char *, unsigned int))SHA1Update, - (char *(*)(void *, char *))SHA1End, - (char *(*)(char *, char *))SHA1File, - (char *(*)(const unsigned char *, unsigned int, char *))SHA1Data - }, { "RMD160", - 40, + RMD160_DIGEST_LENGTH * 2, (void (*)(void *))RMD160Init, (void (*)(void *, const unsigned char *, unsigned int))RMD160Update, (char *(*)(void *, char *))RMD160End, (char *(*)(char *, char *))RMD160File, (char *(*)(const unsigned char *, unsigned int, char *))RMD160Data }, { + "SHA1", + SHA1_DIGEST_LENGTH * 2, + (void (*)(void *))SHA1Init, + (void (*)(void *, const unsigned char *, unsigned int))SHA1Update, + (char *(*)(void *, char *))SHA1End, + (char *(*)(char *, char *))SHA1File, + (char *(*)(const unsigned char *, unsigned int, char *))SHA1Data + }, { NULL, }, }; @@ -195,7 +195,7 @@ digest_file(char *file, struct hash_functions *hf, int echo) } if (nread == -1) { warn("%s: read error", file); - if (fd != STDIN_FILENO) + if (fd != STDIN_FILENO) close(fd); return; } |