summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpaul <paul>2006-01-17 17:40:45 +0000
committerpaul <paul>2006-01-17 17:40:45 +0000
commit7d0b0c4b7f510178a8960b0e00368be017ed5a08 (patch)
tree4657272b687af5f85235ce85db9ed77dbfac4142 /lib
parentd3092e7f226c48f7caeac22ad62f39e8d71d9e12 (diff)
[lib/md5] md5_loop should take void pointer for more useful caller warnings.
2006-01-17 Paul Jakma <paul.jakma@sun.com> * md5.{c,h}: (md5_loop) Is better off taking a void * and doing cast to byte wise type internally, avoids needs for casts in users.
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog6
-rw-r--r--lib/md5.c5
-rw-r--r--lib/md5.h4
3 files changed, 11 insertions, 4 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog
index eeb64041..a3270c68 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,9 @@
+2006-01-17 Paul Jakma <paul.jakma@sun.com>
+
+ * md5.{c,h}: (md5_loop) Is better off taking a void * and doing
+ cast to byte wise type internally, avoids needs for casts
+ in users.
+
2006-01-16 Paul Jakma <paul.jakma@sun.com>
* zclient.h: Update the Zserv protocol header with a version
diff --git a/lib/md5.c b/lib/md5.c
index e994085c..0340e450 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -1,6 +1,6 @@
/* $USAGI: md5.c,v 1.2 2000/11/02 11:59:24 yoshfuji Exp $ */
/* $KAME: md5.c,v 1.2 2000/05/27 07:07:48 jinmei Exp $ */
-/* $Id: md5.c,v 1.4 2005/11/03 09:00:23 paul Exp $ */
+/* $Id: md5.c,v 1.5 2006/01/17 17:40:45 paul Exp $ */
/*
* Copyright (C) 2004 6WIND
@@ -146,9 +146,10 @@ void md5_init(md5_ctxt *ctxt)
memset (ctxt->md5_buf, 0, sizeof(ctxt->md5_buf));
}
-void md5_loop(md5_ctxt *ctxt, const uint8_t *input, uint len)
+void md5_loop(md5_ctxt *ctxt, const void *vinput, uint len)
{
uint gap, i;
+ uint8_t *input = vinput;
ctxt->md5_n += len * 8; /* byte to bit */
gap = MD5_BUFLEN - ctxt->md5_i;
diff --git a/lib/md5.h b/lib/md5.h
index 9e627dd8..89b9a320 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -1,6 +1,6 @@
/* $USAGI: md5.h,v 1.2 2000/11/02 11:59:25 yoshfuji Exp $ */
/* $KAME: md5.h,v 1.4 2000/03/27 04:36:22 sumikawa Exp $ */
-/* $Id: md5.h,v 1.2 2005/11/03 09:00:23 paul Exp $ */
+/* $Id: md5.h,v 1.3 2006/01/17 17:40:45 paul Exp $ */
/*
* Copyright (C) 2004 6WIND
@@ -68,7 +68,7 @@ typedef struct {
} md5_ctxt;
extern void md5_init (md5_ctxt *);
-extern void md5_loop (md5_ctxt *, const uint8_t *, u_int);
+extern void md5_loop (md5_ctxt *, const void *, u_int);
extern void md5_pad (md5_ctxt *);
extern void md5_result (uint8_t *, md5_ctxt *);