aboutsummaryrefslogtreecommitdiff
path: root/src/regex/gnunet-daemon-regexprofiler.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-06-26 17:21:22 +0000
committerChristian Grothoff <christian@grothoff.org>2013-06-26 17:21:22 +0000
commit3999807382f98843cdde19211fc94484d0793087 (patch)
treeeab97299e72edbfdd5d6f409db0729d9780d3e5e /src/regex/gnunet-daemon-regexprofiler.c
parentabc1a0ea19b7dc199b83749d31e32622c7469ded (diff)
downloadgnunet-3999807382f98843cdde19211fc94484d0793087.tar.gz
gnunet-3999807382f98843cdde19211fc94484d0793087.zip
-introducing signing of regex accept states, removing PID from regex API
Diffstat (limited to 'src/regex/gnunet-daemon-regexprofiler.c')
-rw-r--r--src/regex/gnunet-daemon-regexprofiler.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/regex/gnunet-daemon-regexprofiler.c b/src/regex/gnunet-daemon-regexprofiler.c
index 3f4dd087f..d4c9cb7cb 100644
--- a/src/regex/gnunet-daemon-regexprofiler.c
+++ b/src/regex/gnunet-daemon-regexprofiler.c
@@ -95,6 +95,12 @@ static char *rx_with_pfx;
95 */ 95 */
96static unsigned int rounds = 5; 96static unsigned int rounds = 5;
97 97
98/**
99 * Private key for this peer.
100 */
101static struct GNUNET_CRYPTO_EccPrivateKey *my_private_key;
102
103
98 104
99/** 105/**
100 * Task run during shutdown. 106 * Task run during shutdown.
@@ -118,6 +124,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
118 GNUNET_DHT_disconnect (dht_handle); 124 GNUNET_DHT_disconnect (dht_handle);
119 dht_handle = NULL; 125 dht_handle = NULL;
120 } 126 }
127 GNUNET_CRYPTO_ecc_key_free (my_private_key);
128 my_private_key = NULL;
121 129
122 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 130 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
123 "Daemon for %s shutting down\n", 131 "Daemon for %s shutting down\n",
@@ -134,7 +142,6 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
134static void 142static void
135reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 143reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
136{ 144{
137 struct GNUNET_PeerIdentity id;
138 struct GNUNET_TIME_Relative random_delay; 145 struct GNUNET_TIME_Relative random_delay;
139 char *regex = cls; 146 char *regex = cls;
140 147
@@ -159,12 +166,11 @@ reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
159 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 166 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
160 "First time, creating regex: %s\n", 167 "First time, creating regex: %s\n",
161 regex); 168 regex);
162 memset (&id, 0, sizeof (struct GNUNET_PeerIdentity));
163 announce_handle = REGEX_INTERNAL_announce (dht_handle, 169 announce_handle = REGEX_INTERNAL_announce (dht_handle,
164 &id, 170 my_private_key,
165 regex, 171 regex,
166 (unsigned int) max_path_compression, 172 (unsigned int) max_path_compression,
167 stats_handle); 173 stats_handle);
168 } 174 }
169 else 175 else
170 { 176 {
@@ -252,6 +258,8 @@ run (void *cls, char *const *args GNUNET_UNUSED,
252 258
253 cfg = cfg_; 259 cfg = cfg_;
254 260
261 my_private_key = GNUNET_CRYPTO_ecc_key_create_from_configuration (cfg);
262 GNUNET_assert (NULL != my_private_key);
255 if (GNUNET_OK != 263 if (GNUNET_OK !=
256 GNUNET_CONFIGURATION_get_value_number (cfg, "REGEXPROFILER", 264 GNUNET_CONFIGURATION_get_value_number (cfg, "REGEXPROFILER",
257 "MAX_PATH_COMPRESSION", 265 "MAX_PATH_COMPRESSION",