Remove unused code + handle errors
This commit is contained in:
parent
e797299d64
commit
b820c14c1a
7 changed files with 26 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue