aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/gnunet-cadet.c2
-rw-r--r--src/cadet/gnunet-service-cadet_tunnels.c6
-rw-r--r--src/cadet/test_cadeT.c47
3 files changed, 38 insertions, 17 deletions
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index f3ccd9883..9b7538ae7 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -840,7 +840,7 @@ main (int argc, char *const *argv)
840 &run, 840 &run,
841 NULL); 841 NULL);
842 842
843 GNUNET_free ((void *) argv); 843 GNUNET_free_nz ((void *) argv);
844 844
845 if (GNUNET_OK == res) 845 if (GNUNET_OK == res)
846 return 0; 846 return 0;
diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c
index ae201ed2d..f1f2ec81f 100644
--- a/src/cadet/gnunet-service-cadet_tunnels.c
+++ b/src/cadet/gnunet-service-cadet_tunnels.c
@@ -677,8 +677,7 @@ new_ephemeral (struct CadetTunnelAxolotl *ax)
677{ 677{
678 LOG (GNUNET_ERROR_TYPE_DEBUG, 678 LOG (GNUNET_ERROR_TYPE_DEBUG,
679 "Creating new ephemeral ratchet key (DHRs)\n"); 679 "Creating new ephemeral ratchet key (DHRs)\n");
680 GNUNET_assert (GNUNET_OK == 680 GNUNET_CRYPTO_ecdhe_key_create (&ax->DHRs);
681 GNUNET_CRYPTO_ecdhe_key_create2 (&ax->DHRs));
682} 681}
683 682
684 683
@@ -3186,8 +3185,7 @@ GCT_create_tunnel (struct CadetPeer *destination)
3186 3185
3187 t->kx_retry_delay = INITIAL_KX_RETRY_DELAY; 3186 t->kx_retry_delay = INITIAL_KX_RETRY_DELAY;
3188 new_ephemeral (&t->ax); 3187 new_ephemeral (&t->ax);
3189 GNUNET_assert (GNUNET_OK == 3188 GNUNET_CRYPTO_ecdhe_key_create (&t->ax.kx_0);
3190 GNUNET_CRYPTO_ecdhe_key_create2 (&t->ax.kx_0));
3191 t->destination = destination; 3189 t->destination = destination;
3192 t->channels = GNUNET_CONTAINER_multihashmap32_create (8); 3190 t->channels = GNUNET_CONTAINER_multihashmap32_create (8);
3193 t->maintain_connections_task 3191 t->maintain_connections_task
diff --git a/src/cadet/test_cadeT.c b/src/cadet/test_cadeT.c
index 3bf8e2ad9..97f315167 100644
--- a/src/cadet/test_cadeT.c
+++ b/src/cadet/test_cadeT.c
@@ -62,29 +62,50 @@
62/****************************** TEST LOGIC ********************************/ 62/****************************** TEST LOGIC ********************************/
63 63
64static int kx_initiator; 64static int kx_initiator;
65 65static struct GNUNET_TESTBED_UnderlayLinkModel *model;
66void
67handle_message (void *cls,
68 const struct GNUNET_MessageHeader *msg)
69{
70 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__);
71}
72 66
73static void 67static void
74send_message () 68send_message ()
75{ 69{
76 struct GNUNET_MQ_Envelope *envelope; 70 struct GNUNET_MQ_Envelope *envelope;
77 struct GNUNET_MessageHeader *msg; 71 struct GNUNET_MessageHeader *msg;
72 int *data;
78 73
79 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); 74 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__);
80 75
81 envelope = GNUNET_MQ_msg (msg, 76 envelope = GNUNET_MQ_msg_extra (msg, 10000,
82 GNUNET_MESSAGE_TYPE_DUMMY); 77 GNUNET_MESSAGE_TYPE_DUMMY);
78 data = (int *) &msg[1];
79 *data = 1000;
83 80
84 GNUNET_MQ_send (GNUNET_CADET_get_mq (test_peers[0].channel), 81 GNUNET_MQ_send (GNUNET_CADET_get_mq (test_peers[0].channel),
85 envelope); 82 envelope);
86} 83}
87 84
85int
86check_message (void *cls,
87 const struct GNUNET_MessageHeader *message)
88{
89 return GNUNET_OK; /* all is well-formed */
90}
91
92void
93handle_message (void *cls,
94 const struct GNUNET_MessageHeader *msg)
95{
96 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__);
97
98/*
99 model = GNUNET_TESTBED_underlaylinkmodel_create (test_peers[1].testbed_peer,
100 GNUNET_TESTBED_UNDERLAYLINKMODELTYPE_BLACKLIST);
101 GNUNET_TESTBED_underlaylinkmodel_set_link (model,
102 test_peers[0].testbed_peer,
103 0, 100, 0);
104 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s: Modified link model.\n", __func__);
105*/
106 send_message();
107}
108
88/** 109/**
89 * This function is called after all testbed management is done and the 110 * This function is called after all testbed management is done and the
90 * testbed peers are ready for the actual test logic. 111 * testbed peers are ready for the actual test logic.
@@ -98,10 +119,12 @@ run_test ()
98 kx_initiator = (0 < GNUNET_memcmp (&test_peers[0].id, &test_peers[1].id)) ? 1 : 0; 119 kx_initiator = (0 < GNUNET_memcmp (&test_peers[0].id, &test_peers[1].id)) ? 1 : 0;
99 120
100 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 121 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
101 "KX initiator is peer %s\n", 122 "KX initiator is peer %s (idx:%i)\n",
102 GNUNET_i2s (&test_peers[kx_initiator].id)); 123 GNUNET_i2s (&test_peers[kx_initiator].id),
124 kx_initiator);
103 125
104 send_message(); 126 for (int i=0; i<10; i++)
127 send_message();
105} 128}
106 129
107 130