signature: Handle presigned payload if set.

Validate payload with incoming content.



Fixes #1288
This commit is contained in:
Harshavardhana
2016-04-07 03:04:18 -07:00
committed by Anand Babu (AB) Periasamy
parent 4e6c4da518
commit b182e94acc
5 changed files with 46 additions and 64 deletions

View File

@@ -24,7 +24,7 @@ import (
"strings"
"unicode/utf8"
"github.com/minio/minio/pkg/crypto/sha256"
fastSha256 "github.com/minio/minio/pkg/crypto/sha256"
)
// isValidRegion - verify if incoming region value is valid with configured Region.
@@ -42,7 +42,7 @@ func isValidRegion(reqRegion string, confRegion string) bool {
// sumHMAC calculate hmac between two input byte array.
func sumHMAC(key []byte, data []byte) []byte {
hash := hmac.New(sha256.New, key)
hash := hmac.New(fastSha256.New, key)
hash.Write(data)
return hash.Sum(nil)
}