wireguard: add wrapper function that generates client key pair

Signed-off-by: Frederico Gomes <fredericojfgomes@gmail.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Frederico Gomes 2026-03-13 11:47:21 +00:00 committed by James Valleroy
parent 3d96f41053
commit 5fe11cedb6
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -160,6 +160,13 @@ def _generate_private_key():
return process.stdout.decode().strip()
def generate_client_keypair():
"""Generate client private/public keypair."""
private_key = _generate_private_key()
public_key = _get_public_key_from_private_key(private_key)
return private_key, public_key
def _find_next_interface():
"""Find next unused wireguard interface name."""
output = subprocess.check_output(['wg', 'show',