Use go-pinentry instead of go-pinentry-minimal#136
Conversation
go-pinentry-minimal is archived and isn't maintained.
|
If you use the latest go-pinentry, there are no additional dependencies. And there is only a tiny adjustment needed to deal with what GetPIN now returns. I tried it out for the sake of twpayne/go-pinentry#17 |
Thanks. Seems simple enough. I got it to build with just the patch below. It did include some other Go packages, but it looks like they are only used in testing diff --git a/cmd/tkey-ssh-agent/pinentry.go b/cmd/tkey-ssh-agent/pinentry.go
index 4e40452..32a1a05 100644
--- a/cmd/tkey-ssh-agent/pinentry.go
+++ b/cmd/tkey-ssh-agent/pinentry.go
@@ -15,7 +15,7 @@ import (
"strings"
"text/template"
- "github.com/twpayne/go-pinentry"
+ "github.com/twpayne/go-pinentry/v4"
)
func getSecret(udi string, pinentryProgram string) ([]byte, error) {
@@ -66,11 +66,11 @@ func getSecret(udi string, pinentryProgram string) ([]byte, error) {
defer client.Close()
- pin, _, err := client.GetPIN()
+ pin, err := client.GetPIN()
if err != nil {
return nil, fmt.Errorf("pinentry GetPin: %w", err)
}
- return []byte(pin), nil
+ return []byte(pin.PIN), nil
}
func findWindowsPinentry() string { |
- Use new API breaking version of go-pinenty - Change to use new client.GetPIN() which returns different number of args and different types.
quite
left a comment
There was a problem hiding this comment.
Looks good. I'm thinking this will not cause any change for darwin or windows.
go-pinentry-minimal is archived and isn't maintained.
Description
Since go-pinentry-minimal is archived and isn't maintained, we adapt to the github.com/twpayne/go-pinentry package instead. This, however, depends on:
which we have to look into before accepting this.
Only tested on Linux so far.
Fixes #124
Type of change
Submission checklist