aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/namestore/test_hostkeybin914 -> 0 bytes
-rw-r--r--src/namestore/test_namestore_api_create.c31
-rw-r--r--src/namestore/test_namestore_api_lookup.c2
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c2
-rw-r--r--src/namestore/test_namestore_api_zone_iteration.c6
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_specific_zone.c5
6 files changed, 6 insertions, 40 deletions
diff --git a/src/namestore/test_hostkey b/src/namestore/test_hostkey
deleted file mode 100644
index 2ffb55fad..000000000
--- a/src/namestore/test_hostkey
+++ /dev/null
Binary files differ
diff --git a/src/namestore/test_namestore_api_create.c b/src/namestore/test_namestore_api_create.c
index 0510a6c4b..aba18c192 100644
--- a/src/namestore/test_namestore_api_create.c
+++ b/src/namestore/test_namestore_api_create.c
@@ -54,10 +54,6 @@ static struct GNUNET_CRYPTO_EccPrivateKey * privkey;
54 54
55static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey; 55static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey;
56 56
57static struct GNUNET_CRYPTO_EccSignature *s_signature;
58
59static struct GNUNET_CRYPTO_EccSignature *s_signature_updated;
60
61static struct GNUNET_CRYPTO_ShortHashCode s_zone; 57static struct GNUNET_CRYPTO_ShortHashCode s_zone;
62 58
63static struct GNUNET_NAMESTORE_RecordData *s_first_record; 59static struct GNUNET_NAMESTORE_RecordData *s_first_record;
@@ -166,18 +162,6 @@ name_lookup_second_proc (void *cls,
166 failed = GNUNET_YES; 162 failed = GNUNET_YES;
167 } 163 }
168 164
169 struct GNUNET_NAMESTORE_RecordData rd_new[2];
170 rd_new[0] = *s_first_record;
171 rd_new[1] = *s_second_record;
172 rd_new[1].flags = 0; /* unset GNUNET_NAMESTORE_RF_AUTHORITY */
173 s_signature_updated = GNUNET_NAMESTORE_create_signature (privkey, expire, s_name, rd_new, 2);
174
175 if (0 != memcmp (s_signature_updated, signature, sizeof (struct GNUNET_CRYPTO_EccSignature)))
176 {
177 GNUNET_break (0);
178 failed = GNUNET_YES;
179 }
180
181 found = GNUNET_YES; 165 found = GNUNET_YES;
182 if (failed == GNUNET_NO) 166 if (failed == GNUNET_NO)
183 res = 0; 167 res = 0;
@@ -226,6 +210,7 @@ name_lookup_initial_proc (void *cls,
226 const struct GNUNET_NAMESTORE_RecordData *rd, 210 const struct GNUNET_NAMESTORE_RecordData *rd,
227 const struct GNUNET_CRYPTO_EccSignature *signature) 211 const struct GNUNET_CRYPTO_EccSignature *signature)
228{ 212{
213 struct GNUNET_NAMESTORE_RecordData both_records[2];
229 char * name = cls; 214 char * name = cls;
230 static int found = GNUNET_NO; 215 static int found = GNUNET_NO;
231 int failed = GNUNET_NO; 216 int failed = GNUNET_NO;
@@ -267,12 +252,6 @@ name_lookup_initial_proc (void *cls,
267 failed = GNUNET_YES; 252 failed = GNUNET_YES;
268 } 253 }
269 254
270 if (0 != memcmp (s_signature, signature, sizeof (struct GNUNET_CRYPTO_EccSignature)))
271 {
272 GNUNET_break (0);
273 failed = GNUNET_YES;
274 }
275
276 found = GNUNET_YES; 255 found = GNUNET_YES;
277 if (failed == GNUNET_NO) 256 if (failed == GNUNET_NO)
278 res = 0; 257 res = 0;
@@ -288,8 +267,10 @@ name_lookup_initial_proc (void *cls,
288 s_second_record->data_size = TEST_CREATE_RECORD_DATALEN; 267 s_second_record->data_size = TEST_CREATE_RECORD_DATALEN;
289 memset ((char *) s_second_record->data, TEST_CREATE_RECORD_DATA, TEST_CREATE_RECORD_DATALEN); 268 memset ((char *) s_second_record->data, TEST_CREATE_RECORD_DATA, TEST_CREATE_RECORD_DATALEN);
290 269
270 both_records[0] = *s_first_record;
271 both_records[1] = *s_second_record;
291 GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, name, 272 GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, name,
292 1, s_second_record, 273 2, both_records,
293 &create_second_cont, name); 274 &create_second_cont, name);
294 275
295 } 276 }
@@ -352,7 +333,6 @@ run (void *cls,
352{ 333{
353 size_t rd_ser_len; 334 size_t rd_ser_len;
354 char *hostkey_file; 335 char *hostkey_file;
355 struct GNUNET_TIME_Absolute et;
356 336
357 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,endbadly, NULL); 337 endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,endbadly, NULL);
358 /* load privat key */ 338 /* load privat key */
@@ -371,8 +351,6 @@ run (void *cls,
371 rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, s_first_record); 351 rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, s_first_record);
372 char rd_ser[rd_ser_len]; 352 char rd_ser[rd_ser_len];
373 GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser); 353 GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser);
374 et.abs_value = s_first_record->expiration_time;
375 s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, s_first_record, 1);
376 354
377 /* create random zone hash */ 355 /* create random zone hash */
378 GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone); 356 GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone);
@@ -402,7 +380,6 @@ main (int argc, char *argv[])
402 &run, 380 &run,
403 NULL)) 381 NULL))
404 return 1; 382 return 1;
405 GNUNET_free (s_signature);
406 return res; 383 return res;
407} 384}
408 385
diff --git a/src/namestore/test_namestore_api_lookup.c b/src/namestore/test_namestore_api_lookup.c
index fdd229b23..7673e0fa7 100644
--- a/src/namestore/test_namestore_api_lookup.c
+++ b/src/namestore/test_namestore_api_lookup.c
@@ -222,7 +222,7 @@ run (void *cls,
222 &endbadly, NULL); 222 &endbadly, NULL);
223 223
224 /* load privat key from file not included in zonekey dir */ 224 /* load privat key from file not included in zonekey dir */
225 privkey = GNUNET_CRYPTO_ecc_key_create_from_file("test_hostkey"); 225 privkey = GNUNET_CRYPTO_ecc_key_create_from_file ("test_hostkey");
226 GNUNET_assert (NULL != privkey); 226 GNUNET_assert (NULL != privkey);
227 /* get public key */ 227 /* get public key */
228 GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey); 228 GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey);
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 c31ea8d0b..4e207257e 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -114,7 +114,7 @@ remove_cont (void *cls, int32_t success, const char *emsg)
114 char *name = cls; 114 char *name = cls;
115 115
116 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Remove record for `%s': %s `%s'\n", name, (success == GNUNET_YES) ? "SUCCESS" : "FAIL", emsg); 116 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Remove record for `%s': %s `%s'\n", name, (success == GNUNET_YES) ? "SUCCESS" : "FAIL", emsg);
117 if (GNUNET_NO == success) 117 if (GNUNET_OK == success)
118 { 118 {
119 res = 0; 119 res = 0;
120 } 120 }
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c
index 71afc359c..01e73a4a9 100644
--- a/src/namestore/test_namestore_api_zone_iteration.c
+++ b/src/namestore/test_namestore_api_zone_iteration.c
@@ -274,12 +274,6 @@ zone_proc (void *cls,
274 failed = GNUNET_YES; 274 failed = GNUNET_YES;
275 GNUNET_break (0); 275 GNUNET_break (0);
276 } 276 }
277
278 if (0 != memcmp (signature, sig_3, sizeof (struct GNUNET_CRYPTO_EccSignature)))
279 {
280 failed = GNUNET_YES;
281 GNUNET_break (0);
282 }
283 } 277 }
284 else 278 else
285 { 279 {
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 86871120c..c6ba99230 100644
--- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -233,11 +233,6 @@ zone_proc (void *cls,
233 failed = GNUNET_YES; 233 failed = GNUNET_YES;
234 GNUNET_break (0); 234 GNUNET_break (0);
235 } 235 }
236 if (0 != memcmp (signature, sig_2, sizeof (struct GNUNET_CRYPTO_EccSignature)))
237 {
238 failed = GNUNET_YES;
239 GNUNET_break (0);
240 }
241 } 236 }
242 else 237 else
243 { 238 {