Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upcase the domain #8

Merged
merged 1 commit into from
Sep 12, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/net/ntlm/message/type2.rb
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ def parse(str)
def response(arg, opt = {})
usr = arg[:user]
pwd = arg[:password]
domain = arg[:domain] ? arg[:domain] : ""
domain = arg[:domain] ? arg[:domain].upcase : ""
if usr.nil? or pwd.nil?
raise ArgumentError, "user and password have to be supplied"
end
6 changes: 6 additions & 0 deletions spec/lib/net/ntlm/message/type2_spec.rb
Original file line number Diff line number Diff line change
@@ -79,4 +79,10 @@
t3.user.should == "v\0a\0g\0r\0a\0n\0t\0"
t3.session_key.should == ''
end

it 'should upcase domain when provided' do
t2 = Net::NTLM::Message.decode64(type2_packet)
t3 = t2.response({:user => 'vagrant', :password => 'vagrant', :domain => 'domain'}, {:ntlmv2 => true, :workstation => 'kobe.local'})
t3.domain.should == "D\0O\0M\0A\0I\0N\0"
end
end