aboutsummaryrefslogtreecommitdiffstats
path: root/util/random.lua
Commit message (Collapse)AuthorAgeFilesLines
* util: Prefix module imports with prosody namespaceKim Alvefur2023-03-171-1/+1
|
* util.random: Test whether util.crand works before using it (fix #1734)Kim Alvefur2022-04-021-1/+1
| | | | | | | | | | util.crand can be configured at compile time to use the Linux getrandom() system call, available from Linux 3.17, but it is still possible to load it with an older kernel lacking that system call, where attempting to use it throws an ENOSYS error. By testing for this on load we can fall back to /dev/urandom in this case.
* util.random: Throw different error for EOL conditionKim Alvefur2019-05-211-1/+5
|
* util.random: Coerce error to string (thanks waqas)Kim Alvefur2019-05-181-1/+1
| | | | | In theory this could happen in an EOF condition, which should be impossible with a read from /dev/urandom.
* util.random: Handle unlikely read errors from /dev/urandom (see #1313)Kim Alvefur2019-05-181-1/+5
|
* Merge 0.10->trunkKim Alvefur2017-09-161-0/+1
|\
| * util.random: Add a _source field to match util.crandKim Alvefur2017-09-161-0/+1
| |
* | util.random: Remove obsolete noop seed functionKim Alvefur2017-09-161-4/+0
|/
* util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD ↵Kim Alvefur2016-02-221-0/+3
| | | | arc4random() CSPRNG
* util.random: Restore friendlier error from 0.9/util.uuidKim Alvefur2016-01-311-1/+7
|
* util.random: Open /dev/urandom read-only, make seed() a noopKim Alvefur2016-01-121-4/+2
|
* util.random: Use /dev/urandomKim Alvefur2016-01-061-24/+4
|
* util.random: Ensure at least 4 bytes of previous random state is used when ↵Kim Alvefur2014-09-181-2/+2
| | | | generating new randomness
* util.random: Switch to SHA512Kim Alvefur2014-09-181-2/+2
|
* util.random: Generic util lib for generating strings of random bytesMatthew Wild2014-09-021-0/+43