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>
This commit is contained in:
David Goulet
2016-07-04 12:05:48 -04:00
parent be78e9ff37
commit 267e16ea61
3 changed files with 18 additions and 3 deletions
+2
View File
@@ -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;
}