mirror of
https://github.com/nmap/nmap.git
synced 2026-01-03 05:09:14 +00:00
Replace concat-loop padding with string.rep
This commit is contained in:
@@ -1456,11 +1456,7 @@ Crypt = {
|
||||
local key = bin.pack("H", "0123456789abcdef")
|
||||
|
||||
-- do padding
|
||||
if ( #uspw % 8 > 0 ) then
|
||||
for i=1,(8-(#uspw % 8)) do
|
||||
uspw = uspw .. "\0"
|
||||
end
|
||||
end
|
||||
uspw = uspw .. string.rep('\0', (8 - (#uspw % 8)) % 8)
|
||||
|
||||
local iv2 = openssl.encrypt( "DES-CBC", key, nil, uspw, false ):sub(-8)
|
||||
local enc = openssl.encrypt( "DES-CBC", iv2, nil, uspw, false ):sub(-8)
|
||||
|
||||
Reference in New Issue
Block a user