1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 00:49:01 +00:00

Just use srand on NSE startup in nse_main.cc. This removes the need

for a binding which will probably not be useful for script writers
when they have OpenSSL's PRNG already available.
This commit is contained in:
batrick
2011-05-24 02:48:39 +00:00
parent a5cd01a410
commit a26f606ecd
4 changed files with 8 additions and 25 deletions

View File

@@ -95,7 +95,6 @@ local open = io.open;
local math = require "math";
local max = math.max;
local randomseed = math.randomseed;
local package = require "package";
@@ -124,11 +123,6 @@ do -- Append the nselib directory to the Lua search path
package.path = path.."?.lua;"..package.path;
end
-- Set the math.randomseed value in nse_main.lua on behalf of scripts.
-- Since Lua uses the C rand and srand functions, which have a static
-- seed for the entire program, we don't want scripts doing this themselves.
math.randomseed(nmap.get_random_uint());
local script_database_type, script_database_path =
cnse.fetchfile_absolute(cnse.script_dbpath);
local script_database_update = cnse.scriptupdatedb;