From a729a4fafeefa38b1018ac2d1a631ef93b364967 Mon Sep 17 00:00:00 2001
From: fatedier <fatedier@gmail.com>
Date: Tue, 5 Apr 2016 16:17:31 +0800
Subject: [PATCH] pcrypto: update

---
 src/frp/utils/pcrypto/pcrypto.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/frp/utils/pcrypto/pcrypto.go b/src/frp/utils/pcrypto/pcrypto.go
index ebddfac8..2e8ba928 100644
--- a/src/frp/utils/pcrypto/pcrypto.go
+++ b/src/frp/utils/pcrypto/pcrypto.go
@@ -49,7 +49,6 @@ func (pc *Pcrypto) Encrypt(src []byte) ([]byte, error) {
 	defer zwr.Close()
 	zwr.Write(src)
 	zwr.Flush()
-	fmt.Println("com,src,en", len(src), len(zbuf.Bytes()))
 
 	// aes
 	src = pKCS7Padding(zbuf.Bytes(), aes.BlockSize)
@@ -57,8 +56,6 @@ func (pc *Pcrypto) Encrypt(src []byte) ([]byte, error) {
 	crypted := make([]byte, len(src))
 	blockMode.CryptBlocks(crypted, src)
 
-	fmt.Println("aes,src,en", len(src), len(crypted))
-
 	// base64
 	return []byte(base64.StdEncoding.EncodeToString(crypted)), nil
 }
@@ -87,7 +84,10 @@ func (pc *Pcrypto) Decrypt(str []byte) ([]byte, error) {
 
 	// gunzip
 	zbuf := bytes.NewBuffer(decryptText)
-	zrd, _ := gzip.NewReader(zbuf)
+	zrd, err := gzip.NewReader(zbuf)
+	if err != nil {
+		return nil, err
+	}
 	defer zrd.Close()
 	data, _ = ioutil.ReadAll(zrd)