Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Commit

Permalink
add option to specify gpg base path
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Kohlbau <[email protected]>
  • Loading branch information
tobiaskohlbau committed Jun 17, 2021
1 parent 6a592d3 commit 4040587
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ const (
)

var (
verbose = flag.Bool("verbose", false, "Enable verbose logging")
logFile = flag.String("logfile", "wsl2-gpg-ssh.log", "Path to logfile")
gpg = flag.String("gpg", "", "gpg mode")
ssh = flag.String("ssh", "", "windows ssh mode")
verbose = flag.Bool("verbose", false, "Enable verbose logging")
logFile = flag.String("logfile", "wsl2-gpg-ssh.log", "Path to logfile")
gpg = flag.String("gpg", "", "gpg mode")
gpgConfigBasepath = flag.String("gpgConfigBasepath", "", "gpg config path on windows")
ssh = flag.String("ssh", "", "windows ssh mode")

failureMessage = [...]byte{0, 0, 0, 1, 5}
)
Expand Down Expand Up @@ -144,7 +145,11 @@ func main() {
if err != nil {
log.Fatal("failed to find user home dir")
}
basePath := filepath.Join(homeDir, "AppData", "Roaming", "gnupg")
basePath := *gpgConfigBasepath
// fallback to default location if not specified
if basePath == "" {
basePath = filepath.Join(homeDir, "AppData", "Roaming", "gnupg")
}
handleGPG(filepath.Join(basePath, *gpg))
return
}
Expand Down Expand Up @@ -260,6 +265,7 @@ func handleSSH() {
return
}

log.Printf("Querying pageant")
result, err := queryPageant(append(lenBuf, buf...))
if err != nil {
// If for some reason talking to Pageant fails we fall back to
Expand Down

0 comments on commit 4040587

Please sign in to comment.