Software /
code /
prosody
Comparison
util-src/crand.c @ 7832:d02ef0ae94af
util.crand: TODOs
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 22 Jan 2017 09:55:52 +0100 |
parent | 7831:201d0df6cce9 |
child | 7915:e3d3ebd417f4 |
comparison
equal
deleted
inserted
replaced
7831:201d0df6cce9 | 7832:d02ef0ae94af |
---|---|
70 ret = RAND_bytes(buf, len); | 70 ret = RAND_bytes(buf, len); |
71 | 71 |
72 if(ret == 1) { | 72 if(ret == 1) { |
73 ret = len; | 73 ret = len; |
74 } else { | 74 } else { |
75 /* TODO ERR_get_error() */ | |
75 lua_pushstring(L, "RAND_bytes() failed"); | 76 lua_pushstring(L, "RAND_bytes() failed"); |
76 return lua_error(L); | 77 return lua_error(L); |
77 } | 78 } |
78 | 79 |
79 #endif | 80 #endif |
98 lua_pushstring(L, "OpenSSL"); | 99 lua_pushstring(L, "OpenSSL"); |
99 #endif | 100 #endif |
100 lua_setfield(L, -2, "_source"); | 101 lua_setfield(L, -2, "_source"); |
101 | 102 |
102 #if defined(WITH_OPENSSL) && defined(_WIN32) | 103 #if defined(WITH_OPENSSL) && defined(_WIN32) |
103 /* Do we need to seed this on Windows? */ | 104 /* TODO Do we need to seed this on Windows? */ |
104 #endif | 105 #endif |
105 | 106 |
106 return 1; | 107 return 1; |
107 } | 108 } |
108 | 109 |