diff options
author | Xabier de Zuazo <xabier@onddo.com> | 2014-12-03 06:35:22 +0100 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2015-01-27 12:04:44 -0800 |
commit | 5f09a024610dd5ed992faa42624beced6f6e3ed3 (patch) | |
tree | f08aba90fe1bf66043b5ff7282440f41b89eb9c4 | |
parent | 74770bd862180d90e0d2c5381ad74dd7ec637242 (diff) | |
download | chef-5f09a024610dd5ed992faa42624beced6f6e3ed3.tar.gz |
EncryptedDataBagItem: remove Cipher#auth_data method existence check (ruby 1.8 specific, issue #2497)
-rw-r--r-- | lib/chef/encrypted_data_bag_item/assertions.rb | 3 | ||||
-rw-r--r-- | spec/functional/knife/exec_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/encrypted_data_bag_item_spec.rb | 24 |
3 files changed, 1 insertions, 30 deletions
diff --git a/lib/chef/encrypted_data_bag_item/assertions.rb b/lib/chef/encrypted_data_bag_item/assertions.rb index 0f9416e7b6..ab93f46c10 100644 --- a/lib/chef/encrypted_data_bag_item/assertions.rb +++ b/lib/chef/encrypted_data_bag_item/assertions.rb @@ -44,9 +44,6 @@ class Chef::EncryptedDataBagItem end def assert_aead_requirements_met!(algorithm) - unless OpenSSL::Cipher.method_defined?(:auth_data=) - raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires Ruby >= 2.0" - end unless OpenSSL::Cipher.ciphers.include?(algorithm) raise EncryptedDataBagRequirementsFailure, "The used Encrypted Data Bags version requires an OpenSSL version with \"#{algorithm}\" algorithm support" end diff --git a/spec/functional/knife/exec_spec.rb b/spec/functional/knife/exec_spec.rb index 0a9177b5e8..6262094a9f 100644 --- a/spec/functional/knife/exec_spec.rb +++ b/spec/functional/knife/exec_spec.rb @@ -41,9 +41,7 @@ describe Chef::Knife::Exec do @server.stop end - skip "executes a script in the context of the chef-shell main context", :ruby_18_only - - it "executes a script in the context of the chef-shell main context", :ruby_gte_19_only do + it "executes a script in the context of the chef-shell main context" do @node = Chef::Node.new @node.name("ohai-world") response = {"rows" => [@node],"start" => 0,"total" => 1} diff --git a/spec/unit/encrypted_data_bag_item_spec.rb b/spec/unit/encrypted_data_bag_item_spec.rb index 14afea507c..0a4306727b 100644 --- a/spec/unit/encrypted_data_bag_item_spec.rb +++ b/spec/unit/encrypted_data_bag_item_spec.rb @@ -124,14 +124,6 @@ describe Chef::EncryptedDataBagItem::Encryptor do context "on unsupported platforms" do let(:aead_algorithm) { Chef::EncryptedDataBagItem::AEAD_ALGORITHM } - it "throws an error warning about the Ruby version if it has no GCM support" do - # Force OpenSSL with AEAD support - allow(OpenSSL::Cipher).to receive(:ciphers).and_return([ aead_algorithm ]) - # Ruby without AEAD support - expect(OpenSSL::Cipher).to receive(:method_defined?).with(:auth_data=).and_return(false) - expect { encryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/) - end - it "throws an error warning about the OpenSSL version if it has no GCM support" do # Force Ruby with AEAD support allow(OpenSSL::Cipher).to receive(:method_defined?).with(:auth_data=).and_return(true) @@ -140,14 +132,6 @@ describe Chef::EncryptedDataBagItem::Encryptor do expect { encryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires an OpenSSL/) end - context "on platforms with old Ruby", :ruby_lt_20 do - - it "throws an error warning about the Ruby version" do - expect { encryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/) - end - - end # context on platforms with old Ruby - context "on platforms with old OpenSSL", :openssl_lt_101 do it "throws an error warning about the OpenSSL version" do @@ -214,14 +198,6 @@ describe Chef::EncryptedDataBagItem::Decryptor do } end - context "on platforms with old Ruby", :ruby_lt_20 do - - it "throws an error warning about the Ruby version" do - expect { decryptor }.to raise_error(Chef::EncryptedDataBagItem::EncryptedDataBagRequirementsFailure, /requires Ruby/) - end - - end # context on platforms with old Ruby - context "on platforms with old OpenSSL", :openssl_lt_101 do it "throws an error warning about the OpenSSL version" do |