From 7d8077902bbbd02641ae1a322030bdc9e423b85f Mon Sep 17 00:00:00 2001 From: Zi Lin Date: Tue, 3 Jan 2017 21:15:35 -0800 Subject: [PATCH] ro owner command should be robust with base64 encoded RedOctober encryption. - We would avoid sending double base64 encoded request to server, triggering cryptic error message --- cmd/ro/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/ro/main.go b/cmd/ro/main.go index 2eb2cad..e78345c 100644 --- a/cmd/ro/main.go +++ b/cmd/ro/main.go @@ -343,6 +343,12 @@ func runOwner() { inBytes, err := ioutil.ReadFile(inPath) processError(err) + // attempt to base64 decode the input file + base64decoded, err := base64.StdEncoding.DecodeString(string(inBytes)) + if err == nil { + inBytes = base64decoded + } + req := core.OwnersRequest{ Data: inBytes, }