Skip to content

Commit

Permalink
Fix an issue due to updating ruby_ntlm to 0.6.5
Browse files Browse the repository at this point in the history
There was a PR that changed how strings were being encoded that was
added to ruby_ntlm 0.6.5 that is causing tests to break.
  • Loading branch information
zeroSteiner committed Sep 5, 2024
1 parent c2c58aa commit 6beae57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ruby_smb/gss/provider/ntlm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def process_ntlm_type3(type3_msg)
their_blob = type3_msg.ntlm_response[digest.digest_length..-1]

ntlmv2_hash = Net::NTLM.ntlmv2_hash(
RubySMB::Utils.safe_encode(account.username, 'UTF-16LE'),
RubySMB::Utils.safe_encode(account.password, 'UTF-16LE'),
RubySMB::Utils.safe_encode(type3_msg.domain, 'UTF-16LE'), # don't use the account domain because of the special '.' value
Net::NTLM::EncodeUtil.encode_utf16le(account.username),
Net::NTLM::EncodeUtil.encode_utf16le(account.password),
type3_msg.domain.force_encoding('ASCII-8BIT'), # don't use the account domain because of the special '.' value
{client_challenge: their_blob[16...24], unicode: true}
)

Expand Down

0 comments on commit 6beae57

Please sign in to comment.