mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	go1.16 (#14783)
This commit is contained in:
		
							
								
								
									
										2
									
								
								vendor/github.com/xanzy/ssh-agent/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/xanzy/ssh-agent/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										12
									
								
								vendor/github.com/xanzy/ssh-agent/go.sum
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								vendor/github.com/xanzy/ssh-agent/go.sum
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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=
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								vendor/github.com/xanzy/ssh-agent/pageant_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/xanzy/ssh-agent/pageant_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										31
									
								
								vendor/github.com/xanzy/ssh-agent/sshagent_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								vendor/github.com/xanzy/ssh-agent/sshagent_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user