1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 22:21:29 +00:00

Fix more non-explicit endianness things

This commit is contained in:
dmiller
2017-02-14 05:46:40 +00:00
parent f20589ca09
commit cc0661fb34
4 changed files with 5 additions and 5 deletions

View File

@@ -48,12 +48,12 @@ local encode = function(username, password)
if string.len(username) <= 31 then -- http://wiki.msgpack.org/display/MSGPACK/Format+specification#Formatspecification-fixraw
username_prefix = bin.pack("C",0xa0 + string.len(username))
else -- http://wiki.msgpack.org/display/MSGPACK/Format+specification#Formatspecification-raw16
username_prefix = "\xda" .. bin.pack("s",string.len(username))
username_prefix = "\xda" .. bin.pack(">s",string.len(username))
end
if string.len(password) <= 31 then
password_prefix = bin.pack("C",0xa0 + string.len(password))
else
password_prefix = "\xda" .. bin.pack("s",string.len(password))
password_prefix = "\xda" .. bin.pack(">s",string.len(password))
end
return "\x93\xaa" .. method .. username_prefix .. username .. password_prefix .. password