diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-11 14:13:29 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-03 08:40:10 -0400 |
commit | 5a2f70f86a8ca226f9b818ebf0ce893c1a1db5fa (patch) | |
tree | 51f16719e406006f262818637cdd603844d0b5e6 /src/or/channeltls.c | |
parent | d4c57909f8578bb90e38573b873487be3ba759bd (diff) | |
download | tor-5a2f70f86a8ca226f9b818ebf0ce893c1a1db5fa.tar.gz tor-5a2f70f86a8ca226f9b818ebf0ce893c1a1db5fa.zip |
Clean up comments, mark more branches as BUG.
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r-- | src/or/channeltls.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c index 7a6f0b37ce..f5b81f03df 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -2219,8 +2219,11 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan) } /* Length of random part. */ - if (bodylen < 24) + if (BUG(bodylen < 24)) { + // LCOV_EXCL_START ERR("Bodylen is somehow less than 24, which should really be impossible"); + // LCOV_EXCL_STOP + } if (tor_memneq(expected_cell->payload+4, auth, bodylen-24)) ERR("Some field in the AUTHENTICATE cell body was not as expected"); @@ -2239,8 +2242,11 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan) size_t keysize; int signed_len; - if (!pk) + if (BUG(!pk)) { + // LCOV_EXCL_START ERR("Internal error: couldn't get RSA key from AUTH cert."); + // LCOV_EXCL_STOP + } crypto_digest256(d, (char*)auth, V3_AUTH_BODY_LEN, DIGEST_SHA256); keysize = crypto_pk_keysize(pk); |