mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
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:
parent
3d96f41053
commit
5fe11cedb6
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user