diff options
author | Kim Alvefur <zash@zash.se> | 2016-02-22 18:44:43 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2016-02-22 18:44:43 +0100 |
commit | ed8199402ff2a84e57f256818ebc2c505c2ac41d (patch) | |
tree | 212768ff3b1d64b64c32583515751108b54d7b31 /util | |
parent | 11ebf4f1dc56644712e12e451e9b37c472c69238 (diff) | |
download | prosody-ed8199402ff2a84e57f256818ebc2c505c2ac41d.tar.gz prosody-ed8199402ff2a84e57f256818ebc2c505c2ac41d.zip |
util.crand: C binding to one of OpenSSL, Linux getrandom() or OpenBSD arc4random() CSPRNG
Diffstat (limited to 'util')
-rw-r--r-- | util/random.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/random.lua b/util/random.lua index e4b4a700..574e2e1c 100644 --- a/util/random.lua +++ b/util/random.lua @@ -6,6 +6,9 @@ -- COPYING file in the source package for more information. -- +local ok, crand = pcall(require, "util.crand"); +if ok then return crand; end + local urandom, urandom_err = io.open("/dev/urandom", "r"); local function seed() |