From 3f415b11dfb1c494a45a0a83d69196cd75924cf1 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 11 Aug 2014 17:36:52 -0700 Subject: remove JSON gem usage should fully convert to using ffi-yajl there are still issues with JSON gem monkeypatching interacting with chef-zero and the spec tests so we keep the requires here for the json gem and the ffi_yajl/json_gem here. when ohai and chef-zero are fixed, we an just require ffi_yajl. --- lib/chef/encrypted_data_bag_item/decryptor.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lib/chef/encrypted_data_bag_item') diff --git a/lib/chef/encrypted_data_bag_item/decryptor.rb b/lib/chef/encrypted_data_bag_item/decryptor.rb index 0fe323870b..97a166b932 100644 --- a/lib/chef/encrypted_data_bag_item/decryptor.rb +++ b/lib/chef/encrypted_data_bag_item/decryptor.rb @@ -17,7 +17,7 @@ # require 'yaml' -require 'ffi_yajl' +require 'chef/json_compat' require 'openssl' require 'base64' require 'digest/sha2' @@ -121,8 +121,8 @@ class Chef::EncryptedDataBagItem end def for_decrypted_item - FFI_Yajl::Parser.parse(decrypted_data)["json_wrapper"] - rescue FFI_Yajl::ParseError + Chef::JSONCompat.parse(decrypted_data)["json_wrapper"] + rescue Chef::Exceptions::JSON::ParseError # convert to a DecryptionFailure error because the most likely scenario # here is that the decryption step was unsuccessful but returned bad # data rather than raising an error. @@ -197,7 +197,6 @@ class Chef::EncryptedDataBagItem assert_aead_requirements_met!(algorithm) end - # Returns the used decryption algorithm def algorithm AEAD_ALGORITHM -- cgit v1.2.1