sha256: Verify sha256 along with md5sum, signature is verified on the request early. (#2813)

This commit is contained in:
Krishna Srinivas
2016-10-03 04:21:49 +05:30
committed by Harshavardhana
parent b5a6dd1395
commit 61a18ed48f
30 changed files with 341 additions and 166 deletions

View File

@@ -73,6 +73,8 @@ func toObjectErr(err error, params ...string) error {
err = InsufficientWriteQuorum{}
case io.ErrUnexpectedEOF, io.ErrShortWrite:
err = IncompleteBody{}
case errContentSHA256Mismatch:
err = SHA256Mismatch{}
}
if ok {
e.e = err
@@ -81,6 +83,13 @@ func toObjectErr(err error, params ...string) error {
return err
}
// SHA256Mismatch - when content sha256 does not match with what was sent from client.
type SHA256Mismatch struct{}
func (e SHA256Mismatch) Error() string {
return "sha256 computed does not match with what is expected"
}
// StorageFull storage ran out of space.
type StorageFull struct{}