mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
Revert "ssh,tempfork/gliderlabs/ssh: replace github.com/tailscale/golang-x-crypto/ssh with golang.org/x/crypto/ssh"
This reverts commit 46fd4e58a2
.
We don't want to include this in 1.80 yet, but can add it back post 1.80.
Updates #8593
Signed-off-by: Percy Wegmann <percy@tailscale.com>
This commit is contained in:

committed by
Percy Wegmann

parent
52f88f782a
commit
b60f6b849a
@@ -7,7 +7,7 @@ import (
|
||||
"path"
|
||||
"sync"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -6,7 +6,7 @@ import (
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
// contextKey is a value for use with context.WithValue. It's used as
|
||||
@@ -55,6 +55,8 @@ var (
|
||||
// ContextKeyPublicKey is a context key for use with Contexts in this package.
|
||||
// The associated value will be of type PublicKey.
|
||||
ContextKeyPublicKey = &contextKey{"public-key"}
|
||||
|
||||
ContextKeySendAuthBanner = &contextKey{"send-auth-banner"}
|
||||
)
|
||||
|
||||
// Context is a package specific context interface. It exposes connection
|
||||
@@ -89,6 +91,8 @@ type Context interface {
|
||||
|
||||
// SetValue allows you to easily write new values into the underlying context.
|
||||
SetValue(key, value interface{})
|
||||
|
||||
SendAuthBanner(banner string) error
|
||||
}
|
||||
|
||||
type sshContext struct {
|
||||
@@ -117,6 +121,7 @@ func applyConnMetadata(ctx Context, conn gossh.ConnMetadata) {
|
||||
ctx.SetValue(ContextKeyUser, conn.User())
|
||||
ctx.SetValue(ContextKeyLocalAddr, conn.LocalAddr())
|
||||
ctx.SetValue(ContextKeyRemoteAddr, conn.RemoteAddr())
|
||||
ctx.SetValue(ContextKeySendAuthBanner, conn.SendAuthBanner)
|
||||
}
|
||||
|
||||
func (ctx *sshContext) SetValue(key, value interface{}) {
|
||||
@@ -153,3 +158,7 @@ func (ctx *sshContext) LocalAddr() net.Addr {
|
||||
func (ctx *sshContext) Permissions() *Permissions {
|
||||
return ctx.Value(ContextKeyPermissions).(*Permissions)
|
||||
}
|
||||
|
||||
func (ctx *sshContext) SendAuthBanner(msg string) error {
|
||||
return ctx.Value(ContextKeySendAuthBanner).(func(string) error)(msg)
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ package ssh
|
||||
import (
|
||||
"os"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
// PasswordAuth returns a functional option that sets PasswordHandler on the server.
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
func newTestSessionWithOptions(t *testing.T, srv *Server, cfg *gossh.ClientConfig, options ...Option) (*gossh.Session, *gossh.Client, func()) {
|
||||
|
@@ -8,7 +8,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
// ErrServerClosed is returned by the Server's Serve, ListenAndServe,
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/anmitsu/go-shlex"
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
// Session provides access to information about an SSH session and methods
|
||||
|
@@ -9,7 +9,7 @@ import (
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
func (srv *Server) serveOnce(l net.Listener) error {
|
||||
|
@@ -4,7 +4,7 @@ import (
|
||||
"crypto/subtle"
|
||||
"net"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
type Signal string
|
||||
@@ -105,7 +105,7 @@ type Pty struct {
|
||||
// requested by the client as part of the pty-req. These are outlined as
|
||||
// part of https://datatracker.ietf.org/doc/html/rfc4254#section-8.
|
||||
//
|
||||
// The opcodes are defined as constants in golang.org/x/crypto/ssh (VINTR,VQUIT,etc.).
|
||||
// The opcodes are defined as constants in github.com/tailscale/golang-x-crypto/ssh (VINTR,VQUIT,etc.).
|
||||
// Boolean opcodes have values 0 or 1.
|
||||
Modes gossh.TerminalModes
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"strconv"
|
||||
"sync"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -10,7 +10,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
gossh "golang.org/x/crypto/ssh"
|
||||
gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
var sampleServerResponse = []byte("Hello world")
|
||||
|
@@ -5,7 +5,7 @@ import (
|
||||
"crypto/rsa"
|
||||
"encoding/binary"
|
||||
|
||||
"golang.org/x/crypto/ssh"
|
||||
"github.com/tailscale/golang-x-crypto/ssh"
|
||||
)
|
||||
|
||||
func generateSigner() (ssh.Signer, error) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
package ssh
|
||||
|
||||
import gossh "golang.org/x/crypto/ssh"
|
||||
import gossh "github.com/tailscale/golang-x-crypto/ssh"
|
||||
|
||||
// PublicKey is an abstraction of different types of public keys.
|
||||
type PublicKey interface {
|
||||
|
Reference in New Issue
Block a user