[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 18/20: -fix merge issues
From: |
gnunet |
Subject: |
[gnunet] 18/20: -fix merge issues |
Date: |
Sat, 19 Feb 2022 16:20:58 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit 901b2fcc56a618a0d3e9d3e65c8688f84e3e180c
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Feb 19 12:50:22 2022 +0100
-fix merge issues
---
src/gnsrecord/gnunet-gnsrecord-tvg.c | 76 ++++++++++++++++++++++++++++++------
1 file changed, 63 insertions(+), 13 deletions(-)
diff --git a/src/gnsrecord/gnunet-gnsrecord-tvg.c
b/src/gnsrecord/gnunet-gnsrecord-tvg.c
index 2db301850..112a06a7d 100644
--- a/src/gnsrecord/gnunet-gnsrecord-tvg.c
+++ b/src/gnsrecord/gnunet-gnsrecord-tvg.c
@@ -40,7 +40,8 @@ static char *d_pkey =
static char *d_edkey =
"5af7020ee19160328832352bbc6a68a8d71a7cbe1b929969a7c66d415a0d8f65";
-int
+
+static int
parsehex (char *src, char *dst, size_t dstlen, int invert)
{
char *line = src;
@@ -124,9 +125,6 @@ static void
run_pkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char *label)
{
struct GNUNET_TIME_Absolute expire;
- struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
- struct GNUNET_TIME_Relative delta1;
- struct GNUNET_TIME_Relative delta2;
struct GNUNET_GNSRECORD_Block *rrblock;
char *bdata;
struct GNUNET_IDENTITY_PrivateKey id_priv;
@@ -134,8 +132,6 @@ run_pkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count,
const char *label)
struct GNUNET_IDENTITY_PrivateKey pkey_data_p;
struct GNUNET_IDENTITY_PublicKey pkey_data;
struct GNUNET_HashCode query;
- void *data;
- size_t data_size;
char *rdata;
size_t rdata_size;
char ztld[128];
@@ -244,9 +240,6 @@ static void
run_edkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count, const char*label)
{
struct GNUNET_TIME_Absolute expire;
- struct GNUNET_TIME_Absolute now = GNUNET_TIME_absolute_get ();
- struct GNUNET_TIME_Relative delta1;
- struct GNUNET_TIME_Relative delta2;
struct GNUNET_GNSRECORD_Block *rrblock;
char *bdata;
struct GNUNET_IDENTITY_PrivateKey id_priv;
@@ -254,8 +247,6 @@ run_edkey (struct GNUNET_GNSRECORD_Data *rd, int rd_count,
const char*label)
struct GNUNET_IDENTITY_PrivateKey pkey_data_p;
struct GNUNET_IDENTITY_PublicKey pkey_data;
struct GNUNET_HashCode query;
- void *data;
- size_t data_size;
char *rdata;
size_t rdata_size;
@@ -373,8 +364,67 @@ run (void *cls,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- run_pkey ();
- run_edkey ();
+ struct GNUNET_GNSRECORD_Data rd_pkey;
+ struct GNUNET_GNSRECORD_Data rd[3];
+ struct GNUNET_TIME_Absolute exp1;
+ struct GNUNET_TIME_Absolute exp2;
+ struct GNUNET_TIME_Relative exp3;
+ size_t pkey_data_size;
+ size_t ip_data_size;
+ char *pkey_data;
+ char *ip_data;
+
+ /*
+ * Make different expiration times
+ */
+ GNUNET_STRINGS_fancy_time_to_absolute ("2048-01-23 10:51:34",
+ &exp1);
+ GNUNET_STRINGS_fancy_time_to_absolute ("3540-05-22 07:55:01",
+ &exp2);
+ GNUNET_STRINGS_fancy_time_to_relative ("100y",
+ &exp3);
+
+
+ memset (&rd_pkey, 0, sizeof (struct GNUNET_GNSRECORD_Data));
+ GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_string_to_value (
+ GNUNET_GNSRECORD_TYPE_PKEY,
+
"000G0011WESGZY9VRV9NNJ66W3GKNZFZF56BFD2BQF3MHMJST2G2GKDYGG",
+ (void**) &pkey_data,
+ &pkey_data_size));
+ rd_pkey.data = pkey_data;
+ rd_pkey.data_size = pkey_data_size;
+ rd_pkey.expiration_time = exp1.abs_value_us;
+ rd_pkey.record_type = GNUNET_GNSRECORD_TYPE_PKEY;
+ rd_pkey.flags = GNUNET_GNSRECORD_RF_CRITICAL;
+ GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_string_to_value (
+ GNUNET_DNSPARSER_TYPE_AAAA,
+ "::dead:beef",
+ (void**) &ip_data,
+ &ip_data_size));
+
+ rd[0].data = ip_data;
+ rd[0].data_size = ip_data_size;
+ rd[0].expiration_time = exp1.abs_value_us;
+ rd[0].record_type = GNUNET_DNSPARSER_TYPE_AAAA;
+ rd[0].flags = GNUNET_GNSRECORD_RF_NONE;
+
+ rd[1].data = "\u611b\u79f0";
+ 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[2].data = "Hello World";
+ rd[2].data_size = strlen (rd[2].data);
+ rd[2].expiration_time = exp3.rel_value_us;
+ rd[2].record_type = GNUNET_DNSPARSER_TYPE_TXT;
+ rd[2].flags = GNUNET_GNSRECORD_RF_SUPPLEMENTAL
+ | GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
+
+ run_pkey (&rd_pkey, 1, "testdelegation");
+ run_pkey (rd, 3, "namesystem");
+ run_edkey (&rd_pkey, 1, "testdelegation");
+ run_edkey (rd, 3, "namesystem");
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 02/20: -also add serialization from/to block, (continued)
- [gnunet] 02/20: -also add serialization from/to block, gnunet, 2022/02/19
- [gnunet] 03/20: incomplete first hack of new hello-uri lib, gnunet, 2022/02/19
- [gnunet] 01/20: first steps towards usable dhtu, gnunet, 2022/02/19
- [gnunet] 04/20: -conclude hello-uri implementation and test, gnunet, 2022/02/19
- [gnunet] 09/20: -DHT now takes care of queue size limit, gnunet, 2022/02/19
- [gnunet] 07/20: -more work on DHTU integration, gnunet, 2022/02/19
- [gnunet] 08/20: rebase, gnunet, 2022/02/19
- [gnunet] 13/20: -fix port initialization in addr, gnunet, 2022/02/19
- [gnunet] 11/20: -DHT: add gnunet-dht-hello for bootstrapping, gnunet, 2022/02/19
- [gnunet] 16/20: -got basics to work with dhtu and udp+ip underlay, gnunet, 2022/02/19
- [gnunet] 18/20: -fix merge issues,
gnunet <=
- [gnunet] 20/20: -fix assertion, fix key initialization, gnunet, 2022/02/19
- [gnunet] 17/20: -try to make static analysis happy, gnunet, 2022/02/19
- [gnunet] 15/20: -adding logging, minor dthu bugfixes, gnunet, 2022/02/19
- [gnunet] 19/20: -fix htons/htonl bug introduced by message format change, gnunet, 2022/02/19
- [gnunet] 12/20: -fix crashes on new DHT load/shutdown, gnunet, 2022/02/19
- [gnunet] 10/20: -add hold/drop logic, gnunet, 2022/02/19
- [gnunet] 06/20: -implement TVG, gnunet, 2022/02/19
- [gnunet] 05/20: add new HELLO_URI block support to block plugin, gnunet, 2022/02/19
- [gnunet] 14/20: -DHT: get tests to pass, gnunet, 2022/02/19