summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-19 12:33:04 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-09-19 12:33:04 -0400
commit5dea4b565f7295bae8c48790cc7d00a6e237fff0 (patch)
treebdf04e8518f881b3dcb2ddcd51166b59897207dd /src/or/or.h
parentf395f41868514a0e418c95f3203d59f3aca6fa47 (diff)
downloadtor-5dea4b565f7295bae8c48790cc7d00a6e237fff0.tar.gz
tor-5dea4b565f7295bae8c48790cc7d00a6e237fff0.zip
Add a BASE32_DIGEST_LEN define
Use this value instead of hardcoded values of 32 everywhere. This also addresses the use of REND_DESC_ID_V2_LEN_BASE32 in hs_lookup_last_hid_serv_request() for the HSDir encoded identity digest length which is accurate but semantically wrong. Fixes #23305. Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 4fc0e788a0..c23054c3b7 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -747,15 +747,15 @@ typedef enum {
#define REND_NUMBER_OF_CONSECUTIVE_REPLICAS 3
/** Length of v2 descriptor ID (32 base32 chars = 160 bits). */
-#define REND_DESC_ID_V2_LEN_BASE32 32
+#define REND_DESC_ID_V2_LEN_BASE32 BASE32_DIGEST_LEN
/** Length of the base32-encoded secret ID part of versioned hidden service
* descriptors. */
-#define REND_SECRET_ID_PART_LEN_BASE32 32
+#define REND_SECRET_ID_PART_LEN_BASE32 BASE32_DIGEST_LEN
/** Length of the base32-encoded hash of an introduction point's
* identity key. */
-#define REND_INTRO_POINT_ID_LEN_BASE32 32
+#define REND_INTRO_POINT_ID_LEN_BASE32 BASE32_DIGEST_LEN
/** Length of the descriptor cookie that is used for client authorization
* to hidden services. */