s3v4: read and verify S3 signature v4 chunks separately (#11801)
s3v4: read and verify S3 signature v4 chunks separately (#11801)

This commit fixes a security issue in the signature v4 chunked
reader. Before, the reader returned unverified data to the caller
and would only verify the chunk signature once it has encountered
the end of the chunk payload.

Now, the chunk reader reads the entire chunk into an in-memory buffer,
verifies the signature and then returns data to the caller.

In general, this is a common security problem. We verifying data
streams, the verifier MUST NOT return data to the upper layers / its
callers as long as it has not verified the current data chunk / data
segment:
```
func (r *Reader) Read(buffer []byte) {
   if err := r.readNext(r.internalBuffer); err != nil {
      return err
   }
   if err := r.verify(r.internalBuffer); err != nil {
      return err
   }
   copy(buffer, r.internalBuffer)
}
```
balamurugana/minio,donatello/minio,krisis/minio,vadmeste/minio,balamurugana/minio,vadmeste/minio,krisis/minio,minio/minio,NitishT/minio,minio/minio,NitishT/minio,NitishT/minio,donatello/minio,NitishT/minio