Skip to content

Commit

Permalink
Merge pull request #67 from smortex/openssl-fix
Browse files Browse the repository at this point in the history
(misc) Remove old Ruby versions hack
  • Loading branch information
ripienaar authored May 12, 2020
2 parents 179755b + 7671b7a commit 2c217ce
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions spec/unit/mcollective/ssl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,7 @@ module MCollective
key = @ssl.base64_decode("VEma3a/R7fjw2M4d0NIctA==")
data = @ssl.base64_decode("FkH6qLvKTn7a+uNPe8ciHA==")

# the default aes-256-cbc should fail here, the key above is 128 bit
# the exception classes changed mid-1.9.2 and again later in 2.4 :(
if OpenSSL.constants.include?("CipherError")
expect { @ssl.aes_decrypt(key, data) }.to raise_error(OpenSSL::CipherError)
elsif RUBY_VERSION =~ /^2\.4/
expect { @ssl.aes_decrypt(key, data) }.to raise_error(ArgumentError)
else
expect { @ssl.aes_decrypt(key, data) }.to raise_error(OpenSSL::Cipher::CipherError)
end
expect { @ssl.aes_decrypt(key, data) }.to raise_error(ArgumentError)

# new ssl instance configured for aes-128-cbc, should work
@ssl = SSL.new("#{@rootdir}/../../fixtures/test-public.pem", "#{@rootdir}/../../fixtures/test-private.pem", nil, "aes-128-cbc")
Expand Down

0 comments on commit 2c217ce

Please sign in to comment.