crypto: add a basic KMS implementation (#6161)

This commit adds a basic KMS implementation for an
operator-specified SSE-S3 master key. The master key
is wrapped as KMS such that using SSE-S3 with master key
and SSE-S3 with KMS can use the same code.

Bindings for a remote / true KMS (like hashicorp vault)
will be added later on.
This commit is contained in:
Andreas Auernhammer
2018-07-18 07:40:34 +02:00
committed by kannappanr
parent 0c9f4c9092
commit 6c93c60424
4 changed files with 232 additions and 3 deletions

View File

@@ -28,3 +28,9 @@ var (
// is not supported.
ErrInvalidEncryptionMethod = errors.New("The encryption method is not supported")
)
var (
// errOutOfEntropy indicates that the a source of randomness (PRNG) wasn't able
// to produce enough random data. This is fatal error and should cause a panic.
errOutOfEntropy = errors.New("Unable to read enough randomness from the system")
)