aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-08-15 20:49:45 +0200
committerAndreas Jaeger <aj@suse.de>2012-08-15 20:49:45 +0200
commit02dcb6c5a240aa6c80ac55748a9ef88532427d06 (patch)
tree85be77143fae324da39c15ba39123dc9bac07c77 /crypt/md5.c
parentRemove local redefinition of MAX macro. (diff)
downloadglibc-02dcb6c5a240aa6c80ac55748a9ef88532427d06.tar.gz
glibc-02dcb6c5a240aa6c80ac55748a9ef88532427d06.tar.bz2
glibc-02dcb6c5a240aa6c80ac55748a9ef88532427d06.zip
Fix BZ#14090 - md5/sha512 with large sizes
Diffstat (limited to 'crypt/md5.c')
-rw-r--r--crypt/md5.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypt/md5.c b/crypt/md5.c
index 292bee1845..3d2e79b905 100644
--- a/crypt/md5.c
+++ b/crypt/md5.c
@@ -1,7 +1,6 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
- Copyright (C) 1995,1996,1997,1999,2000,2001,2005,2011
- Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -312,13 +311,13 @@ md5_process_block (buffer, len, ctx)
md5_uint32 B = ctx->B;
md5_uint32 C = ctx->C;
md5_uint32 D = ctx->D;
+ md5_uint32 lolen = len;
/* First increment the byte count. RFC 1321 specifies the possible
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
- ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
+ ctx->total[0] += lolen;
+ ctx->total[1] += (len >> 31 >> 1) + (ctx->total[0] < lolen);
/* Process all bytes in the buffer with 64 bytes in each round of
the loop. */