aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
Commit message (Collapse)AuthorAgeFilesLines
...
* | configure: Pass compiler flag to enable ICU only when building util.encodingsKim Alvefur2020-07-122-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 Wild2020-06-241-3/+3
| |
* | util-src: Use the luaL_pushfail API added in Lua 5.4 to highlight all ↵Kim Alvefur2020-06-076-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 methodsMatthew Wild2020-06-041-1/+102
| |
* | util.ringbuffer: Prevent creation of buffer with negative sizeKim Alvefur2020-06-041-1/+1
| | | | | | | | | | Previously this would have been (unsigned)-1 which is a large positive integer.
* | util.ringbuffer: Prevent creation of zero-size bufferKim Alvefur2020-05-291-0/+1
| |
* | util.pposix,signal: Pass around various OS numbers as integers [Lua 5.3]Kim Alvefur2020-05-042-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-SHA256Kim Alvefur2020-04-221-1/+1
| | | | | | | | Somehow it got SHA1's 20 byte output instead of the proper 32 = 256/8
* | util.net: Fix signedness warning on ARMEmmanuel Gil Peyrot2020-01-301-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 everywhereEmmanuel Gil Peyrot2019-12-016-52/+47
| |
* | util.encodings: Remove redundant castEmmanuel Gil Peyrot2019-12-011-1/+1
| |
* | util.encodings: Don’t export unneeded symbolsEmmanuel Gil Peyrot2019-12-011-8/+8
| | | | | | | | This reduces the binary size from 22704 B to 18592 B.
* | Merge 0.11->trunkKim Alvefur2019-11-165-108/+146
|\ \ | |/ |/|
| * util.encodings: Don't ignore non-strings passed to stringprep functionsKim Alvefur2019-11-021-11/+1
| | | | | | | | | | If you manage to pass a table or something weird to these, you deserve to know.
| * util.encodings: Strictly verify that the 'strict' *prep argument is a booleanKim Alvefur2019-10-301-4/+10
| | | | | | | | | | This is to prevent mistakes like nodeprep(username:gsub("a","b")) from unintentionally invoking strict mode.
| * util.encodings: Optional strict flag to stringprepKim Alvefur2019-04-241-2/+14
| |
| * util.encodings: Spell out all IDNA 2008 options ICU hasKim Alvefur2019-09-111-1/+24
| |
| * util.encodings: Switch ICU binding to IDNA2008 (fixes #533, #1301)Kim Alvefur2019-09-111-4/+9
| |
| * util.poll: Add missing return statements in fallback modeKim Alvefur2019-07-281-0/+2
| | | | | | | | | | | | | | These allowed modifying or deleting select() state for unregistered FDs. During normal usage this should never happen. Modifying one that isn't set might cause weirdness but deleting an already deleted FD isn't a problem.
| * util.encodings: Declare absence of arguments [-Wstrict-prototypes]Kim Alvefur2019-05-131-1/+1
| |
| * util.encodings: Add compat with ICU before version 58Kim Alvefur2019-04-291-0/+5
| |
| * util.encodings: Add binding to confusables skeleton function in ICUKim Alvefur2019-04-241-0/+45
| |
| * Merge 0.11->trunkKim Alvefur2019-04-241-1/+1
| |\
| * | Backed out changeset 61bc5c52c941Kim Alvefur2019-04-211-12/+9
| | | | | | | | | | | | luaL_buffinitsize is only available in Lua 5.2+
| * | util.hashes: Allow specifying output key lengthKim Alvefur2019-04-201-9/+12
| | | | | | | | | | | | This is not needed for SCRAM but PBKDF2 takes this argument.
| * | util.hashes: Add PBKDF2-HMAC-SHA256Kim Alvefur2019-01-131-0/+18
| | |
| * | util.hashes: Rename PBKDF2 functionKim Alvefur2019-01-131-2/+3
| | | | | | | | | | | | It's not SCRAM-specific
| * | util.hashes: Remove now unused hmac() functionKim Alvefur2019-04-191-38/+0
| | |
| * | util.hashes: Use PBKDF2 from libcryptoKim Alvefur2019-01-131-44/+9
| | |
| * | Merge 0.11->trunkKim Alvefur2019-04-191-17/+11
| |\ \
| * | | util.hashes: Remove redundant semicolonKim Alvefur2019-04-191-1/+1
| | | |
| * | | util.poll: Minimize scope of methodsKim Alvefur2019-04-131-9/+9
| | | | | | | | | | | | | | | | File scope is enough
| * | | util.pposix: Don't define POSIX_C_SOURCE on FreeBSD to ensure visibility of ↵Matthew Wild2018-12-041-0/+4
| | | | | | | | | | | | | | | | initgroups()
| * | | util.time: Bump POSIX_C_SOURCE to ensure visibility of CLOCK_MONOTONIC on ↵Matthew Wild2018-12-041-1/+1
| | | | | | | | | | | | | | | | FreeBSD (fixes #1253)
* | | | util.pposix: Avoid overflow of malloc info at 2GB (fixes #1445 until 4GB)Kim Alvefur2019-11-161-5/+5
| |_|/ |/| |
* | | util.encodings: Allow unassigned code points in ICU mode to match libidn ↵Kim Alvefur2019-04-241-1/+1
| |/ |/| | | | | behavior (fixes #1348)
* | util.hashes: Use HMAC function provided by OpenSSL (fixes #1345)Kim Alvefur2019-04-191-17/+11
|/
* util-src/makefile: Update with util.poll and util.compat (fixes #1251)Kim Alvefur2018-11-301-1/+2
|
* util.xpcall, util.compat: Add non-hacky multi-argument xpcall() for Lua 5.1Matthew Wild2018-10-262-1/+31
|
* net.server_epoll: Special handling of signal interruptsKim Alvefur2018-10-121-0/+5
|
* net.server_epoll: Ignore ENOENT when deregitering socketKim Alvefur2018-10-121-1/+2
| | | | It should not really happen
* net.server_epoll: Graceful handling of registering already added socketKim Alvefur2018-10-121-1/+7
|
* util.poll: Fix inverted logicKim Alvefur2018-10-111-1/+1
|
* util.poll: Handle failed epoll FD creationKim Alvefur2018-10-111-1/+12
|
* util.poll: Early return from __gc in case of no valid epoll FDKim Alvefur2018-10-111-0/+4
| | | | | This could happen if the epoll FD has already been closed or the epoll_create call failed
* util.poll: Increase max epoll events per callKim Alvefur2018-10-081-1/+1
| | | | | | | | | | This makes the struct roughly the same size in both epoll and select mode (64bit). There doesn’t seem to be much guidance on an appropriate size, it does not seem to matter too much since if there are more events they will simply show up in the next epoll_wait call. The number of exactly concurrent events should be fairly low most of the time anyways.
* util.poll: Zero FD sets watched for errors on creationKim Alvefur2018-10-071-0/+2
|
* net.poll: Guard against negative or too large FDsKim Alvefur2018-10-071-0/+14
|
* util.poll: Fix missing return for adding duplicate FDKim Alvefur2018-10-071-0/+1
|
* util.poll: Tweak metatable name fieldKim Alvefur2018-10-061-2/+2
|