mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Adds md5 transformation
Replaced the old md5 implementation by the mbetls one.
This commit is contained in:
@@ -24,30 +24,21 @@
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "actions/transformations/transformation.h"
|
||||
|
||||
#include "src/utils/md5.h"
|
||||
|
||||
namespace modsecurity {
|
||||
namespace actions {
|
||||
namespace transformations {
|
||||
|
||||
Md5::Md5(std::string action)
|
||||
: Transformation(action) {
|
||||
this->action_kind = 1;
|
||||
}
|
||||
|
||||
std::string Md5::evaluate(std::string value,
|
||||
Transaction *transaction) {
|
||||
/**
|
||||
* @todo Implement the transformation Md5
|
||||
*/
|
||||
if (transaction) {
|
||||
#ifndef NO_LOGS
|
||||
transaction->debug(4, "Transformation Md5 is not implemented yet.");
|
||||
#endif
|
||||
}
|
||||
return value;
|
||||
std::string ret = Utils::Md5::digest(value);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
} // namespace transformations
|
||||
} // namespace actions
|
||||
} // namespace modsecurity
|
||||
|
@@ -30,9 +30,9 @@ namespace transformations {
|
||||
|
||||
class Md5 : public Transformation {
|
||||
public:
|
||||
explicit Md5(std::string action);
|
||||
std::string
|
||||
evaluate(std::string exp,
|
||||
explicit Md5(std::string action) : Transformation(action) { }
|
||||
|
||||
std::string evaluate(std::string exp,
|
||||
Transaction *transaction) override;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user