Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | util.crypto: Use Lua 5.2 API for predictable buffer size | Kim Alvefur | 2022-07-11 | 1 | -6/+1 |
| | | | | | | | | In Lua 5.3 LUAL_BUFFERSIZE is a macro computed from sizeof and is thus not known at pre-processing time, so this does not work. Since Lua 5.1 is no longer supported, we can use luaL_prepbuffsize() which is available from Lua 5.2 | ||||
* | util.crypto: Use stack space buffers | Kim Alvefur | 2022-07-11 | 1 | -14/+11 |
| | | | | | | | | | Removes assumption that LUAL_BUFFERSIZE is known at pre-processing time, which it is not in Lua 5.3 and 5.4, where it is a computed macro based on sizeof. Allocation of stack space is safer and faster, no need to worry about luaL_prepbuffer failing to allocate memory and skipping free() | ||||
* | util.crypto: More digests for sign/verify, use macros for clarity/consistency | Matthew Wild | 2022-07-02 | 1 | -32/+40 |
| | |||||
* | util.crypto: Friendlier error message on incorrect key types | Matthew Wild | 2022-07-02 | 1 | -1/+6 |
| | |||||
* | util.crypto: Add support for RSA signatures (PKCS1-v1.5 + PSS) | Matthew Wild | 2022-07-02 | 1 | -3/+31 |
| | | | | These are used by the RS*** and PS*** family of JOSE algorithms (e.g. in JWTs) | ||||
* | util.crypto: New wrapper for some operations in OpenSSL's libcrypto | Matthew Wild | 2022-06-24 | 2 | -2/+557 |
| | | | | | Specifically, ED25519 key generation/import/export, sign/verify operations, and AES encrypt/decrypt. | ||||
* | util-src: Add new utility header managed_pointer.h | Matthew Wild | 2022-07-01 | 1 | -0/+61 |
| | | | | | The macros in this header allow creation of GC-managed objects from manually- managed C alloc/free APIs. | ||||
* | 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. |