}
}
+/* Return: -1 = Error, 0 = Mismatch, 1 = Match */
int HashMatch(const char StoredDigest[], const char *filename, int quiet)
{
char mode = 't';
char MsgDigest[hashbitlen/2];
if (HashWithMode(filename, MsgDigest, mode) < 0)
- return 0;
+ return -1;
if (strcmp(MsgDigest, StoredDigest)) {
printf("%s: FAILED\n", filename);
return 0;
}
+
if (quiet > 0)
printf("%s: OK\n", filename);
return 1;
}
+/* Return: -1 = some errors/mismatches, 1 = all ok */
int VerifyHashesFromFile(FILE *fp, int status, int warn, int quiet)
{
char hash[PATH_MAX + hashbitlen/4 + 4];
NotProper ++;
NoMatch ++;
}
- else if (!HashMatch(MsgDigest_tmp, file_tmp, quiet))
+ else if (HashMatch(MsgDigest_tmp, file_tmp, quiet) <= 0)
{
NoMatch++;
}