aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/embeddable-wg-library/test.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-02-03 16:35:01 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-02-03 16:35:01 +0100
commitdb5cb4f15c053c250047cf83390c1ec0cbdcd07c (patch)
treee0539e659467083b5e1ce8e46dee9e089831be88 /contrib/embeddable-wg-library/test.c
parentextract-{handshakes,keys}: rework for upstream kernel (diff)
downloadwireguard-tools-db5cb4f15c053c250047cf83390c1ec0cbdcd07c.tar.xz
wireguard-tools-db5cb4f15c053c250047cf83390c1ec0cbdcd07c.zip
embeddable-wg-library: use newer string_list
This ports 1d2d6200b8ff517db0f7530645180df3cc4afa74. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'contrib/embeddable-wg-library/test.c')
-rw-r--r--contrib/embeddable-wg-library/test.c7
1 files changed, 5 insertions, 2 deletions
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);