filestore: respect g_disable_hashing

If g_disable_hashing is set, behave like libnss wasn't compiled
in.
pull/5722/head
Jason Ish 4 years ago committed by Victor Julien
parent 4e57b5e665
commit e00d21a5cb

@ -181,10 +181,15 @@ void FileForceHashParseCfg(ConfNode *conf)
"found. Please use 'force-hash: [md5]' instead");
if (ConfValIsTrue(force_md5)) {
if (g_disable_hashing) {
SCLogInfo(
"not forcing md5 calculation for logged files: hashing globally disabled");
} else {
FileForceMd5Enable();
SCLogInfo("forcing md5 calculation for logged files");
}
}
}
if (conf != NULL)
forcehash_node = ConfNodeLookupChild(conf, "force-hash");
@ -194,21 +199,36 @@ void FileForceHashParseCfg(ConfNode *conf)
TAILQ_FOREACH(field, &forcehash_node->head, next) {
if (strcasecmp("md5", field->val) == 0) {
if (g_disable_hashing) {
SCLogInfo("not forcing md5 calculation for logged files: hashing globally "
"disabled");
} else {
FileForceMd5Enable();
SCLogConfig("forcing md5 calculation for logged or stored files");
}
}
if (strcasecmp("sha1", field->val) == 0) {
if (g_disable_hashing) {
SCLogInfo("not forcing sha1 calculation for logged files: hashing globally "
"disabled");
} else {
FileForceSha1Enable();
SCLogConfig("forcing sha1 calculation for logged or stored files");
}
}
if (strcasecmp("sha256", field->val) == 0) {
if (g_disable_hashing) {
SCLogInfo("not forcing sha256 calculation for logged files: hashing globally "
"disabled");
} else {
FileForceSha256Enable();
SCLogConfig("forcing sha256 calculation for logged or stored files");
}
}
}
}
}
uint16_t FileFlowToFlags(const Flow *flow, uint8_t direction)

Loading…
Cancel
Save