[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor] branch main updated: Extend blinding testvec with timeperiod test.



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

dgoulet pushed a commit to branch main
in repository tor.

The following commit(s) were added to refs/heads/main by this push:
     new 43d3a41157 Extend blinding testvec with timeperiod test.
43d3a41157 is described below

commit 43d3a411575b0a07e313ef4715cd164e0a6a5f0f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
AuthorDate: Fri Feb 10 08:11:39 2023 -0500

    Extend blinding testvec with timeperiod test.
    
    When I copied this to arti, I messed up and thought that the default
    time period was 1440 seconds for some weird testing reason. That led
    to confusion.
    
    This commit adds a test case that time period 1440 is May 20, 1973:
    now arti and c tor match!
---
 src/test/test_hs_common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/test/test_hs_common.c b/src/test/test_hs_common.c
index 4b43a9eb0b..ea7c589be9 100644
--- a/src/test/test_hs_common.c
+++ b/src/test/test_hs_common.c
@@ -1527,8 +1527,14 @@ test_blinding_basics(void *arg)
 {
   (void)arg;
   char *mem_op_hex_tmp = NULL;
-  uint64_t time_period = 1234;
+  const uint64_t time_period = 1234;
   ed25519_keypair_t keypair;
+
+  time_t instant;
+  tt_int_op(0, OP_EQ, parse_iso_time("1973-05-20 01:50:33", &instant));
+  tt_int_op(1440, OP_EQ, get_time_period_length()); // in minutes, remember.
+  tt_int_op(time_period, OP_EQ, hs_get_time_period_num(instant));
+
   const char pubkey_hex[] =
     "833990B085C1A688C1D4C8B1F6B56AFAF5A2ECA674449E1D704F83765CCB7BC6";
   const char seckey_hex[] =

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits