1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 20:29:03 +00:00

Lua 5.2 upgrade [1] for NSE.

[1] http://seclists.org/nmap-dev/2012/q2/34
This commit is contained in:
batrick
2012-05-27 08:53:32 +00:00
parent a839e69449
commit 000f6dc4d9
553 changed files with 13477 additions and 8870 deletions

View File

@@ -24,12 +24,13 @@
-- added support for LOGIN and AUTHENTICATE
-- <patrik@cqure.net>
module(... or "imap", package.seeall)
local base64 = require "base64"
local comm = require "comm"
local sasl = require "sasl"
local stdnse = require "stdnse"
local table = require "table"
_ENV = stdnse.module("imap", stdnse.seeall)
require 'stdnse'
require 'comm'
require 'base64'
require 'sasl'
IMAP = {
@@ -145,7 +146,7 @@ IMAP = {
-- All mechanisms expect username and pass
-- add the otheronce for those who need them
local mech_params = { username, pass, data, "imap" }
auth_data = sasl.Helper:new(mech):encode(unpack(mech_params))
auth_data = sasl.Helper:new(mech):encode(table.unpack(mech_params))
auth_data = base64.enc(auth_data) .. "\r\n"
status, data = self.socket:send(auth_data)
@@ -275,3 +276,5 @@ Helper = {
end,
}
return _ENV;