Adds support for jsDecode transformation

This commit is contained in:
Felipe Zimmerle
2015-08-05 14:41:43 -03:00
parent 4f47651a6f
commit 391002c665
10 changed files with 198 additions and 30 deletions

View File

@@ -65,18 +65,13 @@ namespace ModSecurity {
namespace actions {
namespace transformations {
Transformation::Transformation(std::string action)
: Action(action) {
this->name = this->action;
this->name.erase(0, 2);
this->action_kind = 1;
}
std::string Transformation::evaluate(std::string value,
Assay *assay) {
return value;
}
Transformation* Transformation::instantiate(std::string a) {
IF_MATCH(base64_decode_ext) { return new Base64DecodeExt(a); }
IF_MATCH(base64_decode) { return new Base64Decode(a); }
@@ -87,7 +82,7 @@ Transformation* Transformation::instantiate(std::string a) {
IF_MATCH(hex_decode) { return new HexDecode(a); }
IF_MATCH(hex_encode) { return new HexEncode(a); }
IF_MATCH(html_entity_decode) { return new HtmlEntityDecode(a); }
IF_MATCH(js_decode) { return new JsDecode(a); }
IF_MATCH(jsDecode) { return new JsDecode(a); }
IF_MATCH(length) { return new Length(a); }
IF_MATCH(lowercase) { return new LowerCase(a); }
IF_MATCH(md5) { return new Md5(a); }