diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-06-19 22:17:25 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-06-19 22:17:25 +0000 |
commit | 808ef8ab410b486c5cca7515389f608e965d53b1 (patch) | |
tree | 2a9476225227e3e550d95294db1c1b676bd23264 /src | |
parent | 50114769c42140782b3955e416d61837fe570d0b (diff) | |
download | gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.tar.gz gnunet-808ef8ab410b486c5cca7515389f608e965d53b1.zip |
-fixing testcases with new expiration code
Diffstat (limited to 'src')
-rw-r--r-- | src/namestore/test_namestore_api.c | 2 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_create.c | 24 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_create_update.c | 15 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_lookup.c | 17 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_lookup_specific_type.c | 16 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_put.c | 10 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_remove.c | 17 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_remove_not_existing_record.c | 15 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_sign_verify.c | 17 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration.c | 18 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration_specific_zone.c | 18 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_iteration_stop.c | 18 | ||||
-rw-r--r-- | src/namestore/test_namestore_api_zone_to_name.c | 7 | ||||
-rw-r--r-- | src/namestore/test_namestore_record_serialization.c | 2 | ||||
-rw-r--r-- | src/namestore/test_plugin_namestore.c | 2 |
15 files changed, 111 insertions, 87 deletions
diff --git a/src/namestore/test_namestore_api.c b/src/namestore/test_namestore_api.c index 9e56e569d..e85dd38bd 100644 --- a/src/namestore/test_namestore_api.c +++ b/src/namestore/test_namestore_api.c | |||
@@ -140,7 +140,7 @@ run (void *cls, | |||
140 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); | 140 | GNUNET_CRYPTO_rsa_key_get_public(privkey, &pubkey); |
141 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); | 141 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (pubkey), &zone); |
142 | memset (&signature, '\0', sizeof (signature)); | 142 | memset (&signature, '\0', sizeof (signature)); |
143 | rd.expiration = GNUNET_TIME_absolute_get(); | 143 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; |
144 | rd.record_type = TEST_RECORD_TYPE; | 144 | rd.record_type = TEST_RECORD_TYPE; |
145 | rd.data_size = TEST_RECORD_DATALEN; | 145 | rd.data_size = TEST_RECORD_DATALEN; |
146 | rd.data = GNUNET_malloc(TEST_RECORD_DATALEN); | 146 | rd.data = GNUNET_malloc(TEST_RECORD_DATALEN); |
diff --git a/src/namestore/test_namestore_api_create.c b/src/namestore/test_namestore_api_create.c index 916168738..5fc4f4122 100644 --- a/src/namestore/test_namestore_api_create.c +++ b/src/namestore/test_namestore_api_create.c | |||
@@ -279,7 +279,7 @@ name_lookup_initial_proc (void *cls, | |||
279 | 279 | ||
280 | /* create a second record */ | 280 | /* create a second record */ |
281 | s_second_record = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN); | 281 | s_second_record = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_RecordData) + TEST_CREATE_RECORD_DATALEN); |
282 | s_second_record->expiration = GNUNET_TIME_UNIT_FOREVER_ABS; | 282 | s_second_record->expiration_time = UINT64_MAX; |
283 | s_second_record->record_type = TEST_CREATE_RECORD_TYPE; | 283 | s_second_record->record_type = TEST_CREATE_RECORD_TYPE; |
284 | s_second_record->flags = GNUNET_NAMESTORE_RF_AUTHORITY; | 284 | s_second_record->flags = GNUNET_NAMESTORE_RF_AUTHORITY; |
285 | s_second_record->data = &s_second_record[1]; | 285 | s_second_record->data = &s_second_record[1]; |
@@ -323,21 +323,20 @@ create_first_cont (void *cls, int32_t success, const char *emsg) | |||
323 | 323 | ||
324 | 324 | ||
325 | static struct GNUNET_NAMESTORE_RecordData * | 325 | static struct GNUNET_NAMESTORE_RecordData * |
326 | create_record (int count) | 326 | create_record (unsigned int count) |
327 | { | 327 | { |
328 | int c; | 328 | unsigned int c; |
329 | struct GNUNET_NAMESTORE_RecordData * rd; | 329 | struct GNUNET_NAMESTORE_RecordData * rd; |
330 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
331 | 330 | ||
331 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
332 | for (c = 0; c < count; c++) | 332 | for (c = 0; c < count; c++) |
333 | { | 333 | { |
334 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 334 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
335 | rd[c].record_type = TEST_RECORD_TYPE; | 335 | rd[c].record_type = TEST_RECORD_TYPE; |
336 | rd[c].data_size = TEST_RECORD_DATALEN; | 336 | rd[c].data_size = TEST_RECORD_DATALEN; |
337 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 337 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
338 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 338 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
339 | } | 339 | } |
340 | |||
341 | return rd; | 340 | return rd; |
342 | } | 341 | } |
343 | 342 | ||
@@ -348,6 +347,7 @@ run (void *cls, | |||
348 | { | 347 | { |
349 | size_t rd_ser_len; | 348 | size_t rd_ser_len; |
350 | char *hostkey_file; | 349 | char *hostkey_file; |
350 | struct GNUNET_TIME_Absolute et; | ||
351 | 351 | ||
352 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,endbadly, NULL); | 352 | endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,endbadly, NULL); |
353 | /* load privat key */ | 353 | /* load privat key */ |
@@ -366,8 +366,8 @@ run (void *cls, | |||
366 | rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, s_first_record); | 366 | rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, s_first_record); |
367 | char rd_ser[rd_ser_len]; | 367 | char rd_ser[rd_ser_len]; |
368 | GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser); | 368 | GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser); |
369 | 369 | et.abs_value = s_first_record->expiration_time; | |
370 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_first_record->expiration, s_name, s_first_record, 1); | 370 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); |
371 | 371 | ||
372 | /* create random zone hash */ | 372 | /* create random zone hash */ |
373 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 373 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |
diff --git a/src/namestore/test_namestore_api_create_update.c b/src/namestore/test_namestore_api_create_update.c index e898a3050..e21ed4186 100644 --- a/src/namestore/test_namestore_api_create_update.c +++ b/src/namestore/test_namestore_api_create_update.c | |||
@@ -138,7 +138,7 @@ create_identical_cont (void *cls, int32_t success, const char *emsg) | |||
138 | if (success == GNUNET_NO) | 138 | if (success == GNUNET_NO) |
139 | { | 139 | { |
140 | res = 0; | 140 | res = 0; |
141 | s_first_record->expiration = GNUNET_TIME_absolute_get (); | 141 | s_first_record->expiration_time = GNUNET_TIME_absolute_get ().abs_value; |
142 | GNUNET_NAMESTORE_record_create (nsh, privkey, s_name, s_first_record, &create_updated_cont, s_name); | 142 | GNUNET_NAMESTORE_record_create (nsh, privkey, s_name, s_first_record, &create_updated_cont, s_name); |
143 | } | 143 | } |
144 | else | 144 | else |
@@ -173,21 +173,20 @@ create_first_cont (void *cls, int32_t success, const char *emsg) | |||
173 | 173 | ||
174 | 174 | ||
175 | static struct GNUNET_NAMESTORE_RecordData * | 175 | static struct GNUNET_NAMESTORE_RecordData * |
176 | create_record (int count) | 176 | create_record (unsigned int count) |
177 | { | 177 | { |
178 | int c; | 178 | unsigned int c; |
179 | struct GNUNET_NAMESTORE_RecordData * rd; | 179 | struct GNUNET_NAMESTORE_RecordData * rd; |
180 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
181 | 180 | ||
181 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
182 | for (c = 0; c < count; c++) | 182 | for (c = 0; c < count; c++) |
183 | { | 183 | { |
184 | rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS; | 184 | rd[c].expiration_time = 0; |
185 | rd[c].record_type = TEST_RECORD_TYPE; | 185 | rd[c].record_type = TEST_RECORD_TYPE; |
186 | rd[c].data_size = TEST_RECORD_DATALEN; | 186 | rd[c].data_size = TEST_RECORD_DATALEN; |
187 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 187 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
188 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 188 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
189 | } | 189 | } |
190 | |||
191 | return rd; | 190 | return rd; |
192 | } | 191 | } |
193 | 192 | ||
@@ -198,6 +197,7 @@ run (void *cls, | |||
198 | { | 197 | { |
199 | size_t rd_ser_len; | 198 | size_t rd_ser_len; |
200 | char *hostkey_file; | 199 | char *hostkey_file; |
200 | struct GNUNET_TIME_Absolute et; | ||
201 | 201 | ||
202 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 202 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
203 | 203 | ||
@@ -219,7 +219,8 @@ run (void *cls, | |||
219 | char rd_ser[rd_ser_len]; | 219 | char rd_ser[rd_ser_len]; |
220 | GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser); | 220 | GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser); |
221 | 221 | ||
222 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_first_record->expiration, s_name, s_first_record, 1); | 222 | et.abs_value = s_first_record->expiration_time; |
223 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1); | ||
223 | 224 | ||
224 | /* create random zone hash */ | 225 | /* create random zone hash */ |
225 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 226 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |
diff --git a/src/namestore/test_namestore_api_lookup.c b/src/namestore/test_namestore_api_lookup.c index 1cf9ec864..d74b1dcf7 100644 --- a/src/namestore/test_namestore_api_lookup.c +++ b/src/namestore/test_namestore_api_lookup.c | |||
@@ -176,21 +176,20 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
176 | 176 | ||
177 | 177 | ||
178 | static struct GNUNET_NAMESTORE_RecordData * | 178 | static struct GNUNET_NAMESTORE_RecordData * |
179 | create_record (int count) | 179 | create_record (unsigned int count) |
180 | { | 180 | { |
181 | int c; | 181 | unsigned int c; |
182 | struct GNUNET_NAMESTORE_RecordData * rd; | 182 | struct GNUNET_NAMESTORE_RecordData * rd; |
183 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
184 | 183 | ||
185 | for (c = 0; c < RECORDS; c++) | 184 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
185 | for (c = 0; c < count; c++) | ||
186 | { | 186 | { |
187 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 187 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
188 | rd[c].record_type = TEST_RECORD_TYPE; | 188 | rd[c].record_type = TEST_RECORD_TYPE; |
189 | rd[c].data_size = TEST_RECORD_DATALEN; | 189 | rd[c].data_size = TEST_RECORD_DATALEN; |
190 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 190 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
191 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 191 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
192 | } | 192 | } |
193 | |||
194 | return rd; | 193 | return rd; |
195 | } | 194 | } |
196 | 195 | ||
@@ -200,6 +199,7 @@ run (void *cls, | |||
200 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 199 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
201 | { | 200 | { |
202 | size_t rd_ser_len; | 201 | size_t rd_ser_len; |
202 | struct GNUNET_TIME_Absolute et; | ||
203 | 203 | ||
204 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 204 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
205 | 205 | ||
@@ -218,8 +218,9 @@ run (void *cls, | |||
218 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 218 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
219 | 219 | ||
220 | /* sign */ | 220 | /* sign */ |
221 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS); | 221 | et.abs_value = s_rd[0].expiration_time; |
222 | 222 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | |
223 | |||
223 | /* create random zone hash */ | 224 | /* create random zone hash */ |
224 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 225 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |
225 | nsh = GNUNET_NAMESTORE_connect (cfg); | 226 | nsh = GNUNET_NAMESTORE_connect (cfg); |
diff --git a/src/namestore/test_namestore_api_lookup_specific_type.c b/src/namestore/test_namestore_api_lookup_specific_type.c index e2ac2588d..f53b152cc 100644 --- a/src/namestore/test_namestore_api_lookup_specific_type.c +++ b/src/namestore/test_namestore_api_lookup_specific_type.c | |||
@@ -18,7 +18,7 @@ | |||
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file namestore/test_namestore_api.c | 21 | * @file namestore/test_namestore_api_lookup_sepecific_type.c |
22 | * @brief testcase for namestore_api.c | 22 | * @brief testcase for namestore_api.c |
23 | */ | 23 | */ |
24 | #include "platform.h" | 24 | #include "platform.h" |
@@ -246,21 +246,21 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
246 | 246 | ||
247 | 247 | ||
248 | static struct GNUNET_NAMESTORE_RecordData * | 248 | static struct GNUNET_NAMESTORE_RecordData * |
249 | create_record (int count) | 249 | create_record (unsigned int count) |
250 | { | 250 | { |
251 | int c; | 251 | unsigned int c; |
252 | struct GNUNET_NAMESTORE_RecordData * rd; | 252 | struct GNUNET_NAMESTORE_RecordData * rd; |
253 | 253 | ||
254 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 254 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
255 | for (c = 0; c < RECORDS-1; c++) | 255 | for (c = 0; c < count-1; c++) |
256 | { | 256 | { |
257 | rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS; | 257 | rd[c].expiration_time = 0; |
258 | rd[c].record_type = 1; | 258 | rd[c].record_type = 1; |
259 | rd[c].data_size = TEST_RECORD_DATALEN; | 259 | rd[c].data_size = TEST_RECORD_DATALEN; |
260 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 260 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
261 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 261 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
262 | } | 262 | } |
263 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 263 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
264 | rd[c].record_type = TEST_RECORD_LOOKUP_TYPE_EXISTING; | 264 | rd[c].record_type = TEST_RECORD_LOOKUP_TYPE_EXISTING; |
265 | rd[c].data_size = TEST_RECORD_DATALEN; | 265 | rd[c].data_size = TEST_RECORD_DATALEN; |
266 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 266 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -276,6 +276,7 @@ run (void *cls, | |||
276 | { | 276 | { |
277 | size_t rd_ser_len; | 277 | size_t rd_ser_len; |
278 | char *hostkey_file; | 278 | char *hostkey_file; |
279 | struct GNUNET_TIME_Absolute et; | ||
279 | 280 | ||
280 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 281 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
281 | /* load privat key */ | 282 | /* load privat key */ |
@@ -298,7 +299,8 @@ run (void *cls, | |||
298 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 299 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
299 | 300 | ||
300 | /* sign */ | 301 | /* sign */ |
301 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[RECORDS -1].expiration, s_name, s_rd, RECORDS); | 302 | et.abs_value = s_rd[RECORDS - 1].expiration_time; |
303 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | ||
302 | 304 | ||
303 | /* create random zone hash */ | 305 | /* create random zone hash */ |
304 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 306 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |
diff --git a/src/namestore/test_namestore_api_put.c b/src/namestore/test_namestore_api_put.c index 5ad5a87cd..58e85f35a 100644 --- a/src/namestore/test_namestore_api_put.c +++ b/src/namestore/test_namestore_api_put.c | |||
@@ -113,15 +113,15 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
113 | 113 | ||
114 | 114 | ||
115 | static struct GNUNET_NAMESTORE_RecordData * | 115 | static struct GNUNET_NAMESTORE_RecordData * |
116 | create_record (int count) | 116 | create_record (unsigned int count) |
117 | { | 117 | { |
118 | unsigned int c; | 118 | unsigned int c; |
119 | struct GNUNET_NAMESTORE_RecordData * rd; | 119 | struct GNUNET_NAMESTORE_RecordData * rd; |
120 | 120 | ||
121 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 121 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
122 | for (c = 0; c < RECORDS; c++) | 122 | for (c = 0; c < count; c++) |
123 | { | 123 | { |
124 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 124 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
125 | rd[c].record_type = TEST_RECORD_TYPE; | 125 | rd[c].record_type = TEST_RECORD_TYPE; |
126 | rd[c].data_size = TEST_RECORD_DATALEN; | 126 | rd[c].data_size = TEST_RECORD_DATALEN; |
127 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 127 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -139,6 +139,7 @@ run (void *cls, | |||
139 | const char * s_name = "dummy.dummy.gnunet"; | 139 | const char * s_name = "dummy.dummy.gnunet"; |
140 | int c; | 140 | int c; |
141 | char *hostkey_file; | 141 | char *hostkey_file; |
142 | struct GNUNET_TIME_Absolute et; | ||
142 | 143 | ||
143 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 144 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
144 | /* load privat key */ | 145 | /* load privat key */ |
@@ -154,7 +155,8 @@ run (void *cls, | |||
154 | GNUNET_break (NULL != nsh); | 155 | GNUNET_break (NULL != nsh); |
155 | /* create record */ | 156 | /* create record */ |
156 | s_rd = create_record (RECORDS); | 157 | s_rd = create_record (RECORDS); |
157 | signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS); | 158 | et.abs_value = s_rd[0].expiration_time; |
159 | signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | ||
158 | GNUNET_break (s_rd != NULL); | 160 | GNUNET_break (s_rd != NULL); |
159 | GNUNET_break (s_name != NULL); | 161 | GNUNET_break (s_name != NULL); |
160 | GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, | 162 | GNUNET_NAMESTORE_record_put (nsh, &pubkey, s_name, |
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c index 1d57e70f9..85ecb4a29 100644 --- a/src/namestore/test_namestore_api_remove.c +++ b/src/namestore/test_namestore_api_remove.c | |||
@@ -214,21 +214,20 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
214 | 214 | ||
215 | 215 | ||
216 | static struct GNUNET_NAMESTORE_RecordData * | 216 | static struct GNUNET_NAMESTORE_RecordData * |
217 | create_record (int count) | 217 | create_record (unsigned int count) |
218 | { | 218 | { |
219 | int c; | 219 | unsigned int c; |
220 | struct GNUNET_NAMESTORE_RecordData * rd; | 220 | struct GNUNET_NAMESTORE_RecordData * rd; |
221 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
222 | 221 | ||
223 | rd[0].expiration = GNUNET_TIME_absolute_get(); | 222 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
223 | rd[0].expiration_time = GNUNET_TIME_absolute_get().abs_value; | ||
224 | rd[0].record_type = 0; | 224 | rd[0].record_type = 0; |
225 | rd[0].data_size = TEST_REMOVE_RECORD_DATALEN; | 225 | rd[0].data_size = TEST_REMOVE_RECORD_DATALEN; |
226 | rd[0].data = GNUNET_malloc(TEST_REMOVE_RECORD_DATALEN); | 226 | rd[0].data = GNUNET_malloc(TEST_REMOVE_RECORD_DATALEN); |
227 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 227 | memset ((char *) rd[0].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
228 | 228 | for (c = 1; c < count; c++) | |
229 | for (c = 1; c < RECORDS; c++) | ||
230 | { | 229 | { |
231 | rd[c].expiration = GNUNET_TIME_UNIT_ZERO_ABS; | 230 | rd[c].expiration_time = 0; |
232 | rd[c].record_type = TEST_RECORD_TYPE; | 231 | rd[c].record_type = TEST_RECORD_TYPE; |
233 | rd[c].data_size = TEST_RECORD_DATALEN; | 232 | rd[c].data_size = TEST_RECORD_DATALEN; |
234 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 233 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -245,6 +244,7 @@ run (void *cls, | |||
245 | { | 244 | { |
246 | size_t rd_ser_len; | 245 | size_t rd_ser_len; |
247 | char *hostkey_file; | 246 | char *hostkey_file; |
247 | struct GNUNET_TIME_Absolute et; | ||
248 | 248 | ||
249 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 249 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
250 | /* load privat key */ | 250 | /* load privat key */ |
@@ -266,7 +266,8 @@ run (void *cls, | |||
266 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 266 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
267 | 267 | ||
268 | /* sign */ | 268 | /* sign */ |
269 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS); | 269 | et.abs_value = s_rd[0].expiration_time; |
270 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | ||
270 | 271 | ||
271 | /* create random zone hash */ | 272 | /* create random zone hash */ |
272 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 273 | GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c index 5dfe8e220..ab9095d91 100644 --- a/src/namestore/test_namestore_api_remove_not_existing_record.c +++ b/src/namestore/test_namestore_api_remove_not_existing_record.c | |||
@@ -137,7 +137,8 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
137 | 137 | ||
138 | struct GNUNET_NAMESTORE_RecordData rd; | 138 | struct GNUNET_NAMESTORE_RecordData rd; |
139 | char data[TEST_REMOVE_RECORD_DATALEN]; | 139 | char data[TEST_REMOVE_RECORD_DATALEN]; |
140 | rd.expiration = GNUNET_TIME_absolute_get(); | 140 | |
141 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; | ||
141 | rd.record_type = TEST_REMOVE_RECORD_TYPE; | 142 | rd.record_type = TEST_REMOVE_RECORD_TYPE; |
142 | rd.data_size = TEST_REMOVE_RECORD_DATALEN; | 143 | rd.data_size = TEST_REMOVE_RECORD_DATALEN; |
143 | rd.data = &data; | 144 | rd.data = &data; |
@@ -154,15 +155,15 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
154 | 155 | ||
155 | 156 | ||
156 | static struct GNUNET_NAMESTORE_RecordData * | 157 | static struct GNUNET_NAMESTORE_RecordData * |
157 | create_record (int count) | 158 | create_record (unsigned int count) |
158 | { | 159 | { |
159 | int c; | 160 | unsigned int c; |
160 | struct GNUNET_NAMESTORE_RecordData * rd; | 161 | struct GNUNET_NAMESTORE_RecordData * rd; |
161 | 162 | ||
162 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | 163 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
163 | for (c = 0; c < RECORDS; c++) | 164 | for (c = 0; c < count; c++) |
164 | { | 165 | { |
165 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 166 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
166 | rd[c].record_type = TEST_RECORD_TYPE; | 167 | rd[c].record_type = TEST_RECORD_TYPE; |
167 | rd[c].data_size = TEST_RECORD_DATALEN; | 168 | rd[c].data_size = TEST_RECORD_DATALEN; |
168 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 169 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
@@ -178,6 +179,7 @@ run (void *cls, | |||
178 | { | 179 | { |
179 | char *hostkey_file; | 180 | char *hostkey_file; |
180 | size_t rd_ser_len; | 181 | size_t rd_ser_len; |
182 | struct GNUNET_TIME_Absolute et; | ||
181 | 183 | ||
182 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 184 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
183 | 185 | ||
@@ -200,7 +202,8 @@ run (void *cls, | |||
200 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); | 202 | GNUNET_NAMESTORE_records_serialize(RECORDS, s_rd, rd_ser_len, rd_ser); |
201 | 203 | ||
202 | /* sign */ | 204 | /* sign */ |
203 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, s_rd[0].expiration, s_name, s_rd, RECORDS); | 205 | et.abs_value = s_rd[0].expiration_time; |
206 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_rd, RECORDS); | ||
204 | 207 | ||
205 | /* create random zone hash */ | 208 | /* create random zone hash */ |
206 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); | 209 | GNUNET_CRYPTO_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &s_zone); |
diff --git a/src/namestore/test_namestore_api_sign_verify.c b/src/namestore/test_namestore_api_sign_verify.c index 95d222c6d..fe7425ebf 100644 --- a/src/namestore/test_namestore_api_sign_verify.c +++ b/src/namestore/test_namestore_api_sign_verify.c | |||
@@ -56,19 +56,18 @@ static int res; | |||
56 | static struct GNUNET_NAMESTORE_RecordData * | 56 | static struct GNUNET_NAMESTORE_RecordData * |
57 | create_record (int count) | 57 | create_record (int count) |
58 | { | 58 | { |
59 | int c; | 59 | unsigned int c; |
60 | struct GNUNET_NAMESTORE_RecordData * rd; | 60 | struct GNUNET_NAMESTORE_RecordData * rd; |
61 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
62 | 61 | ||
63 | for (c = 0; c < RECORDS; c++) | 62 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); |
63 | for (c = 0; c < count; c++) | ||
64 | { | 64 | { |
65 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 65 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
66 | rd[c].record_type = TEST_RECORD_TYPE; | 66 | rd[c].record_type = TEST_RECORD_TYPE; |
67 | rd[c].data_size = TEST_RECORD_DATALEN; | 67 | rd[c].data_size = TEST_RECORD_DATALEN; |
68 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); | 68 | rd[c].data = GNUNET_malloc(TEST_RECORD_DATALEN); |
69 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); | 69 | memset ((char *) rd[c].data, TEST_RECORD_DATA, TEST_RECORD_DATALEN); |
70 | } | 70 | } |
71 | |||
72 | return rd; | 71 | return rd; |
73 | } | 72 | } |
74 | 73 | ||
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index 9a2c2d0ab..4e4ff88bc 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c | |||
@@ -345,15 +345,15 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
345 | 345 | ||
346 | 346 | ||
347 | static struct GNUNET_NAMESTORE_RecordData * | 347 | static struct GNUNET_NAMESTORE_RecordData * |
348 | create_record (int count) | 348 | create_record (unsigned int count) |
349 | { | 349 | { |
350 | int c; | 350 | unsigned int c; |
351 | struct GNUNET_NAMESTORE_RecordData * rd; | 351 | struct GNUNET_NAMESTORE_RecordData * rd; |
352 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
353 | 352 | ||
353 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
354 | for (c = 0; c < count; c++) | 354 | for (c = 0; c < count; c++) |
355 | { | 355 | { |
356 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 356 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
357 | rd[c].record_type = 1111; | 357 | rd[c].record_type = 1111; |
358 | rd[c].data_size = 50; | 358 | rd[c].data_size = 50; |
359 | rd[c].data = GNUNET_malloc(50); | 359 | rd[c].data = GNUNET_malloc(50); |
@@ -368,6 +368,7 @@ run (void *cls, | |||
368 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 368 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
369 | { | 369 | { |
370 | char *hostkey_file; | 370 | char *hostkey_file; |
371 | struct GNUNET_TIME_Absolute et; | ||
371 | 372 | ||
372 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); | 373 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); |
373 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 374 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
@@ -396,7 +397,8 @@ run (void *cls, | |||
396 | 397 | ||
397 | GNUNET_asprintf(&s_name_1, "dummy1"); | 398 | GNUNET_asprintf(&s_name_1, "dummy1"); |
398 | s_rd_1 = create_record(1); | 399 | s_rd_1 = create_record(1); |
399 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1->expiration, s_name_1, s_rd_1, 1); | 400 | et.abs_value = s_rd_1->expiration_time; |
401 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | ||
400 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); | 402 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); |
401 | 403 | ||
402 | 404 | ||
@@ -404,14 +406,16 @@ run (void *cls, | |||
404 | GNUNET_asprintf(&s_name_2, "dummy2"); | 406 | GNUNET_asprintf(&s_name_2, "dummy2"); |
405 | s_rd_2 = create_record(1); | 407 | s_rd_2 = create_record(1); |
406 | 408 | ||
407 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2->expiration, s_name_2, s_rd_2, 1); | 409 | et.abs_value = s_rd_2->expiration_time; |
410 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | ||
408 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); | 411 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); |
409 | 412 | ||
410 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); | 413 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); |
411 | /* name in different zone */ | 414 | /* name in different zone */ |
412 | GNUNET_asprintf(&s_name_3, "dummy3"); | 415 | GNUNET_asprintf(&s_name_3, "dummy3"); |
413 | s_rd_3 = create_record(1); | 416 | s_rd_3 = create_record(1); |
414 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3->expiration, s_name_3, s_rd_3, 1); | 417 | et.abs_value = s_rd_3->expiration_time; |
418 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); | ||
415 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); | 419 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); |
416 | } | 420 | } |
417 | 421 | ||
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c index b76acb4dd..4a6bc571a 100644 --- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c +++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c | |||
@@ -304,15 +304,15 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
304 | 304 | ||
305 | 305 | ||
306 | static struct GNUNET_NAMESTORE_RecordData * | 306 | static struct GNUNET_NAMESTORE_RecordData * |
307 | create_record (int count) | 307 | create_record (unsigned int count) |
308 | { | 308 | { |
309 | int c; | 309 | unsigned int c; |
310 | struct GNUNET_NAMESTORE_RecordData * rd; | 310 | struct GNUNET_NAMESTORE_RecordData * rd; |
311 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
312 | 311 | ||
312 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
313 | for (c = 0; c < count; c++) | 313 | for (c = 0; c < count; c++) |
314 | { | 314 | { |
315 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 315 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
316 | rd[c].record_type = 1111; | 316 | rd[c].record_type = 1111; |
317 | rd[c].data_size = 50; | 317 | rd[c].data_size = 50; |
318 | rd[c].data = GNUNET_malloc(50); | 318 | rd[c].data = GNUNET_malloc(50); |
@@ -327,6 +327,7 @@ run (void *cls, | |||
327 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 327 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
328 | { | 328 | { |
329 | char *hostkey_file; | 329 | char *hostkey_file; |
330 | struct GNUNET_TIME_Absolute et; | ||
330 | 331 | ||
331 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); | 332 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); |
332 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 333 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
@@ -352,20 +353,23 @@ run (void *cls, | |||
352 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); | 353 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 1\n"); |
353 | GNUNET_asprintf(&s_name_1, "dummy1"); | 354 | GNUNET_asprintf(&s_name_1, "dummy1"); |
354 | s_rd_1 = create_record(1); | 355 | s_rd_1 = create_record(1); |
355 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1[0].expiration ,s_name_1, s_rd_1, 1); | 356 | et.abs_value = s_rd_1[0].expiration_time; |
357 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | ||
356 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); | 358 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); |
357 | 359 | ||
358 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 2 \n"); | 360 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 2 \n"); |
359 | GNUNET_asprintf(&s_name_2, "dummy2"); | 361 | GNUNET_asprintf(&s_name_2, "dummy2"); |
360 | s_rd_2 = create_record(1); | 362 | s_rd_2 = create_record(1); |
361 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2[0].expiration, s_name_2, s_rd_2, 1); | 363 | et.abs_value = s_rd_2[0].expiration_time; |
364 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | ||
362 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); | 365 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); |
363 | 366 | ||
364 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); | 367 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); |
365 | /* name in different zone */ | 368 | /* name in different zone */ |
366 | GNUNET_asprintf(&s_name_3, "dummy3"); | 369 | GNUNET_asprintf(&s_name_3, "dummy3"); |
367 | s_rd_3 = create_record(1); | 370 | s_rd_3 = create_record(1); |
368 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_3[0].expiration, s_name_3, s_rd_3, 1); | 371 | et.abs_value = s_rd_3[0].expiration_time; |
372 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_3, s_rd_3, 1); | ||
369 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); | 373 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); |
370 | } | 374 | } |
371 | 375 | ||
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index 71ae43362..d68441398 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c | |||
@@ -353,15 +353,15 @@ put_cont (void *cls, int32_t success, const char *emsg) | |||
353 | 353 | ||
354 | 354 | ||
355 | static struct GNUNET_NAMESTORE_RecordData * | 355 | static struct GNUNET_NAMESTORE_RecordData * |
356 | create_record (int count) | 356 | create_record (unsigned int count) |
357 | { | 357 | { |
358 | int c; | 358 | unsigned int c; |
359 | struct GNUNET_NAMESTORE_RecordData * rd; | 359 | struct GNUNET_NAMESTORE_RecordData * rd; |
360 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
361 | 360 | ||
361 | rd = GNUNET_malloc (count * sizeof (struct GNUNET_NAMESTORE_RecordData)); | ||
362 | for (c = 0; c < count; c++) | 362 | for (c = 0; c < count; c++) |
363 | { | 363 | { |
364 | rd[c].expiration = GNUNET_TIME_absolute_get(); | 364 | rd[c].expiration_time = GNUNET_TIME_absolute_get().abs_value; |
365 | rd[c].record_type = 1111; | 365 | rd[c].record_type = 1111; |
366 | rd[c].data_size = 50; | 366 | rd[c].data_size = 50; |
367 | rd[c].data = GNUNET_malloc(50); | 367 | rd[c].data = GNUNET_malloc(50); |
@@ -376,6 +376,7 @@ run (void *cls, | |||
376 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 376 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
377 | { | 377 | { |
378 | char *hostkey_file; | 378 | char *hostkey_file; |
379 | struct GNUNET_TIME_Absolute et; | ||
379 | 380 | ||
380 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); | 381 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,&endbadly, NULL); |
381 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, | 382 | GNUNET_asprintf(&hostkey_file,"zonefiles%s%s",DIR_SEPARATOR_STR, |
@@ -403,7 +404,8 @@ run (void *cls, | |||
403 | 404 | ||
404 | GNUNET_asprintf(&s_name_1, "dummy1"); | 405 | GNUNET_asprintf(&s_name_1, "dummy1"); |
405 | s_rd_1 = create_record(1); | 406 | s_rd_1 = create_record(1); |
406 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_1[0].expiration, s_name_1, s_rd_1, 1); | 407 | et.abs_value = s_rd_1[0].expiration_time; |
408 | sig_1 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_1, s_rd_1, 1); | ||
407 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); | 409 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_1, s_rd_1, &put_cont, NULL); |
408 | 410 | ||
409 | 411 | ||
@@ -411,14 +413,16 @@ run (void *cls, | |||
411 | GNUNET_asprintf(&s_name_2, "dummy2"); | 413 | GNUNET_asprintf(&s_name_2, "dummy2"); |
412 | s_rd_2 = create_record(1); | 414 | s_rd_2 = create_record(1); |
413 | 415 | ||
414 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, s_rd_2[0].expiration, s_name_2, s_rd_2, 1); | 416 | et.abs_value = s_rd_2[0].expiration_time; |
417 | sig_2 = GNUNET_NAMESTORE_create_signature(privkey, et, s_name_2, s_rd_2, 1); | ||
415 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); | 418 | GNUNET_NAMESTORE_record_create(nsh, privkey, s_name_2, s_rd_2, &put_cont, NULL); |
416 | 419 | ||
417 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); | 420 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created record 3\n"); |
418 | /* name in different zone */ | 421 | /* name in different zone */ |
419 | GNUNET_asprintf(&s_name_3, "dummy3"); | 422 | GNUNET_asprintf(&s_name_3, "dummy3"); |
420 | s_rd_3 = create_record(1); | 423 | s_rd_3 = create_record(1); |
421 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, s_rd_3[0].expiration, s_name_3, s_rd_3, 1); | 424 | et.abs_value = s_rd_3[0].expiration_time; |
425 | sig_3 = GNUNET_NAMESTORE_create_signature(privkey2, et, s_name_3, s_rd_3, 1); | ||
422 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); | 426 | GNUNET_NAMESTORE_record_put (nsh, &pubkey2, s_name_3, GNUNET_TIME_UNIT_FOREVER_ABS, 1, s_rd_3, sig_3, &put_cont, NULL); |
423 | } | 427 | } |
424 | 428 | ||
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c index e5db28165..cd722ab8a 100644 --- a/src/namestore/test_namestore_api_zone_to_name.c +++ b/src/namestore/test_namestore_api_zone_to_name.c | |||
@@ -165,6 +165,8 @@ static void | |||
165 | run (void *cls, | 165 | run (void *cls, |
166 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 166 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
167 | { | 167 | { |
168 | struct GNUNET_TIME_Absolute et; | ||
169 | |||
168 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); | 170 | endbadly_task = GNUNET_SCHEDULER_add_delayed(TIMEOUT,endbadly, NULL); |
169 | GNUNET_asprintf(&s_name, "dummy"); | 171 | GNUNET_asprintf(&s_name, "dummy"); |
170 | /* load privat key */ | 172 | /* load privat key */ |
@@ -184,7 +186,7 @@ run (void *cls, | |||
184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_short_h2s (&s_zone_value)); | 186 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Using PKEY `%s' \n", GNUNET_short_h2s (&s_zone_value)); |
185 | 187 | ||
186 | struct GNUNET_NAMESTORE_RecordData rd; | 188 | struct GNUNET_NAMESTORE_RecordData rd; |
187 | rd.expiration = GNUNET_TIME_absolute_get(); | 189 | rd.expiration_time = GNUNET_TIME_absolute_get().abs_value; |
188 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; | 190 | rd.record_type = GNUNET_NAMESTORE_TYPE_PKEY; |
189 | rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode); | 191 | rd.data_size = sizeof (struct GNUNET_CRYPTO_ShortHashCode); |
190 | rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode)); | 192 | rd.data = GNUNET_malloc(sizeof (struct GNUNET_CRYPTO_ShortHashCode)); |
@@ -193,7 +195,8 @@ run (void *cls, | |||
193 | GNUNET_break (NULL != nsh); | 195 | GNUNET_break (NULL != nsh); |
194 | 196 | ||
195 | expire = GNUNET_TIME_absolute_get (); | 197 | expire = GNUNET_TIME_absolute_get (); |
196 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, rd.expiration, s_name, &rd, 1); | 198 | et.abs_value = rd.expiration_time; |
199 | s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, &rd, 1); | ||
197 | GNUNET_NAMESTORE_record_put(nsh, &pubkey, s_name, expire, 1, &rd, s_signature, put_cont, NULL); | 200 | GNUNET_NAMESTORE_record_put(nsh, &pubkey, s_name, expire, 1, &rd, s_signature, put_cont, NULL); |
198 | 201 | ||
199 | GNUNET_free ((void *) rd.data); | 202 | GNUNET_free ((void *) rd.data); |
diff --git a/src/namestore/test_namestore_record_serialization.c b/src/namestore/test_namestore_record_serialization.c index 48560aee9..362af0dd0 100644 --- a/src/namestore/test_namestore_record_serialization.c +++ b/src/namestore/test_namestore_record_serialization.c | |||
@@ -79,7 +79,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
79 | GNUNET_break (0); | 79 | GNUNET_break (0); |
80 | res = 1; | 80 | res = 1; |
81 | } | 81 | } |
82 | if (0 != GNUNET_TIME_absolute_get_difference(src[c].expiration, dst[c].expiration).rel_value) | 82 | if (src[c].expiration_time != dst[c].expiration_time) |
83 | { | 83 | { |
84 | GNUNET_break (0); | 84 | GNUNET_break (0); |
85 | res = 1; | 85 | res = 1; |
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c index d678eb8ce..0ff98b43b 100644 --- a/src/namestore/test_plugin_namestore.c +++ b/src/namestore/test_plugin_namestore.c | |||
@@ -154,7 +154,7 @@ put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | |||
154 | { | 154 | { |
155 | rd[i].data = "Hello World"; | 155 | rd[i].data = "Hello World"; |
156 | rd[i].data_size = id % 10; | 156 | rd[i].data_size = id % 10; |
157 | rd[i].expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); | 157 | rd[i].expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES).abs_value; |
158 | rd[i].record_type = 1 + (id % 13); | 158 | rd[i].record_type = 1 + (id % 13); |
159 | rd[i].flags = (id % 7); | 159 | rd[i].flags = (id % 7); |
160 | } | 160 | } |