Fix pinentry

This commit is contained in:
Bernd Schoolmann 2024-06-01 15:18:11 +02:00
parent a41c91ca6b
commit 2651a36d3c
No known key found for this signature in database
2 changed files with 9 additions and 3 deletions

View File

@ -1,16 +1,22 @@
//go:build freebsd || linux
//go:build freebsd || linux || darwin
package pinentry
import (
"errors"
"runtime"
"github.com/twpayne/go-pinentry"
)
func getPassword(title string, description string) (string, error) {
binaryClientOption := pinentry.WithBinaryNameFromGnuPGAgentConf()
if runtime.GOOS == "darwin" {
binaryClientOption = pinentry.WithBinaryName("pinentry-mac")
}
client, err := pinentry.NewClient(
pinentry.WithBinaryNameFromGnuPGAgentConf(),
binaryClientOption,
pinentry.WithGPGTTY(),
pinentry.WithTitle(title),
pinentry.WithDesc(description),

View File

@ -1,4 +1,4 @@
//go:build windows || darwin
//go:build windows
package pinentry