From 87ef13b5485bed860b93c4265e96f18745d21936 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Tue, 17 Oct 2017 22:12:35 -0600 Subject: [PATCH] Handle more errors --- connect.go | 2 +- crypto.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connect.go b/connect.go index 92d8d983..f66a6583 100644 --- a/connect.go +++ b/connect.go @@ -86,7 +86,7 @@ func runClient(connectionType string, codePhrase string) { log.Error(err) return } - log.Debug("writing [%s]", fileName) + log.Debugf("writing %d bytes to %s", len(decrypted), fileName) err = ioutil.WriteFile(fileName, decrypted, 0644) if err != nil { log.Error(err) diff --git a/crypto.go b/crypto.go index 2e5f2cbb..b9318a80 100644 --- a/crypto.go +++ b/crypto.go @@ -39,7 +39,7 @@ func Encrypt(plaintext []byte, passphrase string) ([]byte, string, string) { } func Decrypt(data []byte, passphrase string, salt string, iv string) (plaintext []byte, err error) { - return plaintext, nil + return data, nil // saltBytes, _ := hex.DecodeString(salt) // ivBytes, _ := hex.DecodeString(iv) // key, _ := deriveKey(passphrase, saltBytes)