From db5cb4f15c053c250047cf83390c1ec0cbdcd07c Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 3 Feb 2020 16:35:01 +0100 Subject: embeddable-wg-library: use newer string_list This ports 1d2d6200b8ff517db0f7530645180df3cc4afa74. Signed-off-by: Jason A. Donenfeld --- contrib/embeddable-wg-library/test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'contrib/embeddable-wg-library/test.c') diff --git a/contrib/embeddable-wg-library/test.c b/contrib/embeddable-wg-library/test.c index 4c95373..f9a8bd4 100644 --- a/contrib/embeddable-wg-library/test.c +++ b/contrib/embeddable-wg-library/test.c @@ -27,8 +27,11 @@ void list_devices(void) perror("Unable to get device"); continue; } - wg_key_to_base64(key, device->public_key); - printf("%s has public key %s\n", device_name, key); + if (device->flags & WGDEVICE_HAS_PUBLIC_KEY) { + wg_key_to_base64(key, device->public_key); + printf("%s has public key %s\n", device_name, key); + } else + printf("%s has no public key\n", device_name); wg_for_each_peer(device, peer) { wg_key_to_base64(key, peer->public_key); printf(" - peer %s\n", key); -- cgit v1.2.3-59-g8ed1b