Renames class Assay to Transaction

This commit is contained in:
Felipe Zimmerle
2016-01-13 14:38:37 -03:00
parent f3fd5d6621
commit a51e707517
249 changed files with 2961 additions and 1235 deletions

View File

@@ -23,7 +23,7 @@ MAINTAINERCLEANFILES = \
pkginclude_HEADERS = \
../headers/modsecurity/assay.h \
../headers/modsecurity/transaction.h \
../headers/modsecurity/debug_log.h \
../headers/modsecurity/intervention.h \
../headers/modsecurity/modsecurity.h \
@@ -176,7 +176,7 @@ libmodsecurity_la_SOURCES = \
parser/seclang-parser.yy \
parser/seclang-scanner.ll \
parser/driver.cc \
assay.cc \
transaction.cc \
audit_log.cc \
audit_log_writer.cc \
audit_log_writer_serial.cc \

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "actions/block.h"
@@ -42,12 +42,12 @@ namespace actions {
std::string Action::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
return value;
}
bool Action::evaluate(Rule *rule, Assay *assay) {
bool Action::evaluate(Rule *rule, Transaction *transaction) {
return true;
}

View File

@@ -24,7 +24,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
class Rule;
namespace actions {
@@ -87,8 +87,8 @@ class Action {
std::string name;
virtual std::string evaluate(std::string exp,
Assay *assay);
virtual bool evaluate(Rule *rule, Assay *assay);
Transaction *transaction);
virtual bool evaluate(Rule *rule, Transaction *transaction);
virtual bool init(std::string *error) { return true; }
virtual bool isDisruptive() { return false; }

View File

@@ -18,13 +18,13 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
namespace modsecurity {
namespace actions {
bool AuditLog::evaluate(Rule *rule, Assay *assay) {
assay->save_in_auditlog = true;
bool AuditLog::evaluate(Rule *rule, Transaction *transaction) {
transaction->save_in_auditlog = true;
return true;
}

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_AUDIT_LOG_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -34,7 +34,7 @@ class AuditLog : public Action {
explicit AuditLog(std::string action)
: Action(action, RunTimeOnlyIfMatchKind) { }
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
};
} // namespace actions

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "modsecurity/intervention.h"
@@ -32,13 +32,13 @@ Block::Block(std::string action)
}
bool Block::evaluate(Rule *rule, Assay *assay) {
bool Block::evaluate(Rule *rule, Transaction *transaction) {
#ifndef NO_LOGS
assay->debug(8, "Running action block");
transaction->debug(8, "Running action block");
#endif
for (Action *a : rule->actions_runtime_pos) {
if (a->isDisruptive() == true) {
assay->actions.push_back(a);
transaction->actions.push_back(a);
}
}
return true;

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_BLOCK_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -33,7 +33,7 @@ class Block : public Action {
public:
explicit Block(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
void fill_intervention(ModSecurityIntervention *i) override;
bool isDisruptive() override { return true; }
};

View File

@@ -19,7 +19,7 @@
#include <string>
#include <list>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "operators/operator.h"
@@ -31,7 +31,7 @@
namespace modsecurity {
namespace actions {
bool Capture::evaluate(Rule *rule, Assay *assay) {
bool Capture::evaluate(Rule *rule, Transaction *transaction) {
operators::Operator *op = rule->op;
std::list<std::string> *match;
@@ -61,7 +61,7 @@ bool Capture::evaluate(Rule *rule, Assay *assay) {
int i = 0;
while (match->empty() == false) {
assay->m_collections.storeOrUpdateFirst("TX",
transaction->m_collections.storeOrUpdateFirst("TX",
std::to_string(i), match->back());
match->pop_back();
i++;

View File

@@ -31,7 +31,7 @@ class Capture : public Action {
explicit Capture(std::string action)
: Action(action, RunTimeOnlyIfMatchKind) { }
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
};

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
namespace modsecurity {
@@ -26,7 +26,7 @@ namespace actions {
bool Chain::evaluate(Rule *rule, Assay *assay) {
bool Chain::evaluate(Rule *rule, Transaction *transaction) {
rule->chained = true;
return true;
}

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_CHAIN_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
class Rule;
namespace actions {
@@ -35,7 +35,7 @@ class Chain : public Action {
explicit Chain(std::string action)
: Action(action, ConfigurationKind) { }
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
};
} // namespace actions

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
namespace modsecurity {
namespace actions {
@@ -35,8 +35,9 @@ CtlAuditLogParts::CtlAuditLogParts(std::string action)
}
}
bool CtlAuditLogParts::evaluate(Rule *rule, Assay *assay) {
assay->auditLogModifier.push_back(std::make_pair(mPartsAction, mParts));
bool CtlAuditLogParts::evaluate(Rule *rule, Transaction *transaction) {
transaction->auditLogModifier.push_back(
std::make_pair(mPartsAction, mParts));
return true;
}

View File

@@ -16,7 +16,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#ifndef SRC_ACTIONS_CTL_AUDIT_LOG_PARTS_H_
#define SRC_ACTIONS_CTL_AUDIT_LOG_PARTS_H_
@@ -29,7 +29,7 @@ class CtlAuditLogParts : public Action {
public:
explicit CtlAuditLogParts(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
int mPartsAction;
std::string mParts;
};

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
namespace modsecurity {
namespace actions {
@@ -30,11 +30,11 @@ Deny::Deny(std::string action)
}
bool Deny::evaluate(Rule *rule, Assay *assay) {
bool Deny::evaluate(Rule *rule, Transaction *transaction) {
#ifndef NO_LOGS
assay->debug(8, "Running action deny");
transaction->debug(8, "Running action deny");
#endif
assay->actions.push_back(this);
transaction->actions.push_back(this);
return true;
}

View File

@@ -16,7 +16,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#ifndef SRC_ACTIONS_DENY_H_
#define SRC_ACTIONS_DENY_H_
@@ -29,7 +29,7 @@ class Deny : public Action {
public:
explicit Deny(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
void fill_intervention(ModSecurityIntervention *i) override;
bool isDisruptive() override { return true; }
};

View File

@@ -19,7 +19,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/utils.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
@@ -50,9 +50,9 @@ bool InitCol::init(std::string *error) {
}
bool InitCol::evaluate(Rule *rule, Assay *assay) {
bool InitCol::evaluate(Rule *rule, Transaction *transaction) {
std::string collectionName;
collectionName = MacroExpansion::expand(m_collection_value, assay);
collectionName = MacroExpansion::expand(m_collection_value, transaction);
return true;
}

View File

@@ -20,10 +20,10 @@
#ifndef SRC_ACTIONS_INIT_COL_H_
#define SRC_ACTIONS_INIT_COL_H_
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -31,7 +31,7 @@ class InitCol : public Action {
public:
explicit InitCol(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
bool init(std::string *error) override;
private:
std::string m_collection_key;

View File

@@ -18,15 +18,15 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
namespace modsecurity {
namespace actions {
bool Log::evaluate(Rule *rule, Assay *assay) {
assay->save_in_auditlog = true;
/* FIXME: assay->serverLog("Something...."); */
assay->debug(9, "Saving transaction to logs");
bool Log::evaluate(Rule *rule, Transaction *transaction) {
transaction->save_in_auditlog = true;
/* FIXME: transaction->serverLog("Something...."); */
transaction->debug(9, "Saving transaction to logs");
return true;
}

View File

@@ -20,10 +20,10 @@
#ifndef SRC_ACTIONS_LOG_H_
#define SRC_ACTIONS_LOG_H_
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -32,7 +32,7 @@ class Log : public Action {
explicit Log(std::string action)
: Action(action, RunTimeOnlyIfMatchKind) { }
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
};
} // namespace actions

View File

@@ -19,7 +19,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/utils.h"
#include "src/macro_expansion.h"
@@ -34,13 +34,13 @@ LogData::LogData(std::string action)
}
bool LogData::evaluate(Rule *rule, Assay *assay) {
std::string msg = MacroExpansion::expand(m_data, assay);
bool LogData::evaluate(Rule *rule, Transaction *transaction) {
std::string msg = MacroExpansion::expand(m_data, transaction);
#ifndef NO_LOGS
assay->debug(9, "Saving msg: " + msg);
transaction->debug(9, "Saving msg: " + msg);
#endif
assay->rulesMessages.push_back(msg);
assay->serverLog(msg);
transaction->rulesMessages.push_back(msg);
transaction->serverLog(msg);
return true;
}

View File

@@ -20,10 +20,10 @@
#ifndef SRC_ACTIONS_LOG_DATA_H_
#define SRC_ACTIONS_LOG_DATA_H_
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -31,7 +31,7 @@ class LogData : public Action {
public:
explicit LogData(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
private:
std::string m_data;

View File

@@ -19,7 +19,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/utils.h"
#include "src/macro_expansion.h"
@@ -34,13 +34,13 @@ Msg::Msg(std::string action)
}
bool Msg::evaluate(Rule *rule, Assay *assay) {
std::string msg = MacroExpansion::expand(m_msg, assay);
bool Msg::evaluate(Rule *rule, Transaction *transaction) {
std::string msg = MacroExpansion::expand(m_msg, transaction);
#ifndef NO_LOGS
assay->debug(9, "Saving msg: " + msg);
transaction->debug(9, "Saving msg: " + msg);
#endif
assay->rulesMessages.push_back(msg);
assay->serverLog(msg);
transaction->rulesMessages.push_back(msg);
transaction->serverLog(msg);
return true;
}

View File

@@ -20,10 +20,10 @@
#ifndef SRC_ACTIONS_MSG_H_
#define SRC_ACTIONS_MSG_H_
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -31,7 +31,7 @@ class Msg : public Action {
public:
explicit Msg(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
private:
std::string m_msg;

View File

@@ -18,13 +18,13 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
namespace modsecurity {
namespace actions {
bool NoAuditLog::evaluate(Rule *rule, Assay *assay) {
assay->do_not_save_in_auditlog = true;
bool NoAuditLog::evaluate(Rule *rule, Transaction *transaction) {
transaction->do_not_save_in_auditlog = true;
return true;
}

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_NO_AUDIT_LOG_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -34,7 +34,7 @@ class NoAuditLog : public Action {
explicit NoAuditLog(std::string action)
: Action(action, RunTimeOnlyIfMatchKind) { }
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
};
} // namespace actions

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
namespace modsecurity {
@@ -31,8 +31,8 @@ Pass::Pass(std::string action)
}
bool Pass::evaluate(Rule *rule, Assay *assay) {
assay->actions.clear();
bool Pass::evaluate(Rule *rule, Transaction *transaction) {
transaction->actions.clear();
return true;
}

View File

@@ -16,7 +16,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#ifndef SRC_ACTIONS_PASS_H_
#define SRC_ACTIONS_PASS_H_
@@ -29,7 +29,7 @@ class Pass : public Action {
public:
explicit Pass(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
bool isDisruptive() override { return true; }
};

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/utils.h"
#include "modsecurity/modsecurity.h"
@@ -77,7 +77,7 @@ bool Phase::init(std::string *error) {
}
bool Phase::evaluate(Rule *rule, Assay *assay) {
bool Phase::evaluate(Rule *rule, Transaction *transaction) {
rule->phase = this->phase;
return true;
}

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_PHASE_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
class Rule;
namespace actions {
@@ -35,7 +35,7 @@ class Phase : public Action {
explicit Phase(std::string action);
bool init(std::string *error) override;
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
int phase;
int m_secRulesPhase;
};

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/macro_expansion.h"
namespace modsecurity {
@@ -41,9 +41,9 @@ Redirect::Redirect(const std::string& action)
}
bool Redirect::evaluate(Rule *rule, Assay *assay) {
m_urlExpanded = MacroExpansion::expand(m_url, assay);
assay->actions.push_back(this);
bool Redirect::evaluate(Rule *rule, Transaction *transaction) {
m_urlExpanded = MacroExpansion::expand(m_url, transaction);
transaction->actions.push_back(this);
return true;
}

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_REDIRECT_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -33,7 +33,7 @@ class Redirect : public Action {
explicit Redirect(const std::string &action);
~Redirect() override;
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
void fill_intervention(ModSecurityIntervention *i) override;
bool isDisruptive() override { return true; }
private:

View File

@@ -19,7 +19,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/utils.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
@@ -37,7 +37,7 @@ Rev::Rev(std::string action)
}
bool Rev::evaluate(Rule *rule, Assay *assay) {
bool Rev::evaluate(Rule *rule, Transaction *transaction) {
rule->rev = m_rev;
return true;
}

View File

@@ -20,10 +20,10 @@
#ifndef SRC_ACTIONS_REV_H_
#define SRC_ACTIONS_REV_H_
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -31,7 +31,7 @@ class Rev : public Action {
public:
explicit Rev(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
private:
std::string m_rev;

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
namespace modsecurity {
@@ -51,7 +51,7 @@ bool RuleId::init(std::string *error) {
return true;
}
bool RuleId::evaluate(Rule *rule, Assay *assay) {
bool RuleId::evaluate(Rule *rule, Transaction *transaction) {
rule->rule_id = m_ruleId;
return true;
}

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_RULE_ID_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
class Rule;
namespace actions {
@@ -37,7 +37,7 @@ class RuleId : public Action {
m_ruleId(0) { }
bool init(std::string *error) override;
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
private:
double m_ruleId;

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "modsecurity/rule.h"
#include "src/macro_expansion.h"
#include "src/utils.h"
@@ -99,11 +99,11 @@ void SetVar::dump() {
std::cout << " Predicate: " << predicate << std::endl;
}
bool SetVar::evaluate(Rule *rule, Assay *assay) {
bool SetVar::evaluate(Rule *rule, Transaction *transaction) {
std::string targetValue;
std::string variableNameExpanded = MacroExpansion::expand(variableName,
assay);
std::string resolvedPre = MacroExpansion::expand(predicate, assay);
transaction);
std::string resolvedPre = MacroExpansion::expand(predicate, transaction);
if (operation == setOperation) {
targetValue = resolvedPre;
@@ -121,7 +121,7 @@ bool SetVar::evaluate(Rule *rule, Assay *assay) {
try {
std::string *resolvedValue =
assay->m_collections.resolveFirst(collectionName,
transaction->m_collections.resolveFirst(collectionName,
variableNameExpanded);
if (resolvedValue == NULL) {
value = 0;
@@ -143,10 +143,10 @@ bool SetVar::evaluate(Rule *rule, Assay *assay) {
}
#ifndef NO_LOGS
assay->debug(8, "Saving variable: " + collectionName + ":" + \
transaction->debug(8, "Saving variable: " + collectionName + ":" + \
variableNameExpanded + " with value: " + targetValue);
#endif
assay->m_collections.storeOrUpdateFirst(collectionName,
transaction->m_collections.storeOrUpdateFirst(collectionName,
variableNameExpanded, targetValue);
return true;

View File

@@ -21,7 +21,7 @@
#define SRC_ACTIONS_SET_VAR_H_
namespace modsecurity {
class Assay;
class Transaction;
class Rule;
namespace actions {
@@ -31,7 +31,7 @@ class SetVar : public Action {
public:
explicit SetVar(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
void dump();
bool init(std::string *error) override;

View File

@@ -19,7 +19,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/utils.h"
namespace modsecurity {
@@ -50,15 +50,15 @@ Severity::Severity(std::string action)
}
bool Severity::evaluate(Rule *rule, Assay *assay) {
bool Severity::evaluate(Rule *rule, Transaction *transaction) {
#ifndef NO_LOGS
assay->debug(9, "This rule severity is: " + \
std::to_string(this->m_severity) + " current assay is: " + \
std::to_string(assay->highest_severity));
transaction->debug(9, "This rule severity is: " + \
std::to_string(this->m_severity) + " current transaction is: " + \
std::to_string(transaction->highest_severity));
#endif
if (assay->highest_severity > this->m_severity) {
assay->highest_severity = this->m_severity;
if (transaction->highest_severity > this->m_severity) {
transaction->highest_severity = this->m_severity;
}
return true;
}

View File

@@ -21,10 +21,10 @@
#define SRC_ACTIONS_SEVERITY_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -33,7 +33,7 @@ class Severity : public Action {
public:
explicit Severity(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
private:
int m_severity;

View File

@@ -19,7 +19,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/utils.h"
namespace modsecurity {
@@ -31,11 +31,11 @@ SkipAfter::SkipAfter(std::string action)
}
bool SkipAfter::evaluate(Rule *rule, Assay *assay) {
bool SkipAfter::evaluate(Rule *rule, Transaction *transaction) {
#ifndef NO_LOGS
assay->debug(5, "Setting skipAfter for: " + m_marker);
transaction->debug(5, "Setting skipAfter for: " + m_marker);
#endif
assay->m_marker = m_marker;
transaction->m_marker = m_marker;
return true;
}

View File

@@ -20,10 +20,10 @@
#ifndef SRC_ACTIONS_SKIP_AFTER_H_
#define SRC_ACTIONS_SKIP_AFTER_H_
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -31,7 +31,7 @@ class SkipAfter : public Action {
public:
explicit SkipAfter(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
private:
std::string m_marker;

View File

@@ -18,7 +18,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
namespace modsecurity {
namespace actions {
@@ -33,8 +33,8 @@ Status::Status(std::string action)
}
bool Status::evaluate(Rule *rule, Assay *assay) {
assay->actions.push_back(this);
bool Status::evaluate(Rule *rule, Transaction *transaction) {
transaction->actions.push_back(this);
return true;
}

View File

@@ -21,17 +21,17 @@
#define SRC_ACTIONS_STATUS_H_
#ifdef __cplusplus
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
class Status : public Action {
public:
explicit Status(std::string actions);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
void fill_intervention(ModSecurityIntervention *i) override;
int status;
};

View File

@@ -19,7 +19,7 @@
#include <string>
#include "actions/action.h"
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "src/utils.h"
#include "src/macro_expansion.h"
@@ -34,12 +34,12 @@ Tag::Tag(std::string action)
}
bool Tag::evaluate(Rule *rule, Assay *assay) {
std::string tag = MacroExpansion::expand(m_tag, assay);
bool Tag::evaluate(Rule *rule, Transaction *transaction) {
std::string tag = MacroExpansion::expand(m_tag, transaction);
#ifndef NO_LOGS
assay->debug(9, "Rule tag: " + tag);
transaction->debug(9, "Rule tag: " + tag);
#endif
assay->ruleTags.push_back(tag);
transaction->ruleTags.push_back(tag);
return true;
}

View File

@@ -20,10 +20,10 @@
#ifndef SRC_ACTIONS_TAG_H_
#define SRC_ACTIONS_TAG_H_
class Assay;
class Transaction;
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
@@ -31,7 +31,7 @@ class Tag : public Action {
public:
explicit Tag(std::string action);
bool evaluate(Rule *rule, Assay *assay) override;
bool evaluate(Rule *rule, Transaction *transaction) override;
private:
std::string m_tag;

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ Base64Decode::Base64Decode(std::string action)
}
std::string Base64Decode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation base64decode
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation 64 is not implemented yet.");
transaction->debug(4, "Transformation 64 is not implemented yet.");
#endif
}
return value;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class Base64Decode : public Transformation {
public:
explicit Base64Decode(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ Base64DecodeExt::Base64DecodeExt(std::string action)
}
std::string Base64DecodeExt::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation Base64DecodeExt
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation Base64DecodeExt is" \
transaction->debug(4, "Transformation Base64DecodeExt is" \
" not implemented yet.");
#endif
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class Base64DecodeExt : public Transformation {
public:
explicit Base64DecodeExt(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ CmdLine::CmdLine(std::string action)
}
std::string CmdLine::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation CmdLine
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation CmdLine is not implemented yet.");
transaction->debug(4, "Transformation CmdLine is not implemented yet.");
#endif
}
return value;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class CmdLine : public Transformation {
public:
explicit CmdLine(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,7 +36,7 @@ CompressWhitespace::CompressWhitespace(std::string action)
}
std::string CompressWhitespace::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
std::string a;
int inWhiteSpace = 0;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class CompressWhitespace : public Transformation {
public:
explicit CompressWhitespace(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -24,7 +24,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -35,7 +35,7 @@ namespace transformations {
std::string CssDecode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
char *tmp = reinterpret_cast<char *>(
malloc(sizeof(char) * value.size() + 1));

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -34,7 +34,7 @@ class CssDecode : public Transformation {
explicit CssDecode(std::string action)
: Transformation(action) { }
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -140,7 +140,7 @@ int EscapeSeqDecode::ansi_c_sequences_decode_inplace(unsigned char *input,
std::string EscapeSeqDecode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
unsigned char *tmp = (unsigned char *) malloc(sizeof(char)
* value.size() + 1);

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class EscapeSeqDecode : public Transformation {
public:
explicit EscapeSeqDecode(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
int ansi_c_sequences_decode_inplace(unsigned char *input, int input_len);
};

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -38,7 +38,7 @@ HexDecode::HexDecode(std::string action)
std::string HexDecode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
int len = value.length();
std::string newString;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class HexDecode : public Transformation {
public:
explicit HexDecode(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -23,7 +23,7 @@
#include <locale>
#include <iterator>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -37,7 +37,7 @@ HexEncode::HexEncode(std::string action)
}
std::string HexEncode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
std::stringstream result;
for (std::size_t i=0; i < value.length(); i++) {

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class HexEncode : public Transformation {
public:
explicit HexEncode(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -24,7 +24,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -35,7 +35,7 @@ namespace transformations {
std::string HtmlEntityDecode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
if (HtmlEntityDecodeInstantCache::getInstance().count(value) > 0) {
return HtmlEntityDecodeInstantCache::getInstance().at(value);

View File

@@ -24,7 +24,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -55,7 +55,7 @@ class HtmlEntityDecode : public Transformation {
: Transformation(action) { }
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};

View File

@@ -24,7 +24,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -35,7 +35,7 @@ namespace transformations {
std::string JsDecode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
char *val = reinterpret_cast<char *>(
malloc(sizeof(char) * value.size() + 1));

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -34,7 +34,7 @@ class JsDecode : public Transformation {
: Transformation(action) { }
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,7 +36,7 @@ Length::Length(std::string action)
}
std::string Length::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
return std::to_string(value.size());
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class Length : public Transformation {
public:
explicit Length(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -18,7 +18,7 @@
#include <algorithm>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "actions/action.h"
@@ -32,7 +32,7 @@ LowerCase::LowerCase(std::string a)
}
std::string LowerCase::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
std::locale loc;
if (LowerCaseInstantCache::getInstance().count(value) > 0) {

View File

@@ -25,7 +25,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -52,7 +52,7 @@ class LowerCase : public Transformation {
public:
explicit LowerCase(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ Md5::Md5(std::string action)
}
std::string Md5::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation Md5
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation Md5 is not implemented yet.");
transaction->debug(4, "Transformation Md5 is not implemented yet.");
#endif
}
return value;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -33,7 +33,7 @@ class Md5 : public Transformation {
explicit Md5(std::string action);
std::string
evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -32,7 +32,7 @@ namespace transformations {
std::string None::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
return value;
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -35,7 +35,7 @@ class None : public Transformation {
{ m_isNone = true; }
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -24,7 +24,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -39,7 +39,7 @@ NormalisePath::NormalisePath(std::string action)
}
std::string NormalisePath::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
int changed = 0;
char *tmp = reinterpret_cast<char *>(

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class NormalisePath : public Transformation {
public:
explicit NormalisePath(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -24,7 +24,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -35,7 +35,7 @@ namespace transformations {
std::string NormalisePathWin::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
int changed;
char *tmp = reinterpret_cast<char *>(

View File

@@ -23,7 +23,7 @@
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -34,7 +34,7 @@ class NormalisePathWin : public Transformation {
: Transformation(action) { }
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ ParityEven7bit::ParityEven7bit(std::string action)
}
std::string ParityEven7bit::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation ParityEven7bit
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation ParityEven7bit is not" \
transaction->debug(4, "Transformation ParityEven7bit is not" \
" implemented yet.");
#endif
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class ParityEven7bit : public Transformation {
public:
explicit ParityEven7bit(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ ParityOdd7bit::ParityOdd7bit(std::string action)
}
std::string ParityOdd7bit::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation ParityOdd7bit
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation ParityOdd7bit is not " \
transaction->debug(4, "Transformation ParityOdd7bit is not " \
"implemented yet.");
#endif
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class ParityOdd7bit : public Transformation {
public:
explicit ParityOdd7bit(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ ParityZero7bit::ParityZero7bit(std::string action)
}
std::string ParityZero7bit::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation ParityZero7bit
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation ParityZero7bit is not" \
transaction->debug(4, "Transformation ParityZero7bit is not" \
"implemented yet.");
#endif
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class ParityZero7bit : public Transformation {
public:
explicit ParityZero7bit(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ RemoveComments::RemoveComments(std::string action)
}
std::string RemoveComments::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation RemoveComments
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation RemoveComments is not " \
transaction->debug(4, "Transformation RemoveComments is not " \
"implemented yet.");
#endif
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class RemoveComments : public Transformation {
public:
explicit RemoveComments(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ RemoveCommentsChar::RemoveCommentsChar(std::string action)
}
std::string RemoveCommentsChar::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation RemoveCommentsChar
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation RemoveCommentsChar " \
transaction->debug(4, "Transformation RemoveCommentsChar " \
"is not implemented yet.");
#endif
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class RemoveCommentsChar : public Transformation {
public:
explicit RemoveCommentsChar(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -24,7 +24,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -34,7 +34,7 @@ namespace transformations {
std::string RemoveNulls::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
int64_t i;
i = 0;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -34,7 +34,7 @@ class RemoveNulls : public Transformation {
: Transformation(action) { }
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,13 @@ RemoveWhitespace::RemoveWhitespace(std::string action)
}
std::string RemoveWhitespace::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation RemoveWhitespace
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation RemoveWhitespace is " \
transaction->debug(4, "Transformation RemoveWhitespace is " \
"not implemented yet.");
#endif
}

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class RemoveWhitespace : public Transformation {
public:
explicit RemoveWhitespace(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "src/utils.h"
@@ -37,7 +37,7 @@ ReplaceComments::ReplaceComments(std::string action)
}
std::string ReplaceComments::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
uint64_t i, j, incomment;
char *input = reinterpret_cast<char *>(

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class ReplaceComments : public Transformation {
public:
explicit ReplaceComments(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,7 +36,7 @@ ReplaceNulls::ReplaceNulls(std::string action)
}
std::string ReplaceNulls::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
int64_t i;
i = 0;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class ReplaceNulls : public Transformation {
public:
explicit ReplaceNulls(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
#include "utils/sha1.h"
#include "src/utils.h"
@@ -38,7 +38,7 @@ Sha1::Sha1(std::string action)
}
std::string Sha1::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
Utils::SHA1 sha1;
sha1.update(&value);

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -32,7 +32,7 @@ class Sha1 : public Transformation {
public:
explicit Sha1(std::string action);
std::string evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -22,7 +22,7 @@
#include <cctype>
#include <locale>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/transformations/transformation.h"
@@ -36,13 +36,14 @@ SqlHexDecode::SqlHexDecode(std::string action)
}
std::string SqlHexDecode::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
/**
* @todo Implement the transformation SqlHexDecode
*/
if (assay) {
if (transaction) {
#ifndef NO_LOGS
assay->debug(4, "Transformation SqlHexDecode is not implemented yet.");
transaction->debug(4, "Transformation SqlHexDecode " \
"is not implemented yet.");
#endif
}
return value;

View File

@@ -23,7 +23,7 @@
#ifdef __cplusplus
namespace modsecurity {
class Assay;
class Transaction;
namespace actions {
namespace transformations {
@@ -33,7 +33,7 @@ class SqlHexDecode : public Transformation {
explicit SqlHexDecode(std::string action);
std::string
evaluate(std::string exp,
Assay *assay) override;
Transaction *transaction) override;
};
} // namespace transformations

View File

@@ -20,7 +20,7 @@
#include <iostream>
#include <string>
#include "modsecurity/assay.h"
#include "modsecurity/transaction.h"
#include "actions/action.h"
#include "actions/transformations/base64_decode_ext.h"
#include "actions/transformations/base64_decode.h"
@@ -67,7 +67,7 @@ namespace transformations {
std::string Transformation::evaluate(std::string value,
Assay *assay) {
Transaction *transaction) {
return value;
}

Some files were not shown because too many files have changed in this diff Show More