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

lua: consolidate registration of built-ins #12452

Closed
wants to merge 4 commits into from

Conversation

jasonish
Copy link
Member

Built on #12449.

Exposes built-in modules to output scripts as well.

SV_BRANCH=OISF/suricata-verify#2249

Make all the hasher's have the same variants:
- add hex digest for sha256
- add finalize to hex for sha1
- add hex digest for sha1
Expose md5, sha1, and sha256 to Lua scripts with
`require("suricata.hashing")`.

Ticket: 7073
Use a single array of built-ins and provide 2 functions for
registering them:

- SCLuaLoadBuiltIn: for loading built-in modules in sandboxed
  environments.

- SCLuaRequirefBuiltIns: registers built-in modules with the standard
  package tool, allows built-ins to be loaded by output scripts that are
  not restricted

I hope to refactor the sandbox so they can use SCLuaRequirefBuiltIns
as well.
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 92.43697% with 18 lines in your changes missing coverage. Please review.

Project coverage is 80.65%. Comparing base (95e8427) to head (8ee2bdc).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12452      +/-   ##
==========================================
+ Coverage   80.63%   80.65%   +0.01%     
==========================================
  Files         920      922       +2     
  Lines      258704   258928     +224     
==========================================
+ Hits       208595   208827     +232     
+ Misses      50109    50101       -8     
Flag Coverage Δ
fuzzcorpus 56.76% <0.91%> (-0.06%) ⬇️
livemode 19.37% <0.00%> (-0.03%) ⬇️
pcap 44.22% <0.91%> (-0.12%) ⬇️
suricata-verify 63.30% <91.74%> (+0.03%) ⬆️
unittests 58.47% <12.60%> (-0.05%) ⬇️

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 24324

@jasonish jasonish closed this Jan 23, 2025
@jasonish jasonish deleted the lua/hashlib/v3 branch January 24, 2025 15:41
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