"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/utils/test/js_test_utils.h" between
snort3-3.1.29.0.tar.gz and snort3-3.1.30.0.tar.gz

About: Snort 3 is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

js_test_utils.h  (snort3-3.1.29.0):js_test_utils.h  (snort3-3.1.30.0)
skipping to change at line 38 skipping to change at line 38
#include "utils/js_identifier_ctx.h" #include "utils/js_identifier_ctx.h"
#include "utils/js_normalizer.h" #include "utils/js_normalizer.h"
constexpr int unlim_depth = -1; constexpr int unlim_depth = -1;
constexpr int norm_depth = 65535; constexpr int norm_depth = 65535;
constexpr int max_template_nesting = 4; constexpr int max_template_nesting = 4;
constexpr int max_bracket_depth = 256; constexpr int max_bracket_depth = 256;
constexpr int max_scope_depth = 256; constexpr int max_scope_depth = 256;
static const std::unordered_set<std::string> s_ignored_ids { static const std::unordered_set<std::string> s_ignored_ids {
"console", "eval", "document", "unescape", "decodeURI", "decodeURIComponent" "console", "eval", "document", "unescape", "decodeURI", "decodeURIComponent"
, "String" , "String",
"name", "u"
};
static const std::unordered_set<std::string> s_ignored_props {
"watch", "unwatch", "split", "reverse", "join", "name", "w"
}; };
namespace snort namespace snort
{ {
[[noreturn]] void FatalError(const char*, ...); [[noreturn]] void FatalError(const char*, ...);
void trace_vprintf(const char*, TraceLevel, const char*, const Packet*, const ch ar*, va_list); void trace_vprintf(const char*, TraceLevel, const char*, const Packet*, const ch ar*, va_list);
} }
class JSIdentifierCtxStub : public JSIdentifierCtxBase class JSIdentifierCtxStub : public JSIdentifierCtxBase
{ {
public: public:
JSIdentifierCtxStub() = default; JSIdentifierCtxStub() = default;
const char* substitute(const char* identifier) override const char* substitute(const char* identifier, bool) override
{ return identifier; } { return identifier; }
virtual void add_alias(const char*, const std::string&&) override {} virtual void add_alias(const char*, const std::string&&) override {}
virtual const char* alias_lookup(const char* alias) const override virtual const char* alias_lookup(const char* alias) const override
{ return alias; } { return alias; }
bool is_ignored(const char*) const override bool is_ignored(const char*) const override
{ return false; } { return false; }
bool scope_push(JSProgramScopeType) override { return true; } bool scope_push(JSProgramScopeType) override { return true; }
bool scope_pop(JSProgramScopeType) override { return true; } bool scope_pop(JSProgramScopeType) override { return true; }
void reset() override {} void reset() override {}
size_t size() const override { return 0; } size_t size() const override { return 0; }
}; };
class JSTokenizerTester class JSTokenizerTester
{ {
public: public:
JSTokenizerTester(int32_t depth, uint32_t max_scope_depth, JSTokenizerTester(int32_t depth, uint32_t max_scope_depth,
const std::unordered_set<std::string>& ignored_ids, const std::unordered_set<std::string>& ignored_ids,
const std::unordered_set<std::string>& ignored_props,
uint8_t max_template_nesting, uint32_t max_bracket_depth) uint8_t max_template_nesting, uint32_t max_bracket_depth)
: :
ident_ctx(depth, max_scope_depth, ignored_ids), ident_ctx(depth, max_scope_depth, ignored_ids, ignored_props),
normalizer(ident_ctx, depth, max_template_nesting, max_bracket_depth) normalizer(ident_ctx, depth, max_template_nesting, max_bracket_depth)
{ } { }
typedef JSTokenizer::FuncType FuncType; typedef JSTokenizer::FuncType FuncType;
typedef std::tuple<const char*, const char*, std::list<FuncType>> ScopeCase; typedef std::tuple<const char*, const char*, std::list<FuncType>> ScopeCase;
void test_function_scopes(const std::list<ScopeCase>& pdus); void test_function_scopes(const std::list<ScopeCase>& pdus);
bool is_unescape_nesting_seen() const; bool is_unescape_nesting_seen() const;
private: private:
JSIdentifierCtx ident_ctx; JSIdentifierCtx ident_ctx;
 End of changes. 4 change blocks. 
4 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)