diff options
author | David Goulet <dgoulet@torproject.org> | 2016-07-04 12:05:48 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-07-04 12:05:48 -0400 |
commit | 267e16ea616b3466652bfee81fec507ea45d96a6 (patch) | |
tree | 50b10b4b6f2658953b5a3cfbbeba21298dc1ec2b /src/test/test_shared_random.c | |
parent | be78e9ff3782639b9fa72dcfa9bda559cfc83f17 (diff) | |
download | tor-267e16ea616b3466652bfee81fec507ea45d96a6.tar.gz tor-267e16ea616b3466652bfee81fec507ea45d96a6.zip |
sr: add the base16 RSA identity digest to commit
Keep the base16 representation of the RSA identity digest in the commit object
so we can use it without using hex_str() or dynamically encoding it everytime
we need it. It's used extensively in the logs for instance.
Fixes #19561
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_shared_random.c')
-rw-r--r-- | src/test/test_shared_random.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/test_shared_random.c b/src/test/test_shared_random.c index d001785340..270cd81228 100644 --- a/src/test/test_shared_random.c +++ b/src/test/test_shared_random.c @@ -702,6 +702,9 @@ test_sr_setup_commits(void) /* Do some surgery on the commit */ memset(commit_a->rsa_identity, 'A', sizeof(commit_a->rsa_identity)); + base16_encode(commit_a->rsa_identity_hex, + sizeof(commit_a->rsa_identity_hex), commit_a->rsa_identity, + sizeof(commit_a->rsa_identity)); strlcpy(commit_a->encoded_reveal, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(commit_a->encoded_reveal)); @@ -716,6 +719,9 @@ test_sr_setup_commits(void) /* Do some surgery on the commit */ memset(commit_b->rsa_identity, 'B', sizeof(commit_b->rsa_identity)); + base16_encode(commit_b->rsa_identity_hex, + sizeof(commit_b->rsa_identity_hex), commit_b->rsa_identity, + sizeof(commit_b->rsa_identity)); strlcpy(commit_b->encoded_reveal, "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", sizeof(commit_b->encoded_reveal)); @@ -730,6 +736,9 @@ test_sr_setup_commits(void) /* Do some surgery on the commit */ memset(commit_c->rsa_identity, 'C', sizeof(commit_c->rsa_identity)); + base16_encode(commit_c->rsa_identity_hex, + sizeof(commit_c->rsa_identity_hex), commit_c->rsa_identity, + sizeof(commit_c->rsa_identity)); strlcpy(commit_c->encoded_reveal, "CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", sizeof(commit_c->encoded_reveal)); @@ -744,6 +753,9 @@ test_sr_setup_commits(void) /* Do some surgery on the commit */ memset(commit_d->rsa_identity, 'D', sizeof(commit_d->rsa_identity)); + base16_encode(commit_d->rsa_identity_hex, + sizeof(commit_d->rsa_identity_hex), commit_d->rsa_identity, + sizeof(commit_d->rsa_identity)); strlcpy(commit_d->encoded_reveal, "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", sizeof(commit_d->encoded_reveal)); |