mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Support fragmented TLS records. Closes #194
This commit is contained in:
@@ -149,20 +149,22 @@ end
|
||||
local function get_record_iter(sock)
|
||||
local buffer = ""
|
||||
local i = 1
|
||||
local fragment
|
||||
return function ()
|
||||
local record
|
||||
i, record = tls.record_read(buffer, i)
|
||||
i, record = tls.record_read(buffer, i, fragment)
|
||||
if record == nil then
|
||||
local status, err
|
||||
status, buffer, err = tls.record_buffer(sock, buffer, i)
|
||||
if not status then
|
||||
return nil, err
|
||||
end
|
||||
i, record = tls.record_read(buffer, i)
|
||||
i, record = tls.record_read(buffer, i, fragment)
|
||||
if record == nil then
|
||||
return nil, "done"
|
||||
end
|
||||
end
|
||||
fragment = record.fragment
|
||||
return record
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user