From 8c346ba3b47a714bb9a8ddae5ddda1d9c2ccc978 Mon Sep 17 00:00:00 2001 From: dmiller Date: Thu, 7 Jul 2016 16:35:38 +0000 Subject: [PATCH] Encrypted SSLv2 messages have no message type --- nselib/sslv2.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nselib/sslv2.lua b/nselib/sslv2.lua index ff8c69888..67f2785a7 100644 --- a/nselib/sslv2.lua +++ b/nselib/sslv2.lua @@ -140,6 +140,7 @@ local function read_header(buffer, i) if msb then header_length = 2 record_length = bit.band(len, 0x7fff) + padding_length = 0 else header_length = 3 if #buffer - i + 1 < 1 then @@ -193,22 +194,20 @@ function record_read(buffer, i) connection_id = connection_id, } i = j - elseif h.message_type == SSL_MESSAGE_TYPES.ERROR then + elseif h.message_type == SSL_MESSAGE_TYPES.ERROR and h.record_length == 3 then local j, err = bin.unpack(">S", buffer, i) h.body = { error = SSL_ERRORS[err] or err } i = j - elseif h.padding_length then + else + -- TODO: Other message types? h.message_type = "encrypted" local j, data = bin.unpack("A"..h.record_length, buffer, i) h.body = { data = data } i = j - else - stdnse.debug1("Unknown message type: %s", h.message_type) - return i, nil end return i, h end