From 5066c0bfabf05df74285c356e66382d37222c0b1 Mon Sep 17 00:00:00 2001 From: John Maguire Date: Wed, 27 Mar 2024 12:25:27 -0400 Subject: [PATCH] Review feedback --- sshd/server.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/sshd/server.go b/sshd/server.go index cfe1b7908..9e8c721ee 100644 --- a/sshd/server.go +++ b/sshd/server.go @@ -49,7 +49,6 @@ func NewSSHServer(l *logrus.Entry) (*SSHServer, error) { if bytes.Equal(ca.Marshal(), auth.Marshal()) { return true } - fmt.Println("didn't pass ca check") } return false @@ -235,26 +234,3 @@ func (s *SSHServer) closeSessions() { } s.connsLock.Unlock() } - -func (s *SSHServer) matchPubKey(c ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error) { - pk := string(pubKey.Marshal()) - fp := ssh.FingerprintSHA256(pubKey) - - tk, ok := s.trustedKeys[c.User()] - if !ok { - return nil, fmt.Errorf("unknown user %s", c.User()) - } - - _, ok = tk[pk] - if !ok { - return nil, fmt.Errorf("unknown public key for %s (%s)", c.User(), fp) - } - - return &ssh.Permissions{ - // Record the public key used for authentication. - Extensions: map[string]string{ - "fp": fp, - "user": c.User(), - }, - }, nil -}