From 1e608634e787b317d6d2d2cbdad4e276554abb47 Mon Sep 17 00:00:00 2001 From: Pavel Korotkov Date: Thu, 6 Aug 2020 19:05:15 +0300 Subject: [PATCH] [#8] Accept directly bytes from gate key file Signed-off-by: Pavel Korotkov --- auth/center.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/auth/center.go b/auth/center.go index db0fb112e..207fccf35 100644 --- a/auth/center.go +++ b/auth/center.go @@ -161,14 +161,5 @@ func readAndKeepBody(request *http.Request) (*bytes.Reader, error) { } func LoadGateAuthPrivateKey(path string) (hcs.X25519PrivateKey, error) { - bytes, err := ioutil.ReadFile(path) - if err != nil { - return nil, err - } - key := string(bytes) - privateKey, _, err := hcs.DecodeKeysFromStrings(&key, nil) - if err != nil { - return nil, err - } - return privateKey, nil + return ioutil.ReadFile(path) }