Add AES-256-GCM support to SPTPS.
[tinc] / src / sptps_test.c
index b26615e..73f4ec0 100644 (file)
@@ -154,7 +154,7 @@ static struct option const long_options[] = {
 };
 
 static void usage(void) {
-       static const char *message =
+       fprintf(stderr,
                "Usage: %s [options] my_ed25519_key_file his_ed25519_key_file [host] port\n"
                "\n"
                "Valid options are:\n"
@@ -172,9 +172,8 @@ static void usage(void) {
                "  -4                      Use IPv4.\n"
                "  -6                      Use IPv6.\n"
                "\n"
-               "Report bugs to tinc@tinc-vpn.org.\n";
-
-       fprintf(stderr, message, program_name);
+               "Report bugs to tinc@tinc-vpn.org.\n",
+               program_name);
 }
 
 #ifdef HAVE_WINDOWS
@@ -584,7 +583,18 @@ static int run_test(int argc, char *argv[]) {
 
        sptps_t s;
 
-       if(!sptps_start(&s, &sock, initiator, datagram, mykey, hiskey, "sptps_test", 10, send_data, receive_record)) {
+       sptps_params_t params = {
+               .handle = &sock,
+               .initiator = initiator,
+               .datagram = datagram,
+               .mykey = mykey,
+               .hiskey = hiskey,
+               .label = "sptps_test",
+               .send_data = send_data,
+               .receive_record = receive_record,
+       };
+
+       if(!sptps_start(&s, &params)) {
                ecdsa_free(mykey);
                ecdsa_free(hiskey);
                return 1;