From 1ff0062589107b7bfd6da425623082b6e1f9e640 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 19 Feb 2014 22:14:14 +0000 Subject: [PATCH] Use unicode library for NTLM in sasl.lua --- nselib/sasl.lua | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/nselib/sasl.lua b/nselib/sasl.lua index 6e5d5bd3f..a2498789f 100644 --- a/nselib/sasl.lua +++ b/nselib/sasl.lua @@ -46,6 +46,7 @@ local bit = require "bit" local smbauth = require "smbauth" local stdnse = require "stdnse" local string = require "string" +local unicode = require "unicode" _ENV = stdnse.module("sasl", stdnse.seeall) local HAVE_SSL, openssl = pcall(require, 'openssl') @@ -190,17 +191,6 @@ if HAVE_SSL then return o end, - --- Converts str to "unicode" (adds null bytes for every other byte) - -- @param str containing string to convert - -- @return unicode string containing the unicoded str - to_unicode = function(str) - local unicode = "" - for i = 1, #str, 1 do - unicode = unicode .. bin.pack("