Add post-quantum support
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 26s

This commit is contained in:
2025-11-06 16:21:54 +01:00
parent 2e40d02605
commit d9df32f7cf
5 changed files with 19 additions and 13 deletions

View File

@@ -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()
}
}