Skip to content

Commit

Permalink
Eliminate custom ssh.DefaultPubKeyAuthAlgos() interface
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Aug 28, 2024
1 parent 1486234 commit d2b96c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
8 changes: 3 additions & 5 deletions crypto/ssh/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ import (
"net"
)

// Helper functions to export variables from this module
func DefaultPubKeyAuthAlgos() []string {
return supportedPubKeyAuthAlgos
}

type Downstream struct {
*connection
}
Expand Down Expand Up @@ -45,6 +40,9 @@ type AuthResult struct {
func NewPipeSession(c net.Conn, config *ServerConfig) (session *PipeSession, err error) {
serverConfig := *config
serverConfig.SetDefaults()
if len(serverConfig.PublicKeyAuthAlgorithms) == 0 {
serverConfig.PublicKeyAuthAlgorithms = supportedPubKeyAuthAlgos
}
conn := &connection{
sshConn: sshConn{conn: c},
}
Expand Down
5 changes: 1 addition & 4 deletions sshmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ func validateKey(config SSHKeyConfig) (ssh.Signer, error) {
}

func makeServer(config Config) (*Server, error) {
sshConfig := &ssh.ServerConfig{
ServerVersion: "SSH-2.0-taokystrong",
PublicKeyAuthAlgorithms: ssh.DefaultPubKeyAuthAlgos(),
}
sshConfig := &ssh.ServerConfig{ServerVersion: "SSH-2.0-taokystrong"}
for _, keyConf := range config.SSH.HostKeys {
key, err := validateKey(keyConf)
if err != nil {
Expand Down

0 comments on commit d2b96c7

Please sign in to comment.