Fix encrypt-key flag parsing (#2955)

This commit is contained in:
poornas
2019-11-12 10:24:00 -08:00
committed by kannappanr
parent 94943334d4
commit 3df8101903
+4
View File
@@ -54,6 +54,10 @@ func getDecodedKey(sseKeys string) (key string, err *probe.Error) {
// Validate the key
func parseKey(sseKeys string) (sse string, err *probe.Error) {
encryptString := strings.SplitN(sseKeys, "=", 2)
if len(encryptString) < 2 {
return "", probe.NewError(errors.New("SSE-C prefix should be of the form prefix1=key1,... "))
}
secretValue := encryptString[1]
if len(secretValue) == 32 {
return sseKeys, nil