mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-30 10:38:28 +01:00
lint
* reduce staticcheck warnings
This commit is contained in:
@@ -23,7 +23,6 @@ type SSHServer struct {
|
||||
trustedCAs []ssh.PublicKey
|
||||
|
||||
// List of available commands
|
||||
helpCommand *Command
|
||||
commands *radix.Tree
|
||||
listener net.Listener
|
||||
|
||||
@@ -43,7 +42,7 @@ func NewSSHServer(l *logrus.Entry) (*SSHServer, error) {
|
||||
conns: make(map[int]*session),
|
||||
}
|
||||
|
||||
cc := ssh.CertChecker{
|
||||
cc := &ssh.CertChecker{
|
||||
IsUserAuthority: func(auth ssh.PublicKey) bool {
|
||||
for _, ca := range s.trustedCAs {
|
||||
if bytes.Equal(ca.Marshal(), auth.Marshal()) {
|
||||
@@ -77,10 +76,11 @@ func NewSSHServer(l *logrus.Entry) (*SSHServer, error) {
|
||||
|
||||
},
|
||||
}
|
||||
s.certChecker = cc
|
||||
|
||||
s.config = &ssh.ServerConfig{
|
||||
PublicKeyCallback: cc.Authenticate,
|
||||
ServerVersion: fmt.Sprintf("SSH-2.0-Nebula???"),
|
||||
ServerVersion: "SSH-2.0-Nebula???",
|
||||
}
|
||||
|
||||
s.RegisterCommand(&Command{
|
||||
|
||||
@@ -170,7 +170,6 @@ func (s *session) dispatchCommand(line string, w StringWriter) {
|
||||
}
|
||||
|
||||
_ = execCommand(c, args[1:], w)
|
||||
return
|
||||
}
|
||||
|
||||
func (s *session) Close() {
|
||||
|
||||
Reference in New Issue
Block a user