Land #7435, NTLM Util change to support Unicode hostnames

bug/bundler_fix
Brent Cook 2016-10-14 09:46:10 -05:00
commit a2fe934c15
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
1 changed files with 9 additions and 4 deletions

View File

@ -397,16 +397,21 @@ class Utils
case atype case atype
when 1 when 1
#netbios name #netbios name
data[:default_name] = addr.gsub("\x00", '') temp_name = addr
temp_name.force_encoding("UTF-16LE")
data[:default_name] = temp_name.encode("UTF-8")
when 2 when 2
#netbios domain #netbios domain
data[:default_domain] = addr.gsub("\x00", '') data[:default_domain] = addr
data[:default_domain].force_encoding("UTF-16LE")
when 3 when 3
#dns name #dns name
data[:dns_host_name] = addr.gsub("\x00", '') data[:dns_host_name] = addr
data[:dns_host_name].force_encoding("UTF-16LE")
when 4 when 4
#dns domain #dns domain
data[:dns_domain_name] = addr.gsub("\x00", '') data[:dns_domain_name] = addr
data[:dns_domain_name].force_encoding("UTF-16LE")
when 5 when 5
#The FQDN of the forest. #The FQDN of the forest.
when 6 when 6