Generate FIPS compliant SSH keys

Generate FIPS compliant SSH keys required
for testing system FIPS mode support
This commit is contained in:
Miguel Martín 2023-11-20 18:20:37 +01:00 committed by Miguel Martin
parent 38f9687cc1
commit 991293a897
2 changed files with 3 additions and 1 deletions

View file

@ -260,6 +260,8 @@ func WithSSHKeyPair(f func(privateKey, publicKey string) error) error {
cmd := exec.Command("ssh-keygen",
"-N", "",
"-f", privateKey,
"-t", "rsa-sha2-256",
"-b", "2048",
)
err := cmd.Run()

View file

@ -3,7 +3,7 @@
# Create SSH key
SSH_DATA_DIR="$(mktemp -d)"
SSH_KEY=${SSH_DATA_DIR}/id_rsa
ssh-keygen -f "${SSH_KEY}" -N "" -q -t rsa
ssh-keygen -f "${SSH_KEY}" -N "" -q -t rsa-sha2-256 -b 2048
# Change cloud-init/user-data ssh key
key=" - $(cat "${SSH_KEY}".pub)"