From c47252979cf4b6271158c14c44436207f6f7928b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 26 Aug 2020 15:18:23 +0300 Subject: [PATCH] Use []byte directly for ImportKeys and ExportKeys --- go.mod | 2 +- go.sum | 2 ++ ui/crypto-commands.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8d4dbe0..66a0fab 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( golang.org/x/net v0.0.0-20200602114024-627f9648deb9 gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 gopkg.in/yaml.v2 v2.3.0 - maunium.net/go/mautrix v0.7.3 + maunium.net/go/mautrix v0.7.4 maunium.net/go/mauview v0.1.1 maunium.net/go/tcell v0.2.0 ) diff --git a/go.sum b/go.sum index ccdd1ff..78ec8c3 100644 --- a/go.sum +++ b/go.sum @@ -121,6 +121,8 @@ maunium.net/go/mautrix v0.7.1 h1:ctoAVWUPs0D1AADzuA3KLmaRONnSY61mdUoP2smNqe4= maunium.net/go/mautrix v0.7.1/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= maunium.net/go/mautrix v0.7.3 h1:yC287SXL0pTZzAtpGIvwtlxPHZsWMuq2DmI5/POTKFE= maunium.net/go/mautrix v0.7.3/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= +maunium.net/go/mautrix v0.7.4 h1:MDjrvDyHcu5ozKAa80ohcXmYAXZTHgHxrhiERtvkEdY= +maunium.net/go/mautrix v0.7.4/go.mod h1:Va/74MijqaS0DQ3aUqxmFO54/PMfr1LVsCOcGRHbYmo= maunium.net/go/mauview v0.1.1 h1:wfTXyPx3LGAGpTskh+UbBv/QItUWnEpaneHmywoYnfY= maunium.net/go/mauview v0.1.1/go.mod h1:3QBUiuLct9moP1LgDhCGIg0Ovxn38Bd2sGndnUOuj4o= maunium.net/go/tcell v0.2.0 h1:1Q0kN3wCOGAIGu1r3QHADsjSUOPDylKREvCv3EzJpVg= diff --git a/ui/crypto-commands.go b/ui/crypto-commands.go index f13217c..8bd7ff5 100644 --- a/ui/crypto-commands.go +++ b/ui/crypto-commands.go @@ -246,7 +246,7 @@ func cmdImportKeys(cmd *Command) { return } mach := cmd.Matrix.Crypto().(*crypto.OlmMachine) - imported, total, err := mach.ImportKeys(extremelyTemporaryHardcodedPassphrase, string(data)) + imported, total, err := mach.ImportKeys(extremelyTemporaryHardcodedPassphrase, data) if err != nil { cmd.Reply("Failed to import sessions: %v", err) } else { @@ -259,7 +259,7 @@ func exportKeys(cmd *Command, sessions []*crypto.InboundGroupSession) { if err != nil { cmd.Reply("Failed to export sessions: %v", err) } - err = ioutil.WriteFile(cmd.RawArgs, []byte(export), 0400) + err = ioutil.WriteFile(cmd.RawArgs, export, 0400) if err != nil { cmd.Reply("Failed to write sessions to %s: %v", cmd.RawArgs, err) } else {