aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 42b05835ad..6ab042e35f 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -3531,10 +3531,8 @@ networkstatus_parse_detached_signatures(const char *s, const char *eos)
continue;
}
- expected_length =
- (alg == DIGEST_SHA1) ? HEX_DIGEST_LEN : HEX_DIGEST256_LEN;
- digest_length =
- (alg == DIGEST_SHA1) ? DIGEST_LEN : DIGEST256_LEN;
+ digest_length = crypto_digest_algorithm_get_length(alg);
+ expected_length = digest_length * 2; /* hex encoding */
if (strlen(hexdigest) != expected_length) {
log_warn(LD_DIR, "Wrong length on consensus-digest in detached "