Skip to content

Commit

Permalink
Support performing OpenSSL::Digest::MD4 in openSSL 3 by loading legac…
Browse files Browse the repository at this point in the history
…y provider

openSSL3 doesn't support MD4 which means any installation with ntlm on openSSL3 using the challenge will be breaking. Hence the loading
of the provider. I wonder if its possible to move away from MD4 altogether?
  • Loading branch information
shayonj committed Jun 5, 2024
1 parent 72163c5 commit d690088
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/net/ntlm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ def ntlm_hash(password, opt = {})
unless opt[:unicode]
pwd = EncodeUtil.encode_utf16le(pwd)
end

# OpenSSL 3 Support
OpenSSL::Provider.load("legacy") if defined?(OpenSSL::Provider)

OpenSSL::Digest::MD4.digest pwd
end

Expand Down

0 comments on commit d690088

Please sign in to comment.