Skip to content

Commit

Permalink
Merge pull request #51 from chrisbirster/fix-digest-deprecated-warning
Browse files Browse the repository at this point in the history
fixed deprecation warning 'use final.hexstring instead'
  • Loading branch information
taylorfinnell authored Jun 30, 2020
2 parents 5892fb5 + 567951e commit c0b482e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/awscr-signer/signers/v4_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module Awscr

digest = OpenSSL::Digest.new("SHA256")
digest.update("BODY")
request.headers["X-Amz-Content-Sha256"].should eq(digest.hexdigest)
request.headers["X-Amz-Content-Sha256"].should eq(digest.final.hexstring)
request.headers["Authorization"].should eq("AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150101/us-east-1/s3/aws4_request, SignedHeaders=x-amz-content-sha256;x-amz-date, Signature=791f608d3f2173e73123252f6d3eae407fedbe55d8d62d06fc45bd5ea7584fc0")
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/awscr-signer/v4/request.cr
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module Awscr
end
body.rewind

digest.hexdigest
digest.final.hexstring
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/awscr-signer/v4/signature.cr
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module Awscr
private def digest
digest = OpenSSL::Digest.new("SHA256")
digest.update(@string)
digest.hexdigest
digest.final.hexstring
end

# :nodoc:
Expand Down

0 comments on commit c0b482e

Please sign in to comment.