From 6b2a999f8d28d467320b6fd0384ff23751ae332d Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 11 Jan 2021 14:02:45 -0500 Subject: [PATCH] Replace ckeygen with Paramiko library calls, since ckeygen doesn't work on Windows. --- integration/util.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/integration/util.py b/integration/util.py index d4c09d073..39ec36a38 100644 --- a/integration/util.py +++ b/integration/util.py @@ -16,6 +16,8 @@ from twisted.internet.error import ProcessExitedAlready, ProcessDone import requests +from paramiko.rsakey import RSAKey + from allmydata.util.configutil import ( get_config, set_config, @@ -510,5 +512,7 @@ def await_client_ready(tahoe, timeout=10, liveness=60*2): def generate_ssh_key(path): """Create a new SSH private/public key pair.""" - check_call(["ckeygen", "--type", "rsa", "--no-passphrase", "--bits", "2048", - "--file", path, "--private-key-subtype", "v1"]) + key = RSAKey.generate(2048) + key.write_private_key_file(path) + with open(path + ".pub", "wb") as f: + f.write(b"%s %s" % (key.get_name(), key.get_base64()))