Fix the rake spec failures under ruby 2.4.
Ths typo3_spec is giving some errors under ruby 2.4+ and OpenSSL 1.1+.bug/bundler_fix
parent
10cedf81b3
commit
29d1022ae2
|
@ -100,8 +100,13 @@ module Msf::Exploit::Remote::HTTP::Typo3::Login
|
||||||
key = OpenSSL::PKey::RSA.new
|
key = OpenSSL::PKey::RSA.new
|
||||||
exponent = OpenSSL::BN.new e.hex.to_s
|
exponent = OpenSSL::BN.new e.hex.to_s
|
||||||
modulus = OpenSSL::BN.new n.hex.to_s
|
modulus = OpenSSL::BN.new n.hex.to_s
|
||||||
key.e = exponent
|
if key.respond_to?(:set_key)
|
||||||
key.n = modulus
|
# Ruby 2.4+
|
||||||
|
key.set_key(modulus, exponent, nil)
|
||||||
|
else
|
||||||
|
key.e = exponent
|
||||||
|
key.n = modulus
|
||||||
|
end
|
||||||
enc = key.public_encrypt(password)
|
enc = key.public_encrypt(password)
|
||||||
enc_b64 = Rex::Text.encode_base64(enc)
|
enc_b64 = Rex::Text.encode_base64(enc)
|
||||||
"rsa:#{enc_b64}"
|
"rsa:#{enc_b64}"
|
||||||
|
|
Loading…
Reference in New Issue