diff options
Diffstat (limited to 'lib/crypto/gpg/gpgbin/encrypt.go')
-rw-r--r-- | lib/crypto/gpg/gpgbin/encrypt.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/crypto/gpg/gpgbin/encrypt.go b/lib/crypto/gpg/gpgbin/encrypt.go index 712bb327..91e0999a 100644 --- a/lib/crypto/gpg/gpgbin/encrypt.go +++ b/lib/crypto/gpg/gpgbin/encrypt.go @@ -23,14 +23,11 @@ func Encrypt(r io.Reader, to []string, from string) ([]byte, error) { g := newGpg(r, args) _ = g.cmd.Run() - outRdr := bytes.NewReader(g.stdout.Bytes()) var md models.MessageDetails - err := parse(outRdr, &md) + err := parseStatusFd(bytes.NewReader(g.stderr.Bytes()), &md) if err != nil { return nil, fmt.Errorf("gpg: failure to encrypt: %w. check public key(s)", err) } - var buf bytes.Buffer - _, _ = io.Copy(&buf, md.Body) - return buf.Bytes(), nil + return g.stdout.Bytes(), nil } |