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/or/shared_random.h | |
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/or/shared_random.h')
-rw-r--r-- | src/or/shared_random.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/shared_random.h b/src/or/shared_random.h index 51f3b550d8..7c0a3e749d 100644 --- a/src/or/shared_random.h +++ b/src/or/shared_random.h @@ -76,8 +76,10 @@ typedef struct sr_commit_t { /* Commit owner info */ - /* The RSA identity key of the authority. */ + /* The RSA identity key of the authority and it's base16 representation + * which includes the NUL terminated byte. */ char rsa_identity[DIGEST_LEN]; + char rsa_identity_hex[HEX_DIGEST_LEN + 1]; /* Commitment information */ @@ -121,8 +123,7 @@ void sr_srv_encode(char *dst, size_t dst_len, const sr_srv_t *srv); static inline const char *sr_commit_get_rsa_fpr(const sr_commit_t *commit) { - return hex_str((const char *) commit->rsa_identity, - sizeof(commit->rsa_identity)); + return commit->rsa_identity_hex; } void sr_compute_srv(void); |