Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | util.table: Fix inaccurate comment | Kim Alvefur | 2022-07-11 | 1 | -1/+1 |
| | | | | | | | Probably a duplicate of the comment next to Lmove, recorded by mistake Lpack can probably be removed at some point in the near future once we are confident it is not used anywhere. | ||||
* | util-src: Remove Lua 5.1 compat macros | Kim Alvefur | 2022-07-01 | 12 | -56/+2 |
| | | | | Part of #1600 | ||||
* | util.hashes: Revert to HMAC() convenience function | Kim Alvefur | 2022-06-24 | 1 | -22/+2 |
| | | | | | | | | | Reverts some of 1e41dd0f8353 Seems HMAC() isn't deprecated after all? Must have been at some point according to #1589 Twice as fast for some reason. | ||||
* | util.hashes: Remove unused constants | Kim Alvefur | 2022-06-24 | 1 | -3/+0 |
| | |||||
* | util.hashes: Remove unused struct | Kim Alvefur | 2022-06-24 | 1 | -8/+0 |
| | | | | Unused since 9f1c5ae8d70b | ||||
* | util.hashes: Return OpenSSL error messages on failure | Kim Alvefur | 2022-06-24 | 1 | -3/+4 |
| | | | | With luck, might contain more details than just "failed" | ||||
* | util.hashes: Add SHA3 bindings | Kim Alvefur | 2020-09-10 | 1 | -0/+19 |
| | |||||
* | util.hashes: Bind BLAKE2 algoritms supported by OpenSSL | Kim Alvefur | 2020-09-10 | 1 | -0/+21 |
| | |||||
* | util.hashes: Refactor PBKDF2 to deduplicate code | Kim Alvefur | 2020-09-10 | 1 | -17/+8 |
| | |||||
* | util.hashes: Expose sha224 and sha384 HMAC functions | Kim Alvefur | 2020-11-29 | 1 | -0/+10 |
| | | | | For completeness and consistency with set of plain hash functions | ||||
* | util.hashes: Refactor HMAC bindings (fixes #1589) | Kim Alvefur | 2020-11-29 | 1 | -22/+61 |
| | | | | | | | HMAC() is deprecated As with the regular hash functions, macros like this make it awkward to apply static analysis and code formatting. | ||||
* | util.hashes: Refactor hash functions to use OpenSSL EVP methods (fix #1698) | Kim Alvefur | 2020-09-10 | 1 | -20/+63 |
| | | | | | | | MD5() is deprecated, but EVP_md5() is not. Functions in macros like this make it awkward to apply static analysis and code formatting. | ||||
* | util.crand: Reduce scope here too | Kim Alvefur | 2022-04-23 | 1 | -2/+2 |
| | | | | Same as previous commit | ||||
* | util.strbitop: Reduce scope of functions | Kim Alvefur | 2022-04-23 | 1 | -3/+3 |
| | | | | | | | | | Equivalent to 'local' in Lua, these functions are exported via the luaopen_ function, which is the only one needing to be visible outside of the file. Pointed out by Link Mauve at some point, but there wasn't really any rush here. | ||||
* | util.table: Compatibility with Lua 5.1 lua_equals | Matthew Wild | 2022-03-18 | 1 | -1/+5 |
| | |||||
* | util.table: Backport table.move() from Lua 5.4 | Matthew Wild | 2022-03-18 | 1 | -0/+42 |
| | | | | | One difference is that 5.4 accepts "table-like" values (for this and other table.*() functions), but that would require additional backporting work. | ||||
* | Spelling: Fix various spelling mistakes (thanks timeless) | Kim Alvefur | 2022-03-07 | 1 | -1/+1 |
| | | | | | | Words, sometimes I wonder how they even work Maybe I missed something. | ||||
* | make: Fix build of util.struct on *BSD | Kim Alvefur | 2022-03-04 | 1 | -1/+2 |
| | |||||
* | Merge config-updates+check-turn from timber | Matthew Wild | 2022-03-04 | 2 | -1/+424 |
|\ | |||||
| * | util.struct: Import Roberto 'struct' library v0.3 | Matthew Wild | 2022-03-04 | 2 | -1/+424 |
| | | | | | | | | | | | | | | Downloaded from http://www.inf.puc-rio.br/~roberto/struct/ This is for compatibility with Lua 5.2 (and 5.1). Eventually we can replace this with string.pack/string.unpack which are available in 5.3+. | ||||
* | | util.poll: Add support for the poll() API | Kim Alvefur | 2022-02-23 | 1 | -1/+129 |
| | | | | | | | | Might be better than select(), more portable than epoll. | ||||
* | | util.poll: Expose API (epoll or select) used | Kim Alvefur | 2022-02-27 | 1 | -6/+6 |
| | | | | | | | | Could he handy to know for debugging or decisions | ||||
* | | util.poll: Restructure to make adding additional system APIs easier | Kim Alvefur | 2022-02-23 | 1 | -11/+23 |
|/ | |||||
* | util.pposix: Use mallinfo2() on glibc 2.33, fix #1649 | Kim Alvefur | 2022-01-06 | 1 | -5/+12 |
| | |||||
* | util.pposix: Bind isatty(3) | Kim Alvefur | 2021-07-04 | 1 | -0/+9 |
| | | | | | Useful for disabling certain behavior, ANSI colors etc when not connected to a terminal. | ||||
* | util.hashes: Expose OpenSSL version | Kim Alvefur | 2021-05-12 | 1 | -0/+4 |
| | |||||
* | Merge 0.11->trunk | Matthew Wild | 2021-05-13 | 1 | -0/+14 |
|\ | |||||
| * | util.hashes: Add constant-time string comparison (binding to CRYPTO_memcmp) | Matthew Wild | 2021-05-10 | 1 | -0/+14 |
| | | |||||
* | | Merge 0.11->trunk | Kim Alvefur | 2020-10-15 | 1 | -0/+4 |
|\| | |||||
| * | Back out changeset 2c1583bb0e0f | Kim Alvefur | 2020-10-15 | 1 | -0/+4 |
| | | | | | | | | Same reason as 712b2e6a09d9 | ||||
* | | Merge 0.11->trunk | Kim Alvefur | 2020-10-15 | 1 | -17/+6 |
|\| | |||||
| * | Back out 6dde2c9fa272: Doesn't work on Lua 5.1 | Kim Alvefur | 2020-10-15 | 1 | -13/+6 |
| | | |||||
| * | util.strbitop: Remove redundant init function | Kim Alvefur | 2020-10-15 | 1 | -4/+0 |
| | | | | | | | | | | When you have 3 almost identical functions, you tend to edit one and then copypaste. Forgot to remove this line from the other two. | ||||
* | | Merge 0.11->trunk | Kim Alvefur | 2020-10-15 | 1 | -15/+22 |
|\| | |||||
| * | util.strbitop: Create buffer in the correct size (optimization) | Kim Alvefur | 2020-10-15 | 1 | -6/+13 |
| | | | | | | | | | | This avoids dynamically growing the buffer as Lua does when luaL_addchar is used, thus saving on realloc calls. | ||||
| * | util.strbitop: Reformat code | Kim Alvefur | 2020-10-15 | 1 | -9/+9 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | astyle \ --indent=tab \ --attach-classes \ --indent-switches \ --break-blocks \ --pad-oper \ --unpad-paren \ --add-braces \ --align-pointer=name \ --lineend=linux \ *.c | ||||
* | | Merge 0.11->trunk | Matthew Wild | 2020-10-15 | 3 | -2/+93 |
|\| | |||||
| * | util.strbitop: Library for bitwise operations on strings | Kim Alvefur | 2019-09-07 | 3 | -2/+93 |
| | | |||||
* | | configure: Pass compiler flag to enable ICU only when building util.encodings | Kim Alvefur | 2020-07-12 | 2 | -0/+3 |
| | | | | | | | | Passing it in CFLAGS applied to all modules, which was not needed. | ||||
* | | util.ringbuffer: Ensure unsigned chars are always returned from :byte() | Matthew Wild | 2020-06-24 | 1 | -3/+3 |
| | | |||||
* | | util-src: Use the luaL_pushfail API added in Lua 5.4 to highlight all ↵ | Kim Alvefur | 2020-06-07 | 6 | -49/+70 |
| | | | | | | | | | | | | | | failure conditions Actually just an alias of pushnil, but it does make it more obvious where the failure conditions are, which is good for readability. | ||||
* | | util.ringbuffer: Add :sub() and :byte() methods equivalent to the string methods | Matthew Wild | 2020-06-04 | 1 | -1/+102 |
| | | |||||
* | | util.ringbuffer: Prevent creation of buffer with negative size | Kim Alvefur | 2020-06-04 | 1 | -1/+1 |
| | | | | | | | | | | Previously this would have been (unsigned)-1 which is a large positive integer. | ||||
* | | util.ringbuffer: Prevent creation of zero-size buffer | Kim Alvefur | 2020-05-29 | 1 | -0/+1 |
| | | |||||
* | | util.pposix,signal: Pass around various OS numbers as integers [Lua 5.3] | Kim Alvefur | 2020-05-04 | 2 | -28/+34 |
| | | | | | | | | | | | | | | Passing around PIDs, UIDs etc as integers makes it more sane in Lua 5.3. Getting 1234.0 as PID is silly. Shouldn't change any behavior as these are all integers on the C side and the integral floats are accepted as integers when passed back from Lua into C. | ||||
* | | util.hashes: Fix output length of PBKDF2-HMAC-SHA256 | Kim Alvefur | 2020-04-22 | 1 | -1/+1 |
| | | | | | | | | Somehow it got SHA1's 20 byte output instead of the proper 32 = 256/8 | ||||
* | | util.net: Fix signedness warning on ARM | Emmanuel Gil Peyrot | 2020-01-30 | 1 | -2/+2 |
| | | | | | | | | net.c:87:56: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘long int’ [-Wsign-compare] | ||||
* | | util.*.c: Add static qualifiers everywhere | Emmanuel Gil Peyrot | 2019-12-01 | 6 | -52/+47 |
| | | |||||
* | | util.encodings: Remove redundant cast | Emmanuel Gil Peyrot | 2019-12-01 | 1 | -1/+1 |
| | | |||||
* | | util.encodings: Don’t export unneeded symbols | Emmanuel Gil Peyrot | 2019-12-01 | 1 | -8/+8 |
| | | | | | | | | This reduces the binary size from 22704 B to 18592 B. |