aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/examples/embeddable-wg-library/test.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-02-21 19:19:50 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2018-03-02 16:42:29 +0100
commitec65415b231bc9a0fd5c72ab16d98153ae426177 (patch)
treeea802b4e2bac3e0174354e9938ef882fe76f9c77 /contrib/examples/embeddable-wg-library/test.c
parentallowedips: fix comment style (diff)
downloadwireguard-monolithic-historical-ec65415b231bc9a0fd5c72ab16d98153ae426177.tar.xz
wireguard-monolithic-historical-ec65415b231bc9a0fd5c72ab16d98153ae426177.zip
contrib: embedded-wg-library: add key generation functions
Diffstat (limited to 'contrib/examples/embeddable-wg-library/test.c')
-rw-r--r--contrib/examples/embeddable-wg-library/test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/examples/embeddable-wg-library/test.c b/contrib/examples/embeddable-wg-library/test.c
index aad24de..8d4aae3 100644
--- a/contrib/examples/embeddable-wg-library/test.c
+++ b/contrib/examples/embeddable-wg-library/test.c
@@ -50,9 +50,11 @@ int main(int argc, char *argv[])
.first_peer = &new_peer,
.last_peer = &new_peer
};
+ wg_key temp_private_key;
- wg_key_from_base64(new_device.private_key, "SFLKy56SOiFoAvQDSCBRrH/nyYonuAQnyr/JTQRPDlU=");
- wg_key_from_base64(new_peer.public_key, "aNoLvvCfgbtTf4f2Eb/CWVNvIc5AJt/4C4pKrxMUZlM=");
+ wg_generate_private_key(temp_private_key);
+ wg_generate_public_key(new_peer.public_key, temp_private_key);
+ wg_generate_private_key(new_device.private_key);
if (wg_add_device(new_device.name) < 0) {
perror("Unable to add device");