bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incorrect large buffer handling in md5.c/sha1.c/sha256.c/sha512.c


From: Serge Belyshev
Subject: Re: incorrect large buffer handling in md5.c/sha1.c/sha256.c/sha512.c
Date: Sat, 19 May 2012 00:29:28 +0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

> I don't see a bug in sha512.c, though;
> could you please elaborate?  Thanks.

sha512.c:489:

  /* First increment the byte count.  FIPS PUB 180-2 specifies the possible
     length of the file up to 2^128 bits.  Here we only compute the
     number of bytes.  Do a double word increment.  */
  ctx->total[0] = u64plus (ctx->total[0], u64lo (len));
  if (u64lt (ctx->total[0], u64lo (len)))
    ctx->total[1] = u64plus (ctx->total[1], u64lo (1));
                                            ^^^^^^^^^

this part does exactly the same: increment ctx->total [1] by one, where
larger increment may be needed.

Thanks for the quick fix!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]