diff options
Diffstat (limited to 'lib/crypto/gpg')
-rw-r--r-- | lib/crypto/gpg/gpgbin/encrypt.go | 7 | ||||
-rw-r--r-- | lib/crypto/gpg/gpgbin/sign.go | 7 | ||||
-rw-r--r-- | lib/crypto/gpg/gpgbin/verify.go | 11 |
3 files changed, 6 insertions, 19 deletions
diff --git a/lib/crypto/gpg/gpgbin/encrypt.go b/lib/crypto/gpg/gpgbin/encrypt.go index 79003fd5..fa33e466 100644 --- a/lib/crypto/gpg/gpgbin/encrypt.go +++ b/lib/crypto/gpg/gpgbin/encrypt.go @@ -25,13 +25,10 @@ func Encrypt(r io.Reader, to []string, from string) ([]byte, error) { args = append(args, "--encrypt", "-") g := newGpg(r, args) - err := g.cmd.Run() - if err != nil { - return nil, fmt.Errorf("gpg: failed to run encryption: %w", err) - } + _ = g.cmd.Run() outRdr := bytes.NewReader(g.stdout.Bytes()) var md models.MessageDetails - err = parse(outRdr, &md) + err := parse(outRdr, &md) if err != nil { return nil, fmt.Errorf("gpg: failure to encrypt: %w. check public key(s)", err) } diff --git a/lib/crypto/gpg/gpgbin/sign.go b/lib/crypto/gpg/gpgbin/sign.go index 314c3fc3..163aedfd 100644 --- a/lib/crypto/gpg/gpgbin/sign.go +++ b/lib/crypto/gpg/gpgbin/sign.go @@ -17,14 +17,11 @@ func Sign(r io.Reader, from string) ([]byte, string, error) { } g := newGpg(r, args) - err := g.cmd.Run() - if err != nil { - return nil, "", fmt.Errorf("failed to run signing: %w", err) - } + _ = g.cmd.Run() outRdr := bytes.NewReader(g.stdout.Bytes()) var md models.MessageDetails - err = parse(outRdr, &md) + err := parse(outRdr, &md) if err != nil { return nil, "", fmt.Errorf("failed to parse messagedetails: %w", err) } diff --git a/lib/crypto/gpg/gpgbin/verify.go b/lib/crypto/gpg/gpgbin/verify.go index e5930849..5079a0a2 100644 --- a/lib/crypto/gpg/gpgbin/verify.go +++ b/lib/crypto/gpg/gpgbin/verify.go @@ -2,7 +2,6 @@ package gpgbin import ( "bytes" - "fmt" "io" "io/ioutil" "os" @@ -30,17 +29,11 @@ func Verify(m io.Reader, s io.Reader) (*models.MessageDetails, error) { return nil, err } g := newGpg(bytes.NewReader(orig), args) - err = g.cmd.Run() - if err != nil { - return nil, fmt.Errorf("gpg: failed to run verification: %w", err) - } + _ = g.cmd.Run() out := bytes.NewReader(g.stdout.Bytes()) md := new(models.MessageDetails) - err = parse(out, md) - if err != nil { - return nil, fmt.Errorf("gpg: failed to parse result: %w", err) - } + _ = parse(out, md) md.Body = bytes.NewReader(orig) |