Skip to content

Commit

Permalink
Add some more libsodium bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
ddpbsd committed Feb 11, 2018
1 parent bd9fa4d commit fb1ac49
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/syscheckd/run_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,12 @@ int c_read_file(const char *file_name, const char *oldsum, char *newsum)
strncpy(file_sums.sha1output, "xxx", 4);
strncpy(file_sums.sha256output, "xxx", 4);
}
#endif
#else
if (OS_MD5_SHA1_File(file_name, syscheck.prefilter_cmd, mf_sum, sf_sum, OS_BINARY) < 0) {
strncpy(sf_sum, "xxx", 4);
strncpy(mf_sum, "xxx", 4);
}
#endif
}
}
#ifndef WIN32
Expand All @@ -404,10 +405,18 @@ int c_read_file(const char *file_name, const char *oldsum, char *newsum)
if (S_ISREG(statbuf_lnk.st_mode)) {
if (sha1sum || md5sum) {
/* Generate checksums of the file */
#ifdef LIBSODIUM_ENABLED
if (OS_algorithms_File(file_name, syscheck.prefilter_cmd, file_sums, OS_BINARY, syscheck.alg) < 0) {
strncpy(file_sums.md5output, "xxx", 4);
strncpy(file_sums.sha1output, "xxx", 4);
strncpy(file_sums.sha256output, "xxx", 4);
}
#else
if (OS_MD5_SHA1_File(file_name, syscheck.prefilter_cmd, mf_sum, sf_sum, OS_BINARY) < 0) {
strncpy(sf_sum, "xxx", 4);
strncpy(mf_sum, "xxx", 4);
}
#endif
}
}
}
Expand Down

0 comments on commit fb1ac49

Please sign in to comment.