mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 06:08:15 +02:00
Bump deps
``` * use go 1.17 semantics in go.mod * pin tonistiigi/fsutil dep to match docker/docker's dep go get -u ./... go mod vendor ```
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ If you have an issue: report it on the [issue tracker](https://github.com/xanzy/
|
||||
|
||||
## Author
|
||||
|
||||
Sander van Harmelen (<sander@xanzy.io>)
|
||||
Sander van Harmelen (<sander@vanharmelen.nl>)
|
||||
|
||||
## License
|
||||
|
||||
|
||||
-6
@@ -1,6 +0,0 @@
|
||||
module github.com/xanzy/ssh-agent
|
||||
|
||||
require (
|
||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2
|
||||
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0 // indirect
|
||||
)
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
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-20190221075227-b4e8571b14e0 h1:bzeyCHgoAyjZjAhvTpks+qM7sdlh4cCSitmXeCEO3B4=
|
||||
golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
-3
@@ -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
|
||||
|
||||
+27
-4
@@ -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