Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Update V4 signer to sign Sha256 header for S3 requests#746

Merged
jasdel merged 4 commits intoaws:masterfrom
jasdel:fix/743SignShaHeaderForS3
Jul 5, 2016
Merged

Update V4 signer to sign Sha256 header for S3 requests#746
jasdel merged 4 commits intoaws:masterfrom
jasdel:fix/743SignShaHeaderForS3

Conversation

@jasdel
Copy link
Contributor

@jasdel jasdel commented Jul 1, 2016

The X-Amz-Content-Sha256 header was not being signed for S3 requests.
This header is required to be signed, per the S3 V4 signature spec.

Fix #743


signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.Body, name, region, req.ExpireTime, signingTime)
req.SignedHeaderVals = signedHeaders
req.LastSignedAt = curTimeFn()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we only set this if err was nil?

Copy link
Contributor Author

@jasdel jasdel Jul 5, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, updated to only set if there was no signing error.

jasdel added 4 commits July 5, 2016 12:53
Adds a LastSignedAt field to the Request type to record when the request
was last signed. This fixes a bug where the signer would continue to resign a
request every call after the original signature expired.
The X-Amz-Content-Sha256 header was not being signed for S3 requests.
This header is required to be signed, per the S3 V4 signature spec.

Fix aws#743
@jasdel jasdel force-pushed the fix/743SignShaHeaderForS3 branch from ba3d0af to bae4e52 Compare July 5, 2016 19:53
@xibz
Copy link
Contributor

xibz commented Jul 5, 2016

🚢

@jasdel jasdel merged commit 689ed71 into aws:master Jul 5, 2016
@jasdel jasdel deleted the fix/743SignShaHeaderForS3 branch July 5, 2016 21:07
jasdel added a commit that referenced this pull request Jul 5, 2016
skotambkar pushed a commit to skotambkar/aws-sdk-go that referenced this pull request May 20, 2021
stale issue clean up action
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants