New Upstream Snapshot - golang-github-gopasspw-pinentry
Ready changes
Summary
Merged new upstream version: 0.0.2+git20220110.1.9a3d859 (was: 0.0.2).
Resulting package
Built on 2022-10-21T17:27 (took 9m1s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-snapshots golang-github-gopasspw-pinentry-dev
Lintian Result
- golang-github-gopasspw-pinentry-dev_0.0.2+git20220110.1.9a3d859-1~jan+nus2_all.deb
- golang-github-gopasspw-pinentry_0.0.2+git20220110.1.9a3d859-1~jan+nus2.dsc
- golang-github-gopasspw-pinentry_0.0.2+git20220110.1.9a3d859-1~jan+nus2_amd64.buildinfo
- golang-github-gopasspw-pinentry_0.0.2+git20220110.1.9a3d859-1~jan+nus2_amd64.changes
Diff
diff --git a/README.md b/README.md
index 0bd288c..918713a 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,11 @@
# pinentry
Pinentry client in Go
+
+## DEPRECATION NOTICE
+
+This package is deprecated and won't be maintained anymore.
+Please use one of the [other pinentry packages](https://pkg.go.dev/search?q=pinentry&m=) for Go instead, e.g.:
+
+* [twpayne/go-pinentry](https://pkg.go.dev/github.com/twpayne/go-pinentry#section-readme)
+* [foxcpp/go-assuan/pinentry](https://pkg.go.dev/github.com/foxcpp/go-assuan/pinentry)
diff --git a/debian/changelog b/debian/changelog
index e04801b..f07c89e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-gopasspw-pinentry (0.0.2+git20220110.1.9a3d859-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Fri, 21 Oct 2022 17:22:22 -0000
+
golang-github-gopasspw-pinentry (0.0.2-3) unstable; urgency=medium
[ Debian Janitor ]
diff --git a/pinentry.go b/pinentry.go
index 99b51ab..2da5944 100644
--- a/pinentry.go
+++ b/pinentry.go
@@ -30,11 +30,13 @@ type Client struct {
cmd *exec.Cmd
in io.WriteCloser
out *bufio.Reader
+ bin string
}
// New creates a new pinentry client
func New() (*Client, error) {
- cmd := exec.Command(GetBinary())
+ bin := GetBinary()
+ cmd := exec.Command(bin)
stdin, err := cmd.StdinPipe()
if err != nil {
return nil, err
@@ -56,13 +58,14 @@ func New() (*Client, error) {
return nil, err
}
if !bytes.HasPrefix(banner, []byte("OK")) {
- return nil, fmt.Errorf("wrong banner: %s", banner)
+ return nil, fmt.Errorf("wrong banner from %s: %q", bin, banner)
}
cl := &Client{
cmd: cmd,
in: stdin,
out: br,
+ bin: bin,
}
return cl, nil
@@ -93,7 +96,7 @@ func (c *Client) Set(key, value string) error {
}
line, _, _ := c.out.ReadLine()
if string(line) != "OK" {
- return fmt.Errorf("error: %s", line)
+ return fmt.Errorf("error from %s: %q", c.bin, line)
}
return nil
}
@@ -106,7 +109,7 @@ func (c *Client) Option(value string) error {
}
line, _, _ := c.out.ReadLine()
if string(line) != "OK" {
- return fmt.Errorf("error: %s", line)
+ return fmt.Errorf("error from %s: %q", c.bin, line)
}
return nil
}
@@ -132,7 +135,7 @@ func (c *Client) GetPin() ([]byte, error) {
}
// now there should be some data
if !bytes.HasPrefix(buf, []byte("D ")) {
- return nil, fmt.Errorf("unexpected response: %s", buf)
+ return nil, fmt.Errorf("unexpected response from %s: %s", c.bin, buf)
}
pin := make([]byte, len(buf))
@@ -145,7 +148,7 @@ func (c *Client) GetPin() ([]byte, error) {
return nil, err
}
if !bytes.HasPrefix(ok, []byte("OK")) {
- return nil, fmt.Errorf("unexpected response: %s", ok)
+ return nil, fmt.Errorf("unexpected response from %s: %s", c.bin, ok)
}
pin = pin[2:]
diff --git a/pinentry_darwin.go b/pinentry_darwin.go
index f634a1e..40c0c86 100644
--- a/pinentry_darwin.go
+++ b/pinentry_darwin.go
@@ -1,11 +1,20 @@
+//go:build darwin
// +build darwin
package pinentry
-import "github.com/gopasspw/pinentry/gpgconf"
+import (
+ "os/exec"
+
+ "github.com/gopasspw/pinentry/gpgconf"
+)
// GetBinary always returns pinentry-mac
func GetBinary() string {
+ // check, whether the returned path acutally exists
+ if _, err := exec.LookPath("pinentry-mac"); err == nil {
+ return "pinentry-mac"
+ }
if p, err := gpgconf.Path("pinentry"); err == nil && p != "" {
return p
}
diff --git a/pinentry_others.go b/pinentry_others.go
index 4a60e38..a0380f8 100644
--- a/pinentry_others.go
+++ b/pinentry_others.go
@@ -2,12 +2,18 @@
package pinentry
-import "github.com/gopasspw/pinentry/gpgconf"
+import (
+ "github.com/gopasspw/pinentry/gpgconf"
+ "os/exec"
+)
// GetBinary returns the binary name
func GetBinary() string {
if p, err := gpgconf.Path("pinentry"); err == nil && p != "" {
- return p
+ // check, whether the returned path acutally exists
+ if _, err := exec.LookPath(p); err == nil {
+ return p
+ }
}
return "pinentry"
}
Debdiff
File lists identical (after any substitutions)
No differences were encountered in the control files