Remove unused code + handle errors

This commit is contained in:
William Gotti 2019-05-13 12:42:29 +00:00 committed by Daniel Huigens
parent e797299d64
commit b820c14c1a
7 changed files with 26 additions and 12 deletions

View file

@ -2,6 +2,7 @@ package crypto
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"runtime"
@ -123,7 +124,10 @@ func (pm *PmCrypto) DecryptAttachment(keyPacket []byte, dataPacket []byte, kr *K
privKeyEntries := kr.entities
kr.Unlock([]byte(passphrase))
if err := kr.Unlock([]byte(passphrase)); err != nil {
err = fmt.Errorf("pm-crypto: cannot decrypt attachment: %v", err)
return nil, err
}
keyReader := bytes.NewReader(keyPacket)
dataReader := bytes.NewReader(dataPacket)