wireguard: Fix issues with newline in public key when adding client

- This does not effect the existing flow much but is a problem when waiting for
the public key to show up in list of peers.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2026-08-25 22:16:54 -07:00 committed by James Valleroy
parent c99f35ad0e
commit fa5c5706be
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -165,7 +165,7 @@ def delete_connections():
def _get_public_key_from_private_key(private_key): def _get_public_key_from_private_key(private_key):
process = subprocess.run(['wg', 'pubkey'], check=True, capture_output=True, process = subprocess.run(['wg', 'pubkey'], check=True, capture_output=True,
input=private_key.encode()) input=private_key.encode())
return process.stdout.decode() return process.stdout.decode().strip()
def _generate_private_key(): def _generate_private_key():