summaryrefslogtreecommitdiff
path: root/src/or/router.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/router.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/router.c')
-rw-r--r--src/or/router.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 6d3a32a60c..f7528c22d0 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -212,7 +212,11 @@ set_server_identity_key(crypto_pk_t *k)
{
crypto_pk_free(server_identitykey);
server_identitykey = k;
- crypto_pk_get_digest(server_identitykey, server_identitykey_digest);
+ if (crypto_pk_get_digest(server_identitykey,
+ server_identitykey_digest) < 0) {
+ log_err(LD_BUG, "Couldn't compute our own identity key digest.");
+ tor_assert(0);
+ }
}
/** Make sure that we have set up our identity keys to match or not match as
@@ -871,8 +875,12 @@ init_keys(void)
}
cert = get_my_v3_authority_cert();
if (cert) {
- crypto_pk_get_digest(get_my_v3_authority_cert()->identity_key,
- v3_digest);
+ if (crypto_pk_get_digest(get_my_v3_authority_cert()->identity_key,
+ v3_digest) < 0) {
+ log_err(LD_BUG, "Couldn't compute my v3 authority identity key "
+ "digest.");
+ return -1;
+ }
v3_digest_set = 1;
}
}