summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/md/md4c.c9
-rw-r--r--lib/libc/md/md5c.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/libc/md/md4c.c b/lib/libc/md/md4c.c
index 65dee105993..f182d518649 100644
--- a/lib/libc/md/md4c.c
+++ b/lib/libc/md/md4c.c
@@ -22,7 +22,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: md4c.c,v 1.7 1997/01/06 00:18:22 niklas Exp $";
+static char rcsid[] = "$OpenBSD: md4c.c,v 1.8 1997/01/07 10:09:00 niklas Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@@ -189,10 +189,13 @@ MD4_CTX *context; /* context */
{
unsigned char bits[8];
unsigned int index, padLen;
+ u_int32_t hi, lo;
/* Save number of bits */
- Encode (bits, ((void *)&context->count) + 4, 4);
- Encode (bits + 4, &context->count, 4);
+ hi = context->count >> 32;
+ lo = context->count & 0xffffffff;
+ Encode (bits, &lo, 4);
+ Encode (bits + 4, &hi, 4);
/* Pad out to 56 mod 64.
*/
diff --git a/lib/libc/md/md5c.c b/lib/libc/md/md5c.c
index 92d1228a111..f8ec90d6a55 100644
--- a/lib/libc/md/md5c.c
+++ b/lib/libc/md/md5c.c
@@ -23,7 +23,7 @@ documentation and/or software.
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: md5c.c,v 1.7 1997/01/06 00:18:23 niklas Exp $";
+static char rcsid[] = "$OpenBSD: md5c.c,v 1.8 1997/01/07 10:09:00 niklas Exp $";
#endif /* LIBC_SCCS and not lint */
#include <string.h>
@@ -201,10 +201,13 @@ MD5_CTX *context; /* context */
unsigned char bits[8];
unsigned int index;
size_t padLen;
+ u_int32_t hi, lo;
/* Save number of bits */
- Encode (bits, ((void *)&context->count) + 4, 4);
- Encode (bits + 4, &context->count, 4);
+ hi = context->count >> 32;
+ lo = context->count & 0xffffffff;
+ Encode (bits, &lo, 4);
+ Encode (bits + 4, &hi, 4);
/* Pad out to 56 mod 64. */
index = (unsigned int)((context->count >> 3) & 0x3f);