Skip to content

Commit

Permalink
Use FIPS compliant SSH keys
Browse files Browse the repository at this point in the history
Replace `CI_PRIV_SSH_KEY` with `CI_PRIV_SSH_KEY_2` to use
a FIPS compliant SSH key.

Generate FIPS compliant SSH keys when `CI_PRIV_SSH_KEY_2` env
var is not defined.

Signed-off-by: Miguel Martín <[email protected]>
  • Loading branch information
mmartinv authored and achilleas-k committed Nov 21, 2023
1 parent 19ae19b commit 65c03a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/scripts/boot-image
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_aws_config():
def create_ssh_key():
with TemporaryDirectory() as tmpdir:
keypath = os.path.join(tmpdir, "testkey")
if ci_priv_key := os.environ.get("CI_PRIV_SSH_KEY"):
if ci_priv_key := os.environ.get("CI_PRIV_SSH_KEY_2"):
# running in CI: use key from env
with open(keypath, "w") as keyfile:
keyfile.write(ci_priv_key + "\n")
Expand All @@ -45,7 +45,7 @@ def create_ssh_key():
pubkeyfile.write(pubkey)
else:
# create an ssh key pair with empty password
cmd = ["ssh-keygen", "-N", "", "-f", keypath]
cmd = ["ssh-keygen", "-t", "ecdsa", "-b", "256", "-m", "pem", "-N", "", "-f", keypath]
runcmd(cmd)

yield keypath, keypath + ".pub"
Expand Down

0 comments on commit 65c03a0

Please sign in to comment.