mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
PresignedPost: Support for Signature V2 presigned POST Policy. (#3043)
fixes #2993
This commit is contained in:
committed by
Harshavardhana
parent
4b5b363c6c
commit
e51be73ac7
@@ -145,10 +145,19 @@ func getSignature(signingKey []byte, stringToSign string) string {
|
||||
return hex.EncodeToString(sumHMAC(signingKey, []byte(stringToSign)))
|
||||
}
|
||||
|
||||
// Check to see if Policy is signed correctly.
|
||||
func doesPolicySignatureMatch(formValues map[string]string) APIErrorCode {
|
||||
// For SignV2 - Signature field will be valid
|
||||
if formValues["Signature"] != "" {
|
||||
return doesPolicySignatureV2Match(formValues)
|
||||
}
|
||||
return doesPolicySignatureV4Match(formValues)
|
||||
}
|
||||
|
||||
// doesPolicySignatureMatch - Verify query headers with post policy
|
||||
// - http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html
|
||||
// returns ErrNone if the signature matches.
|
||||
func doesPolicySignatureMatch(formValues map[string]string) APIErrorCode {
|
||||
func doesPolicySignatureV4Match(formValues map[string]string) APIErrorCode {
|
||||
// Access credentials.
|
||||
cred := serverConfig.GetCredential()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user