1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00

Move stdnse.generate_random_string to new rand.lua

This commit is contained in:
dmiller
2018-09-08 17:07:06 +00:00
parent deea96de7c
commit 26ef852a28
43 changed files with 123 additions and 186 deletions

View File

@@ -6,6 +6,7 @@ local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
local unittest = require "unittest"
local rand = require "rand"
_ENV = stdnse.module("mqtt", stdnse.seeall)
@@ -539,7 +540,7 @@ MQTT.packet["CONNECT"].build = function(options)
if not client_id then
-- We throw in randomness in case there are multiple scripts using this
-- library on a single port.
client_id = "nmap" .. stdnse.generate_random_string(16)
client_id = "nmap" .. rand.random_alpha(16)
end
assert(type(client_id) == "string")
tail = tail .. MQTT.utf8_build(client_id)