Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::SQS::Queue - use OpenSSL for Digest needs #663

Merged
merged 2 commits into from
Dec 3, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/aws/sqs/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

require 'digest'
require 'openssl'

module AWS
class SQS
Expand Down Expand Up @@ -810,7 +810,7 @@ def is_checksum_valid checksum, data
# @api private
protected
def calculate_checksum data
Digest::MD5.hexdigest data
OpenSSL::Digest::MD5.hexdigest data
end

# @api private
Expand Down
7 changes: 4 additions & 3 deletions spec/aws/sqs/queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# language governing permissions and limitations under the License.

require 'spec_helper'
require 'openssl'

module AWS
class SQS
Expand Down Expand Up @@ -70,7 +71,7 @@ class SQS
before(:each) do
resp.data[:message_id] = 'abc123'
resp.data[:md5_of_message_body] = valid_md5
Digest::MD5.stub(:hexdigest).and_return(valid_md5)
OpenSSL::Digest::MD5.stub(:hexdigest).and_return(valid_md5)
client.stub(:send_message).and_return(resp)
end

Expand Down Expand Up @@ -132,7 +133,7 @@ class SQS

before(:each) do
resp.data[:messages] = [response_message]
Digest::MD5.stub(:hexdigest).and_return(valid_md5)
OpenSSL::Digest::MD5.stub(:hexdigest).and_return(valid_md5)
client.stub(:receive_message).and_return(resp)
end

Expand Down Expand Up @@ -1056,7 +1057,7 @@ def receive_one(*args)
let(:valid_md5) { 'md5' }

before(:each) do
Digest::MD5.stub(:hexdigest).and_return(valid_md5)
OpenSSL::Digest::MD5.stub(:hexdigest).and_return(valid_md5)
client.stub(:send_message_batch).and_return(response)
end

Expand Down