Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect validate callbacks 5634 v5 #12346

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

catenacyber
Copy link
Contributor

Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/5634

Describe changes:

  • detect: change the ValidateCallback prototype to deduplicate code
  • detect: use one function for md5-like keywords (quic-cyu-hash, ssh-hassh, tls-ja3-hash...)

#11963 with review taken into account :

  • ValidateCallback is extended to have not only the buffer id, but the pointer to the full DetectBufferType so as to reuse the buffer name in log errors
  • we do not run Validation Callbacks on transformed buffers
    Like http.host; dotprefix; content:".softether.net"; does not warn/error in master and neither here even if http.host; content:".softether.net"; does and it may make sense

This was done on the way to convert quic keywords to rust like #11575

With this PR, it should be easy to add a wrapper for rust for this ValidateCallback stuff

Ticket: 5634

Allows to share the same validator functions when only the buffer
id is changing like for urilen, while still accessing the buffer
name for error logs
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.23%. Comparing base (def22fa) to head (266195c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12346      +/-   ##
==========================================
- Coverage   83.23%   83.23%   -0.01%     
==========================================
  Files         912      912              
  Lines      257647   257536     -111     
==========================================
- Hits       214450   214349     -101     
+ Misses      43197    43187      -10     
Flag Coverage Δ
fuzzcorpus 61.18% <100.00%> (-0.03%) ⬇️
livemode 19.43% <20.00%> (+0.03%) ⬆️
pcap 44.46% <62.22%> (+0.05%) ⬆️
suricata-verify 62.86% <66.66%> (-0.01%) ⬇️
unittests 59.20% <60.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 24112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants