-
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: provide base64 lib to lua - v3 #12513
base: master
Are you sure you want to change the base?
Conversation
Missed some search and replace in fuzz targets. |
A no padding option is provided as a mode, as its a variant suitable for encoding and decoding. A padding optional function is added that is indifferent to padding when decoding. This can be useful when you're not sure if padding exists, and don't really care.
Export our base64 decoding and encoding functions to Lua. Ticket: OISF#7074
1fbf5c8
to
5639cef
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12513 +/- ##
==========================================
+ Coverage 80.56% 80.69% +0.12%
==========================================
Files 925 926 +1
Lines 259292 258983 -309
==========================================
+ Hits 208906 208992 +86
+ Misses 50386 49991 -395
Flags with carried forward coverage won't be shown. Click here to find out more. |
Information: QA ran without warnings. Pipeline 24454 |
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.
just minor stuff in the docs 🙇🏽
Encode a buffer with standard base64 encoding. This standard encoding | ||
includes padding. | ||
|
||
``decode(string)`` | ||
^^^^^^^^^^^^^^^^^^ | ||
|
||
Decode a base64 string that contains padding. |
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.
are the terms string
and buffer
considered interchangeable in this Base64 section?
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.
Yes, and I somewhat did that purposefully. In Lua the datatype is string
, whether or not that data is a string of characters like a char *
, or a binary blob of data uint8_t *
.
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.
I guess one difference is that encode
usually takes what you might call a buffer. And decode
always takes a string.
5639cef
to
277bd7d
Compare
277bd7d
to
ed375f2
Compare
WARNING:
Pipeline 24464 |
Previous PR: #12498
Add a "base64" library to lua.
Add a base64 nopad encoded and decoder, as well as a padding optional decoder.
Changes from last PR:
SV_BRANCH=OISF/suricata-verify#2260
Ticket: https://redmine.openinfosecfoundation.org/issues/7074