summaryrefslogtreecommitdiff
path: root/src/or/shared_random.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2016-07-04 12:05:48 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-07-04 12:05:48 -0400
commit267e16ea616b3466652bfee81fec507ea45d96a6 (patch)
tree50b10b4b6f2658953b5a3cfbbeba21298dc1ec2b /src/or/shared_random.c
parentbe78e9ff3782639b9fa72dcfa9bda559cfc83f17 (diff)
downloadtor-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/or/shared_random.c')
-rw-r--r--src/or/shared_random.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/shared_random.c b/src/or/shared_random.c
index e9e6cbcfde..612e1c6bde 100644
--- a/src/or/shared_random.c
+++ b/src/or/shared_random.c
@@ -140,6 +140,8 @@ commit_new(const char *rsa_identity)
commit = tor_malloc_zero(sizeof(*commit));
commit->alg = SR_DIGEST_ALG;
memcpy(commit->rsa_identity, rsa_identity, sizeof(commit->rsa_identity));
+ base16_encode(commit->rsa_identity_hex, sizeof(commit->rsa_identity_hex),
+ commit->rsa_identity, sizeof(commit->rsa_identity));
return commit;
}