aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2018-05-23 11:45:46 +0000
committerEitan Adler <eadler@FreeBSD.org>2018-05-23 11:45:46 +0000
commitaa677d07a1b9846933410c7e5d0e92a4cbfb5444 (patch)
tree2b89ed1e6e828a569778e05a243077fc1533f0b3 /sbin
parent272b99f722ceddeb3554e475b667c9f72f1e31b5 (diff)
downloadsrc-aa677d07a1b9846933410c7e5d0e92a4cbfb5444.tar.gz
src-aa677d07a1b9846933410c7e5d0e92a4cbfb5444.zip
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
Notes
Notes: svn path=/head/; revision=334091
Diffstat (limited to 'sbin')
-rw-r--r--sbin/md5/md5.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/md5/md5.c b/sbin/md5/md5.c
index 9f54d60c193a..858e80b5d010 100644
--- a/sbin/md5/md5.c
+++ b/sbin/md5/md5.c
@@ -243,7 +243,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)
@@ -282,7 +282,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)