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
This commit is contained in:
Eitan Adler 2018-05-23 11:45:46 +00:00
parent 272b99f722
commit aa677d07a1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334091

View File

@ -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)