svn commit: r334870 - stable/11/sbin/md5
Eitan Adler
eadler at FreeBSD.org
Sat Jun 9 03:01:39 UTC 2018
Author: eadler
Date: Sat Jun 9 03:01:38 2018
New Revision: 334870
URL: https://svnweb.freebsd.org/changeset/base/334870
Log:
MFC r334091:
md5: perform compare case-insenstive
md5 generates a md5 hash lowercase, but it might be provided in
uppercase. Allow this.
PR: 205598
Reported by: ohauer
MFC After: 2 weeks
Modified:
stable/11/sbin/md5/md5.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sbin/md5/md5.c
==============================================================================
--- stable/11/sbin/md5/md5.c Sat Jun 9 02:47:02 2018 (r334869)
+++ stable/11/sbin/md5/md5.c Sat Jun 9 03:01:38 2018 (r334870)
@@ -220,7 +220,7 @@ main(int argc, char *argv[])
else
printf("%s (%s) = %s",
Algorithm[digest].name, *argv, p);
- if (checkAgainst && strcmp(checkAgainst,p))
+ if (checkAgainst && strcasecmp(checkAgainst, p) != 0)
{
checksFailed++;
if (!qflag)
@@ -255,7 +255,7 @@ MDString(const Algorithm_t *alg, const char *string)
printf("%s \"%s\"", buf, string);
else
printf("%s (\"%s\") = %s", alg->name, string, buf);
- if (checkAgainst && strcmp(buf,checkAgainst))
+ if (checkAgainst && strcasecmp(buf,checkAgainst) != 0)
{
checksFailed++;
if (!qflag)
More information about the svn-src-all
mailing list