rlmcpherson / s3gof3r

Fast, concurrent, streaming access to Amazon S3, including gof3r, a CLI. http://godoc.org/github.com/rlmcpherson/s3gof3r
MIT License
1.14k stars 180 forks source link

Fix MD5 hash comparison #119

Closed mathiasaerts closed 7 years ago

mathiasaerts commented 7 years ago

When uploading a file with gof3r to our S3 compatible storage (gof3r v0.4.10 to use Signature Version 2 with Ceph, our setup doesn't support v4), the upload is successful but gof3r exits with the following error:

gof3r error: MD5 hash of part hashes comparison failed. Hash from multipart complete header: 
baac207116c3c53ca4e2e2e7cc321c3. Calculated multipart hash: 5baac207116c3c53ca4e2e2e7cc321c3.

As you can see, the remote hash is missing the first character. Checking the code, the first character was always stripped, assuming it is always a quote (") however, this is not the case. Basically replaced the substring by simply trimming the quotes.

rlmcpherson commented 7 years ago

Thanks for the fix!