add SSE-C support for HEAD, GET, PUT (#4894)

This change adds server-side-encryption support for HEAD, GET and PUT
operations. This PR only addresses single-part PUTs and GETs without
HTTP ranges.

Further this change adds the concept of reserved object metadata which is required
to make encrypted objects tamper-proof and provide API compatibility to AWS S3.
This PR adds the following reserved metadata entries:
- X-Minio-Internal-Server-Side-Encryption-Iv          ('guarantees' tamper-proof property)
- X-Minio-Internal-Server-Side-Encryption-Kdf         (makes Key-MAC computation negotiable in future)
- X-Minio-Internal-Server-Side-Encryption-Key-Mac     (provides AWS S3 API compatibility)

The prefix `X-Minio_Internal` specifies an internal metadata entry which must not
send to clients. All client requests containing a metadata key starting with `X-Minio-Internal`
must also rejected. This is implemented by a generic-handler.

This PR implements SSE-C separated from client-side-encryption (CSE). This cannot decrypt
server-side-encrypted objects on the client-side. However, clients can encrypted the same object
with CSE and SSE-C.

This PR does not address:
 - SSE-C Copy and Copy part
 - SSE-C GET with HTTP ranges
 - SSE-C multipart PUT
 - SSE-C Gateway

Each point must be addressed in a separate PR.

Added to vendor dir:
 - x/crypto/chacha20poly1305
 - x/crypto/poly1305
 - github.com/minio/sio
This commit is contained in:
Andreas Auernhammer
2017-11-08 00:18:59 +01:00
committed by Dee Koder
parent 7e7ae29d89
commit ca6b4773ed
35 changed files with 6321 additions and 197 deletions

24
vendor/vendor.json vendored
View File

@@ -389,6 +389,12 @@
"revision": "43ed500fe4d485d97534014d9f98521216240002",
"revisionTime": "2017-08-28T17:39:33Z"
},
{
"checksumSHA1": "/VYXTlcksV92qL4Avr5S3NJ/Fxs=",
"path": "github.com/minio/sio",
"revision": "d8be2518a912f0db0dd17dc55f46da4360ee60d8",
"revisionTime": "2017-09-06T19:57:40Z"
},
{
"checksumSHA1": "zvQr4zOz1/g/Fui6co0sctxrJ28=",
"path": "github.com/nats-io/go-nats",
@@ -488,6 +494,24 @@
"revision": "3b8db5e93c4c02efbc313e17b2e796b0914a01fb",
"revisionTime": "2016-12-15T19:56:52Z"
},
{
"checksumSHA1": "CvMkf3KUUGUVHibg6G/zI7XtVbM=",
"path": "golang.org/x/crypto/chacha20poly1305",
"revision": "81e90905daefcd6fd217b62423c0908922eadb30",
"revisionTime": "2017-08-25T20:24:07Z"
},
{
"checksumSHA1": "8f1lWFSOLu7O6Jqk/e+ydH1yoms=",
"path": "golang.org/x/crypto/chacha20poly1305/internal/chacha20",
"revision": "81e90905daefcd6fd217b62423c0908922eadb30",
"revisionTime": "2017-08-25T20:24:07Z"
},
{
"checksumSHA1": "kVKE0OX1Xdw5mG7XKT86DLLKE2I=",
"path": "golang.org/x/crypto/poly1305",
"revision": "81e90905daefcd6fd217b62423c0908922eadb30",
"revisionTime": "2017-08-25T20:24:07Z"
},
{
"path": "golang.org/x/net/context",
"revision": "a728288923b47049b2ce791836767ffbe964a5bd",