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: expose hashing functions to lua - v4 #12459

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

Conversation

jasonish
Copy link
Member

Previous PRs:

Changes:

  • Expose hashing functions to output scripts
  • Return value checks
  • Fix doc typos

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 23, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 29 lines in your changes missing coverage. Please review.

Project coverage is 80.65%. Comparing base (95e8427) to head (9bfec3e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12459      +/-   ##
==========================================
+ Coverage   80.63%   80.65%   +0.02%     
==========================================
  Files         920      922       +2     
  Lines      258704   258951     +247     
==========================================
+ Hits       208595   208869     +274     
+ Misses      50109    50082      -27     
Flag Coverage Δ
fuzzcorpus 56.75% <0.82%> (-0.07%) ⬇️
livemode 19.37% <0.00%> (-0.03%) ⬇️
pcap 44.23% <0.82%> (-0.11%) ⬇️
suricata-verify 63.31% <87.96%> (+0.05%) ⬆️
unittests 58.47% <11.49%> (-0.06%) ⬇️

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

@victorjulien victorjulien added this to the 8.0 milestone Jan 23, 2025
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