> On Oct 26, 2017, at 1:18 PM, zhang j <jullyzh...@gmail.com> wrote: > > Hi All, > > I have a question about md5sum of a 0 sized file. The md5sum of a 0 sized > file built using rpm 5.4 on RHE 7 is 00000000000000000000000000000000. If do > 'rpm -qp --dump' of that rpm, the md5sum is shown > 00000000000000000000000000000000. >
You are correct that the MD5 of a zero length file is not zeroes: $ md5sum < /dev/null d41d8cd98f00b204e9800998ecf8427e - Are you sure this is rpm 5.4 (and not rpm4) on RHEL 7? There’s a fair amount of work in switching rpm4 -> rpm5 on RHEL7, congratulations if you succeeded! Also: MD5 (for file digests) has largely been replaced with SHA256 everywhere in *.rpm packages. > > But the real md5sum of that file is not 00000000000000000000000000000000. How > to build the correct md5sum in the rpm? > I dimly remember someone objecting to the overhead of computing digests of empty files in *.rpm packages like 8-10 years ago (but I could be mis-remembering). That would have involved a patch to (likely) skip computing the digest for zero length files that (wrongly) returns the contents of a calloc’d buffer as 00000000000000000000000000000000. 73 de Jeff > > Thanks, > Juan