summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/xanzy
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2021-02-28 18:08:33 -0500
committerGitHub <noreply@github.com>2021-02-28 18:08:33 -0500
commit47f6a4ec3f058f69b65fb6501d6ac98994b8f8da (patch)
tree4d1421a4c836de9de4014117419c151035c17eec /vendor/github.com/xanzy
parent030646eea41e17e58e11e73b19339630b6d6148e (diff)
downloadgitea-47f6a4ec3f058f69b65fb6501d6ac98994b8f8da.tar.gz
gitea-47f6a4ec3f058f69b65fb6501d6ac98994b8f8da.zip
go1.16 (#14783)
Diffstat (limited to 'vendor/github.com/xanzy')
-rw-r--r--vendor/github.com/xanzy/ssh-agent/go.mod2
-rw-r--r--vendor/github.com/xanzy/ssh-agent/go.sum12
-rw-r--r--vendor/github.com/xanzy/ssh-agent/pageant_windows.go3
-rw-r--r--vendor/github.com/xanzy/ssh-agent/sshagent_windows.go31
4 files changed, 40 insertions, 8 deletions
diff --git a/vendor/github.com/xanzy/ssh-agent/go.mod b/vendor/github.com/xanzy/ssh-agent/go.mod
index 6664c4888e..80eaca0f6e 100644
--- a/vendor/github.com/xanzy/ssh-agent/go.mod
+++ b/vendor/github.com/xanzy/ssh-agent/go.mod
@@ -1,6 +1,6 @@
module github.com/xanzy/ssh-agent
require (
+ github.com/Microsoft/go-winio v0.4.14
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2
- golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0 // indirect
)
diff --git a/vendor/github.com/xanzy/ssh-agent/go.sum b/vendor/github.com/xanzy/ssh-agent/go.sum
index a9a0016921..e221368f32 100644
--- a/vendor/github.com/xanzy/ssh-agent/go.sum
+++ b/vendor/github.com/xanzy/ssh-agent/go.sum
@@ -1,4 +1,16 @@
+github.com/Microsoft/go-winio v0.4.14 h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=
+github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2 h1:NwxKRvbkH5MsNkvOtPZi3/3kmI8CAzs3mtv+GLQMkNo=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0 h1:bzeyCHgoAyjZjAhvTpks+qM7sdlh4cCSitmXeCEO3B4=
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b h1:ag/x1USPSsqHud38I9BAC88qdNLDHHtQ4mlgQIZPPNA=
+golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
diff --git a/vendor/github.com/xanzy/ssh-agent/pageant_windows.go b/vendor/github.com/xanzy/ssh-agent/pageant_windows.go
index 6295607966..21d3cba2a5 100644
--- a/vendor/github.com/xanzy/ssh-agent/pageant_windows.go
+++ b/vendor/github.com/xanzy/ssh-agent/pageant_windows.go
@@ -69,9 +69,6 @@ func winAPI(dllName, funcName string) func(...uintptr) (uintptr, uintptr, error)
return func(a ...uintptr) (uintptr, uintptr, error) { return proc.Call(a...) }
}
-// Available returns true if Pageant is running
-func Available() bool { return pageantWindow() != 0 }
-
// Query sends message msg to Pageant and returns response or error.
// 'msg' is raw agent request with length prefix
// Response is raw agent response with length prefix
diff --git a/vendor/github.com/xanzy/ssh-agent/sshagent_windows.go b/vendor/github.com/xanzy/ssh-agent/sshagent_windows.go
index c46710e88e..ca77e6a965 100644
--- a/vendor/github.com/xanzy/ssh-agent/sshagent_windows.go
+++ b/vendor/github.com/xanzy/ssh-agent/sshagent_windows.go
@@ -27,17 +27,40 @@ import (
"net"
"sync"
+ "github.com/Microsoft/go-winio"
"golang.org/x/crypto/ssh/agent"
)
+const (
+ sshAgentPipe = `\\.\pipe\openssh-ssh-agent`
+)
+
+// Available returns true if Pageant is running
+func Available() bool {
+ if pageantWindow() != 0 {
+ return true
+ }
+ conn, err := winio.DialPipe(sshAgentPipe, nil)
+ if err != nil {
+ return false
+ }
+ conn.Close()
+ return true
+}
+
// New returns a new agent.Agent and the (custom) connection it uses
// to communicate with a running pagent.exe instance (see README.md)
func New() (agent.Agent, net.Conn, error) {
- if !Available() {
- return nil, nil, errors.New("SSH agent requested but Pageant not running")
+ if pageantWindow() != 0 {
+ return agent.NewClient(&conn{}), nil, nil
}
-
- return agent.NewClient(&conn{}), nil, nil
+ conn, err := winio.DialPipe(sshAgentPipe, nil)
+ if err != nil {
+ return nil, nil, errors.New(
+ "SSH agent requested, but could not detect Pageant or Windows native SSH agent",
+ )
+ }
+ return agent.NewClient(conn), nil, nil
}
type conn struct {