Adds support to the server ID generation

The server ID is a sha-1 identifier generated from the mac address of the first
ethernet device plus the server name. The process is the same used by
ModSecurity 2.9
This commit is contained in:
Felipe Zimmerle
2015-07-07 15:38:21 -03:00
parent aadbacf854
commit 2109910848
19 changed files with 813 additions and 38 deletions

View File

@@ -78,13 +78,12 @@ void perform_unit_test(std::vector<RegressionTest *> *tests,
}
modsec_assay = new ModSecurity::Assay(modsec, modsec_rules);
if (t->ip.empty() == false) {
// FIXME: no cast please.
modsec_assay->processConnection(t->ip.c_str());
actions(&r, modsec_assay->intervention());
if (r.status != 200) {
goto end;
}
modsec_assay->processConnection(t->clientIp.c_str(),
t->clientPort, t->serverIp.c_str(), t->serverPort);
actions(&r, modsec_assay->intervention());
if (r.status != 200) {
goto end;
}
if (t->uri.empty() == false) {
modsec_assay->processURI(t->uri.c_str());