summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-08-09 09:24:16 -0400
committerNick Mathewson <nickm@torproject.org>2017-08-09 09:24:16 -0400
commit418f3d6298beb27e050618e2f59e01d6d3b2f45b (patch)
tree97ac6a038194559561a34d245fbd74584cb5f9c6 /src/or/routerparse.c
parent9696021593d28a7ae3b6a88ac57ff31234b469f5 (diff)
downloadtor-418f3d6298beb27e050618e2f59e01d6d3b2f45b.tar.gz
tor-418f3d6298beb27e050618e2f59e01d6d3b2f45b.zip
Make sure we always wind up checking i2d_*'s output.
The biggest offender here was sometimes not checking the output of crypto_pk_get_digest. Fixes bug 19418. Reported by Guido Vranken.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 521e237be2..bfd0270434 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -5967,7 +5967,10 @@ rend_parse_v2_service_descriptor(rend_service_descriptor_t **parsed_out,
"v2 rendezvous service descriptor") < 0)
goto err;
/* Verify that descriptor ID belongs to public key and secret ID part. */
- crypto_pk_get_digest(result->pk, public_key_hash);
+ if (crypto_pk_get_digest(result->pk, public_key_hash) < 0) {
+ log_warn(LD_REND, "Unable to compute rend descriptor public key digest");
+ goto err;
+ }
rend_get_descriptor_id_bytes(test_desc_id, public_key_hash,
secret_id_part);
if (tor_memneq(desc_id_out, test_desc_id, DIGEST_LEN)) {