Description
Acknowledgements
- I have searched (https://github.com/aws/aws-sdk/issues?q=is%3Aissue) for past instances of this issue
- I have verified all of my SDK modules are up-to-date (you can perform a bulk update with
go get -u github.com/aws/aws-sdk-go-v2/...
)
Describe the bug
Some s3 clients, like s3cmd, does not have Signature=
directly after ,
.
While GetSignedRequestSignature tries to handle that case with idx >= 0
it does not use idx when cutting the string.
This causes the result to contain random non hex data in sig and you get an error about invalid hex:
encoding/hex: invalid byte: U+0053 'S'
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
GetSignedRequestSignature(r *http.Request) to return a signature
Current Behavior
GetSignedRequestSignature(r *http.Request) returns error encoding/hex: invalid byte: U+0053 'S'
Reproduction Steps
Using s3cmd ls
for a service that uses validation
Possible Solution
Missing index when cutting string
sig := p[len(authHeaderSignatureElem):]
should be
sig := p[len(authHeaderSignatureElem) + idx:]
Additional Information/Context
Confirmed that adding idx as suggested solves the issue locally.
AWS Go SDK V2 Module Versions Used
v1.32.2
Compiler and Version used
go version go1.22.5 linux/amd64
Operating System and version
Linux amd64