From 42f3489e0be8e134960e7a6b42841940138a9e36 Mon Sep 17 00:00:00 2001 From: alexmullins Date: Fri, 6 Nov 2015 01:01:44 -0600 Subject: [PATCH] Switch newDecryptionReader return to io.Reader --- crypto.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crypto.go b/crypto.go index 3d9571e..caf45b4 100644 --- a/crypto.go +++ b/crypto.go @@ -14,7 +14,6 @@ import ( "errors" "hash" "io" - "io/ioutil" "golang.org/x/crypto/pbkdf2" ) @@ -247,7 +246,7 @@ func generateKeys(password, salt []byte, keySize int) (encKey, authKey, pwv []by return } -func newDecryptionReader(r *io.SectionReader, f *File) (io.ReadCloser, error) { +func newDecryptionReader(r *io.SectionReader, f *File) (io.Reader, error) { keyLen := aesKeyLen(f.aesStrength) saltLen := keyLen / 2 // salt is half of key len if saltLen == 0 { @@ -280,7 +279,7 @@ func newDecryptionReader(r *io.SectionReader, f *File) (io.ReadCloser, error) { ar := newAuthReader(authKey, data, authcode, false) // return decryption reader dr := decryptStream(decKey, ar) - return ioutil.NopCloser(dr), nil + return dr, nil } func decryptStream(key []byte, ciphertext io.Reader) io.Reader {