summaryrefslogtreecommitdiff
path: root/src/or/hibernate.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/hibernate.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/hibernate.c')
-rw-r--r--src/or/hibernate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index e3c80b5f14..82196ef2c6 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -587,7 +587,10 @@ accounting_set_wakeup_time(void)
char buf[ISO_TIME_LEN+1];
format_iso_time(buf, interval_start_time);
- crypto_pk_get_digest(get_server_identity_key(), digest);
+ if (crypto_pk_get_digest(get_server_identity_key(), digest) < 0) {
+ log_err(LD_BUG, "Error getting our key's digest.");
+ tor_assert(0);
+ }
d_env = crypto_digest_new();
crypto_digest_add_bytes(d_env, buf, ISO_TIME_LEN);