Add post-quantum support
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 26s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 26s
This commit is contained in:
8
main.go
8
main.go
@@ -18,6 +18,9 @@ func main() {
|
||||
log.Fatal("COMMAND environment variable must be set")
|
||||
}
|
||||
config := &ssh.ServerConfig{
|
||||
Config: ssh.Config{
|
||||
KeyExchanges: []string{"mlkem768x25519-sha256", "curve25519-sha256", "ecdh-sha2-nistp256", "ecdh-sha2-nistp384", "ecdh-sha2-nistp521", "diffie-hellman-group14-sha256", "diffie-hellman-group16-sha512"},
|
||||
},
|
||||
NoClientAuth: true,
|
||||
}
|
||||
_, key, err := ed25519.GenerateKey(rand.Reader)
|
||||
@@ -51,6 +54,9 @@ func handleConn(conn net.Conn, config *ssh.ServerConfig) {
|
||||
conn.Close()
|
||||
return
|
||||
}
|
||||
if acm, ok := sshConn.Conn.(ssh.AlgorithmsConnMetadata); ok {
|
||||
log.Println("Negotiated KEX:", acm.Algorithms().KeyExchange)
|
||||
}
|
||||
log.Println("New connection from", sshConn.RemoteAddr(), "user", sshConn.User())
|
||||
go ssh.DiscardRequests(reqs)
|
||||
for newChannel := range chans {
|
||||
@@ -142,4 +148,4 @@ func runCommand(channel ssh.Channel, command string) {
|
||||
go io.Copy(channel, stdout)
|
||||
go io.Copy(channel, stderr)
|
||||
cmd.Wait()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user