gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27692 - gnunet/src/namestore


From: gnunet
Subject: [GNUnet-SVN] r27692 - gnunet/src/namestore
Date: Sun, 30 Jun 2013 21:40:14 +0200

Author: grothoff
Date: 2013-06-30 21:40:14 +0200 (Sun, 30 Jun 2013)
New Revision: 27692

Removed:
   gnunet/src/namestore/test_hostkey
Modified:
   gnunet/src/namestore/test_namestore_api_create.c
   gnunet/src/namestore/test_namestore_api_lookup.c
   gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
   gnunet/src/namestore/test_namestore_api_zone_iteration.c
   gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
Log:
-fixing some namestore tests

Deleted: gnunet/src/namestore/test_hostkey
===================================================================
(Binary files differ)

Modified: gnunet/src/namestore/test_namestore_api_create.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_create.c    2013-06-30 19:21:05 UTC 
(rev 27691)
+++ gnunet/src/namestore/test_namestore_api_create.c    2013-06-30 19:40:14 UTC 
(rev 27692)
@@ -54,10 +54,6 @@
 
 static struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded pubkey;
 
-static struct GNUNET_CRYPTO_EccSignature *s_signature;
-
-static struct GNUNET_CRYPTO_EccSignature *s_signature_updated;
-
 static struct GNUNET_CRYPTO_ShortHashCode s_zone;
 
 static struct GNUNET_NAMESTORE_RecordData *s_first_record;
@@ -166,18 +162,6 @@
       failed = GNUNET_YES;
     }
 
-    struct GNUNET_NAMESTORE_RecordData rd_new[2];
-    rd_new[0] = *s_first_record;
-    rd_new[1] = *s_second_record;
-    rd_new[1].flags = 0; /* unset GNUNET_NAMESTORE_RF_AUTHORITY */
-    s_signature_updated = GNUNET_NAMESTORE_create_signature (privkey, expire, 
s_name, rd_new, 2);
-
-    if (0 != memcmp (s_signature_updated, signature, sizeof (struct 
GNUNET_CRYPTO_EccSignature)))
-    {
-      GNUNET_break (0);
-      failed = GNUNET_YES;
-    }
-
     found = GNUNET_YES;
     if (failed == GNUNET_NO)
       res = 0;
@@ -226,6 +210,7 @@
                          const struct GNUNET_NAMESTORE_RecordData *rd,
                          const struct GNUNET_CRYPTO_EccSignature *signature)
 {
+  struct GNUNET_NAMESTORE_RecordData both_records[2];
   char * name = cls;
   static int found = GNUNET_NO;
   int failed = GNUNET_NO;
@@ -267,12 +252,6 @@
       failed = GNUNET_YES;
     }
 
-    if (0 != memcmp (s_signature, signature, sizeof (struct 
GNUNET_CRYPTO_EccSignature)))
-    {
-      GNUNET_break (0);
-      failed = GNUNET_YES;
-    }
-
     found = GNUNET_YES;
     if (failed == GNUNET_NO)
       res = 0;
@@ -288,8 +267,10 @@
     s_second_record->data_size = TEST_CREATE_RECORD_DATALEN;
     memset ((char *) s_second_record->data, TEST_CREATE_RECORD_DATA, 
TEST_CREATE_RECORD_DATALEN);
 
+    both_records[0] = *s_first_record;
+    both_records[1] = *s_second_record;
     GNUNET_NAMESTORE_record_put_by_authority (nsh, privkey, name, 
-                                             1, s_second_record,
+                                             2, both_records,
                                              &create_second_cont, name);
 
   }
@@ -352,7 +333,6 @@
 {
   size_t rd_ser_len;
   char *hostkey_file;
-  struct GNUNET_TIME_Absolute et;
 
   endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,endbadly, NULL);
   /* load privat key */
@@ -371,8 +351,6 @@
   rd_ser_len = GNUNET_NAMESTORE_records_get_size(1, s_first_record);
   char rd_ser[rd_ser_len];
   GNUNET_NAMESTORE_records_serialize(1, s_first_record, rd_ser_len, rd_ser);
-  et.abs_value = s_first_record->expiration_time;
-  s_signature = GNUNET_NAMESTORE_create_signature(privkey, et, s_name, 
s_first_record, 1);
 
   /* create random zone hash */
   GNUNET_CRYPTO_short_hash (&pubkey, sizeof (struct 
GNUNET_CRYPTO_EccPublicKeyBinaryEncoded), &s_zone);
@@ -402,7 +380,6 @@
                                  &run,
                                  NULL))
     return 1;
-  GNUNET_free (s_signature);
   return res;
 }
 

Modified: gnunet/src/namestore/test_namestore_api_lookup.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_lookup.c    2013-06-30 19:21:05 UTC 
(rev 27691)
+++ gnunet/src/namestore/test_namestore_api_lookup.c    2013-06-30 19:40:14 UTC 
(rev 27692)
@@ -222,7 +222,7 @@
                                                &endbadly, NULL);
 
   /* load privat key from file not included in zonekey dir */
-  privkey = GNUNET_CRYPTO_ecc_key_create_from_file("test_hostkey");
+  privkey = GNUNET_CRYPTO_ecc_key_create_from_file ("test_hostkey");
   GNUNET_assert (NULL != privkey);
   /* get public key */
   GNUNET_CRYPTO_ecc_key_get_public(privkey, &pubkey);

Modified: gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c        
2013-06-30 19:21:05 UTC (rev 27691)
+++ gnunet/src/namestore/test_namestore_api_remove_not_existing_record.c        
2013-06-30 19:40:14 UTC (rev 27692)
@@ -114,7 +114,7 @@
   char *name = cls;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Remove record for `%s': %s `%s'\n", 
name, (success == GNUNET_YES) ? "SUCCESS" : "FAIL", emsg);
-  if (GNUNET_NO == success)
+  if (GNUNET_OK == success)
   {
     res = 0;
   }

Modified: gnunet/src/namestore/test_namestore_api_zone_iteration.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration.c    2013-06-30 
19:21:05 UTC (rev 27691)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration.c    2013-06-30 
19:40:14 UTC (rev 27692)
@@ -274,12 +274,6 @@
         failed = GNUNET_YES;
         GNUNET_break (0);
       }
-
-      if (0 != memcmp (signature, sig_3, sizeof (struct 
GNUNET_CRYPTO_EccSignature)))
-      {
-        failed = GNUNET_YES;
-        GNUNET_break (0);
-      }
     }
     else
     {

Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c      
2013-06-30 19:21:05 UTC (rev 27691)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_specific_zone.c      
2013-06-30 19:40:14 UTC (rev 27692)
@@ -233,11 +233,6 @@
         failed = GNUNET_YES;
         GNUNET_break (0);
       }
-      if (0 != memcmp (signature, sig_2, sizeof (struct 
GNUNET_CRYPTO_EccSignature)))
-      {
-        failed = GNUNET_YES;
-        GNUNET_break (0);
-      }
     }
     else
     {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]