diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-09 09:24:16 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-09 09:24:16 -0400 |
commit | 418f3d6298beb27e050618e2f59e01d6d3b2f45b (patch) | |
tree | 97ac6a038194559561a34d245fbd74584cb5f9c6 /src/or/rendcommon.c | |
parent | 9696021593d28a7ae3b6a88ac57ff31234b469f5 (diff) | |
download | tor-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/rendcommon.c')
-rw-r--r-- | src/or/rendcommon.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c index d9d39b1f19..c01ce8f1de 100644 --- a/src/or/rendcommon.c +++ b/src/or/rendcommon.c @@ -475,7 +475,10 @@ rend_encode_v2_descriptors(smartlist_t *descs_out, tor_assert(descriptor_cookie); } /* Obtain service_id from public key. */ - crypto_pk_get_digest(service_key, service_id); + if (crypto_pk_get_digest(service_key, service_id) < 0) { + log_warn(LD_BUG, "Couldn't compute service key digest."); + return -1; + } /* Calculate current time-period. */ time_period = get_time_period(now, period, service_id); /* Determine how many seconds the descriptor will be valid. */ |