aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-07-03 19:19:16 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-07-03 19:19:16 +0200
commite22ae6be5bf25c743a6c7db34bb0ef163704824f (patch)
treea2ba264a4bdf87b83bbc036bc9930f4645535af6 /src/gnsrecord
parent8b6f366b3a449778b7e30d163785e550734e50ed (diff)
downloadgnunet-e22ae6be5bf25c743a6c7db34bb0ef163704824f.tar.gz
gnunet-e22ae6be5bf25c743a6c7db34bb0ef163704824f.zip
GNS: Make TV expirations independent of TZ
Diffstat (limited to 'src/gnsrecord')
-rw-r--r--src/gnsrecord/gnunet-gnsrecord-tvg.c18
-rw-r--r--src/gnsrecord/test_gnsrecord_testvectors.c4
2 files changed, 15 insertions, 7 deletions
diff --git a/src/gnsrecord/gnunet-gnsrecord-tvg.c b/src/gnsrecord/gnunet-gnsrecord-tvg.c
index b2a8d1405..4ea81b599 100644
--- a/src/gnsrecord/gnunet-gnsrecord-tvg.c
+++ b/src/gnsrecord/gnunet-gnsrecord-tvg.c
@@ -444,6 +444,9 @@ run (void *cls,
444 struct GNUNET_TIME_Absolute exp1; 444 struct GNUNET_TIME_Absolute exp1;
445 struct GNUNET_TIME_Absolute exp2; 445 struct GNUNET_TIME_Absolute exp2;
446 struct GNUNET_TIME_Absolute exp3; 446 struct GNUNET_TIME_Absolute exp3;
447 struct GNUNET_TIME_AbsoluteNBO exp1nbo;
448 struct GNUNET_TIME_AbsoluteNBO exp2nbo;
449 struct GNUNET_TIME_AbsoluteNBO exp3nbo;
447 size_t pkey_data_size; 450 size_t pkey_data_size;
448 size_t ip_data_size; 451 size_t ip_data_size;
449 char *pkey_data; 452 char *pkey_data;
@@ -452,13 +455,12 @@ run (void *cls,
452 /* 455 /*
453 * Make different expiration times 456 * Make different expiration times
454 */ 457 */
455 GNUNET_STRINGS_fancy_time_to_absolute ("2228-01-23 10:51:34", 458 parsehex ("001cee8c10e25980", (char*) &exp1nbo, sizeof (exp1nbo), 0);
456 &exp1); 459 parsehex ("003ff2aa5408db40", (char*) &exp2nbo, sizeof (exp2nbo), 0);
457 GNUNET_STRINGS_fancy_time_to_absolute ("2540-05-22 07:55:01", 460 parsehex ("0028bb13ff371940", (char*) &exp3nbo, sizeof (exp3nbo), 0);
458 &exp2); 461 exp1 = GNUNET_TIME_absolute_ntoh (exp1nbo);
459 GNUNET_STRINGS_fancy_time_to_absolute ("2333-04-21 06:07:09", 462 exp2 = GNUNET_TIME_absolute_ntoh (exp2nbo);
460 &exp3); 463 exp3 = GNUNET_TIME_absolute_ntoh (exp3nbo);
461
462 464
463 memset (&rd_pkey, 0, sizeof (struct GNUNET_GNSRECORD_Data)); 465 memset (&rd_pkey, 0, sizeof (struct GNUNET_GNSRECORD_Data));
464 GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_string_to_value ( 466 GNUNET_assert (GNUNET_OK == GNUNET_GNSRECORD_string_to_value (
@@ -521,6 +523,8 @@ main (int argc,
521 GNUNET_log_setup ("gnunet-gns-tvg", 523 GNUNET_log_setup ("gnunet-gns-tvg",
522 "INFO", 524 "INFO",
523 NULL)); 525 NULL));
526 gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1u, 0);
527 gcry_control (GCRYCTL_SET_VERBOSITY, 99);
524 if (GNUNET_OK != 528 if (GNUNET_OK !=
525 GNUNET_PROGRAM_run (argc, argv, 529 GNUNET_PROGRAM_run (argc, argv,
526 "gnunet-gns-tvg", 530 "gnunet-gns-tvg",
diff --git a/src/gnsrecord/test_gnsrecord_testvectors.c b/src/gnsrecord/test_gnsrecord_testvectors.c
index 575f6d31d..cdfe83d76 100644
--- a/src/gnsrecord/test_gnsrecord_testvectors.c
+++ b/src/gnsrecord/test_gnsrecord_testvectors.c
@@ -16,6 +16,10 @@ struct GnsTv
16 char *rrblock; 16 char *rrblock;
17}; 17};
18 18
19/** The first tests is from the Go implementation.
20 * The second test from GNUnet. But both produce different, verifiable
21 * signatures.
22 */
19struct GnsTv tvs[] = { 23struct GnsTv tvs[] = {
20 { .d = 24 { .d =
21 "50 d7 b6 52 a4 ef ea df" 25 "50 d7 b6 52 a4 ef ea df"