summaryrefslogtreecommitdiffstats
path: root/lib/md5.c
Commit message (Collapse)AuthorAgeFilesLines
* lib/md5: use ul_/UL_ prefixKarel Zak2017-12-121-13/+13
| | | | | | | The symbols names are too generic. Addresses: https://github.com/karelzak/util-linux/issues/548 Signed-off-by: Karel Zak <kzak@redhat.com>
* md5: declare byteReverse as staticLuca Ceresoli2017-11-081-2/+2
| | | | | | | | | | | | | byteReverse() is an internal function in md5.c, and is not exposed via any header file, but it is not declared as static. This is a problem with the md5.c file since it is copied more or less verbatim in other programs (fontconfig and pjsip among others), causing a link error when linking two of them together. Fixes link failures such as: http://autobuild.buildroot.net/results/419ab2c0e034cc68991281c51caa8271b0fadbab/build-end.log Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
* md5: fix strict aliasing warningsMike Frysinger2012-10-101-3/+6
| | | | | | | This is the same fix as was merged in gcc/binutils where this code appears to originate from. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* md5: use symbolical digest lengthSami Kerola2011-07-211-2/+2
| | | | | | | Magic hash lenght number 16 is turned to a definition MD5LENGTH, and put into use everywhere where md5 checksum is in use. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* build-sys: use WORDS_BIGENDIAN to determine platform byte-orderFabian Groffen2011-01-171-6/+1Star
| | | | | | | | | | | | Autoconf contains the right magic to determine the endianness on many platforms next to Linux. This reverses previous commits to move away from WORDS_BIGENDIAN: "use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN" This is necessary to compile on non Linux platforms like Darwin and Solaris. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* lib: bug (typo) in function MD5Final()Karel Zak2009-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* lib: add __BYTE_ORDER to md5.cKarel Zak2008-12-081-1/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.12a tarball.Karel Zak2006-12-071-13/+14
|
* Imported from util-linux-2.11x tarball.Karel Zak2006-12-071-0/+253