util-linux/lib
Karel Zak 6596057175 lib: bug (typo) in function MD5Final()
On Wed, Dec 09, 2009 at 10:08:38PM +0000, Jochen Voss wrote:
> while experimenting with coccinelle, I accidentally found what I
> believe is a bug in util-linux-ng release 2.17-rc2 (downloaded
> today). The problem is the following code in lib/md5.c (around line
> 153):
>
>     void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
>     {
>   [...]
>   memset(ctx, 0, sizeof(ctx));        /* In case it's sensitive */
>     }
>
> The third argument of memset should probably be the size of 'struct
> MD5Context' instead of the size of the pointer.  So my guess is
> that the memset line should be
>
>   memset(ctx, 0, sizeof(*ctx));       /* In case it's sensitive */
>
> instead.  I don't know whether this actually causes a problem,
> but the comment makes it seem possible that it does.

Note, this typo does not have any impact on the utils in the
util-linux-ng project, because we don't use MD5 for any security
sensitive data or cryptographic stuff. The typo also does not have any
impact to the final MD5 hashes.

Reported-by: Jochen Voss <voss@seehuhn.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2009-12-10 11:59:46 +01:00
..
.gitignore lib: wholedisk - extend API, add test program 2009-03-12 14:31:50 +01:00
Makefile.am lib: fix lib/Makefile.am (remove pttype.c) 2009-09-30 01:14:26 +02:00
blkdev.c libblkid: use BLKSSZGET for GPT sectors 2009-10-22 14:52:39 +02:00
canonicalize.c mount: and libblkid: covert /dev/dm-N to /dev/mapper/<name> 2009-10-26 13:33:03 +01:00
crc32.c lib: add a generic crc32() 2009-09-16 16:17:41 +02:00
env.c Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
fsprobe.c build-sys: add HAVE_LIBBLKID_INTERNAL 2009-10-27 12:11:37 +01:00
ismounted.c lib: import whole ismounted.c code from e2fsprogs 2009-10-14 01:13:18 +02:00
linux_version.c lib: add linux_version.{c,h} 2007-11-06 02:40:13 +01:00
md5.c lib: bug (typo) in function MD5Final() 2009-12-10 11:59:46 +01:00
setproctitle.c Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
wholedisk.c lib: wholedisk - extend API, add test program 2009-03-12 14:31:50 +01:00