1
0
mirror of https://github.com/nmap/nmap.git synced 2026-02-07 22:16:33 +00:00

Remove some openssl deps when only used for random strings

This commit is contained in:
dmiller
2018-09-08 17:07:07 +00:00
parent 26ef852a28
commit e1cbd13f82
3 changed files with 8 additions and 10 deletions

View File

@@ -4,8 +4,7 @@ local nmap = require "nmap"
local packet = require "packet"
local stdnse = require "stdnse"
local string = require "string"
local openssl = stdnse.silent_require "openssl"
local rand = require "rand"
description = [[
Obtains hostnames, IPv4 and IPv6 addresses through IPv6 Node Information Queries.
@@ -69,7 +68,7 @@ local QTYPE_STRINGS = {
local function build_ni_query(src, dst, qtype)
local flags
local nonce = openssl.rand_pseudo_bytes(8)
local nonce = rand.random_string(8)
if qtype == QTYPE_NODENAME then
flags = 0x0000
elseif qtype == QTYPE_NODEADDRESSES then

View File

@@ -8,8 +8,7 @@ local table = require "table"
local target = require "target"
local unicode = require "unicode"
local ipOps = require "ipOps"
local openssl = stdnse.silent_require "openssl"
local rand = require "rand"
description = [[
Uses the Microsoft LLTD protocol to discover hosts on a local network.
@@ -177,12 +176,12 @@ local QuickDiscoveryPacket = function(mac_src)
demultiplex_hdr = string.pack("BBBB", lltd_version, lltd_type_of_service, lltd_reserved, lltd_function )
-- set up LLTD base header = [ mac_dst, mac_src, seq_num(xid) ]
local lltd_seq_num = openssl.rand_bytes(2)
local lltd_seq_num = rand.random_string(2)
base_hdr = mac_dst .. mac_src .. lltd_seq_num
-- set up LLTD Upper Level Header = [ generation_number, number_of_stations, station_list ]
local generation_number = openssl.rand_bytes(2)
local generation_number = rand.random_string(2)
local number_of_stations = 0
local station_list = string.rep("\0", 6*4)