-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 - v2 #12449
base: master
Are you sure you want to change the base?
Conversation
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
``sha1()`` | ||
^^^^^^^^^^ | ||
|
||
Returns a SHA-1 hasher that can updated multiple times, for example:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns a SHA-1 hasher that can updated multiple times, for example:: | |
Returns a SHA-1 hasher that can be updated multiple times, for example:: |
|
||
* ``update(string)``: Add more data to the hasher | ||
* ``finalize()``: Finalize the hash returning the hash as a byte string | ||
* ``finalize_to_hex()``: Finalize the hash returning the has as a hex string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* ``finalize_to_hex()``: Finalize the hash returning the has as a hex string | |
* ``finalize_to_hex()``: Finalize the hash returning the hash as a hex string |
``md5()`` | ||
^^^^^^^^^ | ||
|
||
Returns a MD5 hasher that can updated multiple times, for example:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns a MD5 hasher that can updated multiple times, for example:: | |
Returns a MD5 hasher that can be updated multiple times, for example:: |
============= | ||
|
||
Suricata provides Lua extensions, or libraries to Lua scripts with the | ||
``require`` keyword. These extensions are particular important in Lua |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``require`` keyword. These extensions are particular important in Lua | |
``require`` keyword. These extensions are particularly important in Lua |
Information: QA ran without warnings. Pipeline 24320 |
Exposes SHA-256, SHA-1, and MD5 to Lua scripts via require "suricata.hashing".
Ticket: https://redmine.openinfosecfoundation.org/issues/7073
SV_BRANCH=OISF/suricata-verify#2247