Remove unused code + handle errors
This commit is contained in:
parent
e797299d64
commit
b820c14c1a
7 changed files with 26 additions and 12 deletions
|
|
@ -3,6 +3,7 @@ package crypto
|
|||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
|
|
@ -59,7 +60,10 @@ func (pm *PmCrypto) DecryptMessage(encryptedText string, privateKey *KeyRing, pa
|
|||
|
||||
func decryptCore(encryptedText string, additionalEntries openpgp.EntityList, privKey *KeyRing, passphrase string, timeFunc func() time.Time) (*openpgp.MessageDetails, error) {
|
||||
rawPwd := []byte(passphrase)
|
||||
privKey.Unlock(rawPwd)
|
||||
if err := privKey.Unlock(rawPwd); err != nil {
|
||||
err = fmt.Errorf("pm-crypto: cannot decrypt passphrase: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
privKeyEntries := privKey.entities
|
||||
for _, entity := range privKey.entities {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue