gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: GNS: TVs shorter expiration. Prettify re


From: gnunet
Subject: [gnunet] branch master updated: GNS: TVs shorter expiration. Prettify revocation TV output.
Date: Thu, 29 Jun 2023 20:37:59 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 8c34d91ad GNS: TVs shorter expiration. Prettify revocation TV output.
8c34d91ad is described below

commit 8c34d91adf6884b1282d57760b3c22d55e807458
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Thu Jun 29 20:37:34 2023 +0200

    GNS: TVs shorter expiration. Prettify revocation TV output.
---
 src/gnsrecord/gnunet-gnsrecord-tvg.c   |  8 ++++----
 src/revocation/gnunet-revocation-tvg.c | 34 +++++++++++++++++++++-------------
 2 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/src/gnsrecord/gnunet-gnsrecord-tvg.c 
b/src/gnsrecord/gnunet-gnsrecord-tvg.c
index 549c95e53..a4cf3f5cf 100644
--- a/src/gnsrecord/gnunet-gnsrecord-tvg.c
+++ b/src/gnsrecord/gnunet-gnsrecord-tvg.c
@@ -406,11 +406,11 @@ run (void *cls,
   /*
    * Make different expiration times
    */
-  GNUNET_STRINGS_fancy_time_to_absolute ("2048-01-23 10:51:34",
+  GNUNET_STRINGS_fancy_time_to_absolute ("2228-01-23 10:51:34",
                                          &exp1);
-  GNUNET_STRINGS_fancy_time_to_absolute ("3540-05-22 07:55:01",
+  GNUNET_STRINGS_fancy_time_to_absolute ("2540-05-22 07:55:01",
                                          &exp2);
-  GNUNET_STRINGS_fancy_time_to_absolute ("3333-04-21 06:07:09",
+  GNUNET_STRINGS_fancy_time_to_absolute ("2333-04-21 06:07:09",
                                          &exp3);
 
 
@@ -441,7 +441,7 @@ run (void *cls,
   rd[1].data_size = strlen (rd[1].data);
   rd[1].expiration_time = exp2.abs_value_us;
   rd[1].record_type = GNUNET_GNSRECORD_TYPE_NICK;
-  rd[1].flags = GNUNET_GNSRECORD_RF_PRIVATE;
+  rd[1].flags = GNUNET_GNSRECORD_RF_NONE;
 
   rd[2].data = "Hello World";
   rd[2].data_size = strlen (rd[2].data);
diff --git a/src/revocation/gnunet-revocation-tvg.c 
b/src/revocation/gnunet-revocation-tvg.c
index e1c9aa044..4dcf6e28f 100644
--- a/src/revocation/gnunet-revocation-tvg.c
+++ b/src/revocation/gnunet-revocation-tvg.c
@@ -34,10 +34,11 @@
 #define TEST_EPOCHS 2
 #define TEST_DIFFICULTY 5
 
-static char* d_pkey =
-"6fea32c05af58bfa979553d188605fd57d8bf9cc263b78d5f7478c07b998ed70";
+static char*d_pkey =
+  "6fea32c05af58bfa979553d188605fd57d8bf9cc263b78d5f7478c07b998ed70";
 
-int parsehex(char *src, char *dst, size_t dstlen, int invert)
+int
+parsehex (char *src, char *dst, size_t dstlen, int invert)
 {
   char *line = src;
   char *data = line;
@@ -45,7 +46,8 @@ int parsehex(char *src, char *dst, size_t dstlen, int invert)
   int read_byte;
   int data_len = 0;
 
-  while (sscanf(data, " %02x%n", &read_byte, &off) == 1) {
+  while (sscanf (data, " %02x%n", &read_byte, &off) == 1)
+  {
     if (invert)
       dst[dstlen - 1 - data_len++] = read_byte;
     else
@@ -58,16 +60,21 @@ int parsehex(char *src, char *dst, size_t dstlen, int 
invert)
 
 static void
 print_bytes_ (void *buf,
-             size_t buf_len,
-             int fold,
-             int in_be)
+              size_t buf_len,
+              int fold,
+              int in_be)
 {
   int i;
 
   for (i = 0; i < buf_len; i++)
   {
-    if ((0 != i) && (0 != fold) && (i % fold == 0))
-      printf ("\n");
+    if (0 != i)
+    {
+      if ((0 != fold) && (i % fold == 0))
+        printf ("\n");
+      else
+        printf (" ");
+    }
     if (in_be)
       printf ("%02x", ((unsigned char*) buf)[buf_len - 1 - i]);
     else
@@ -76,6 +83,7 @@ print_bytes_ (void *buf,
   printf ("\n");
 }
 
+
 static void
 print_bytes (void *buf,
              size_t buf_len,
@@ -85,7 +93,6 @@ print_bytes (void *buf,
 }
 
 
-
 /**
  * Main function that will be run.
  *
@@ -110,15 +117,16 @@ run (void *cls,
 
   id_priv.type = htonl (GNUNET_IDENTITY_TYPE_ECDSA);
   GNUNET_CRYPTO_ecdsa_key_create (&id_priv.ecdsa_key);
-  parsehex(d_pkey,(char*)&id_priv.ecdsa_key, sizeof (id_priv.ecdsa_key), 1);
+  parsehex (d_pkey,(char*) &id_priv.ecdsa_key, sizeof (id_priv.ecdsa_key), 1);
   GNUNET_IDENTITY_key_get_public (&id_priv,
                                   &id_pub);
   GNUNET_STRINGS_data_to_string (&id_pub,
-                                 GNUNET_IDENTITY_public_key_get_length 
(&id_pub),
+                                 GNUNET_IDENTITY_public_key_get_length (
+                                   &id_pub),
                                  ztld,
                                  sizeof (ztld));
   fprintf (stdout, "Zone private key (d, big-endian scalar):\n");
-  print_bytes_ (&id_priv.ecdsa_key, sizeof(id_priv.ecdsa_key), 8, 1);
+  print_bytes (&id_priv.ecdsa_key, sizeof(id_priv.ecdsa_key), 8);
   fprintf (stdout, "\n");
   fprintf (stdout, "Zone identifier (ztype|zkey):\n");
   key_len = GNUNET_IDENTITY_public_key_get_length (&id_pub);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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