1 Commits

Author SHA1 Message Date
Timmy Welch
8f5bdaed8a Fix hostkey being too short
Some checks failed
Push / CI (push) Has been cancelled
Modern versions of ssh refuse to connect to a server with a rsa key that
  is less than 2048 and this may change to 3072 or 4096 in the future.
  ed25519 cannot change keysize
2025-12-28 13:12:09 -08:00

View File

@@ -6,8 +6,8 @@ import (
"bufio"
"bytes"
"context"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"flag"
@@ -91,7 +91,7 @@ func loadHostKey(path string) (ssh.Signer, error) {
}
func createHostKey(path string) (ssh.Signer, error) {
key, err := rsa.GenerateKey(rand.Reader, 1024)
_, key, err := ed25519.GenerateKey(rand.Reader)
if err != nil {
return nil, err
}