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

@@ -62,8 +62,9 @@ func testListObjects(obj ObjectLayer, instanceType string, t TestErrHandler) {
{"obj1", "obj1"},
{"obj2", "obj2"},
}
sha256sum := ""
for _, object := range testObjects {
_, err = obj.PutObject(testBuckets[0], object.name, int64(len(object.content)), bytes.NewBufferString(object.content), nil)
_, err = obj.PutObject(testBuckets[0], object.name, int64(len(object.content)), bytes.NewBufferString(object.content), nil, sha256sum)
if err != nil {
t.Fatalf("%s : %s", instanceType, err.Error())
}
@@ -583,9 +584,10 @@ func BenchmarkListObjects(b *testing.B) {
b.Fatal(err)
}
sha256sum := ""
for i := 0; i < 20000; i++ {
key := "obj" + strconv.Itoa(i)
_, err = obj.PutObject("ls-benchmark-bucket", key, int64(len(key)), bytes.NewBufferString(key), nil)
_, err = obj.PutObject("ls-benchmark-bucket", key, int64(len(key)), bytes.NewBufferString(key), nil, sha256sum)
if err != nil {
b.Fatal(err)
}