Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmaguire committed Mar 27, 2024
1 parent 2854858 commit 5066c0b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions sshd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 5066c0b

Please sign in to comment.