Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #93 from pelargir/openssl-digest

OpenSSL::Digest::Digest is deprecated; use OpenSSL::Digest instead
  • Loading branch information...
commit c4a99b34618ecc2990305fb52c685a9b0b7b8389 2 parents f27a155 + ac0329e
@marcel authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/aws/s3/authentication.rb
View
3  lib/aws/s3/authentication.rb
@@ -68,7 +68,8 @@ def canonical_string
memoized :canonical_string
def encoded_canonical
- digest = OpenSSL::Digest::Digest.new('sha1')
+ klass = OpenSSL::Digest.respond_to?(:new) ? OpenSSL::Digest : OpenSSL::Digest::Digest
+ digest = klass.new('sha1')
b64_hmac = [OpenSSL::HMAC.digest(digest, secret_access_key, canonical_string)].pack("m").strip
url_encode? ? CGI.escape(b64_hmac) : b64_hmac
end
Please sign in to comment.
Something went wrong with that request. Please try again.