summaryrefslogtreecommitdiff
path: root/src/or/channeltls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-09-11 14:13:29 -0400
committerNick Mathewson <nickm@torproject.org>2016-11-03 08:40:10 -0400
commit5a2f70f86a8ca226f9b818ebf0ce893c1a1db5fa (patch)
tree51f16719e406006f262818637cdd603844d0b5e6 /src/or/channeltls.c
parentd4c57909f8578bb90e38573b873487be3ba759bd (diff)
downloadtor-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.c10
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);