mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 00:19:01 +00:00
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.
This commit is contained in:
@@ -693,7 +693,6 @@ local function get_config(host, config)
|
||||
elseif(nmap.registry.args.key) then
|
||||
config.key = nmap.registry.args.key
|
||||
else
|
||||
math.randomseed( os.time() )
|
||||
config.key = ""
|
||||
for i = 1, 127, 1 do
|
||||
config.key = config.key .. string.char(math.random(0x20, 0x7F))
|
||||
|
||||
Reference in New Issue
Block a user