summaryrefslogtreecommitdiff
path: root/src/or/onion_fast.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-07-06 13:43:12 -0400
committerNick Mathewson <nickm@torproject.org>2016-07-06 13:43:12 -0400
commitacba4cc9546f66be95353e37fc22b81d0dc91732 (patch)
treeb0c2adc0c09e589b5394a9e428741aa9ebb0ade5 /src/or/onion_fast.c
parent08cc0ef8320e614c1a33ea5e70bef4f5809981f2 (diff)
downloadtor-acba4cc9546f66be95353e37fc22b81d0dc91732.tar.gz
tor-acba4cc9546f66be95353e37fc22b81d0dc91732.zip
test coverage on onion_fast: 0%->100%
Diffstat (limited to 'src/or/onion_fast.c')
-rw-r--r--src/or/onion_fast.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/onion_fast.c b/src/or/onion_fast.c
index 1f79860596..6b5d12e407 100644
--- a/src/or/onion_fast.c
+++ b/src/or/onion_fast.c
@@ -59,8 +59,8 @@ fast_server_handshake(const uint8_t *key_in, /* DIGEST_LEN bytes */
memcpy(tmp+DIGEST_LEN, handshake_reply_out, DIGEST_LEN);
out_len = key_out_len+DIGEST_LEN;
out = tor_malloc(out_len);
- if (crypto_expand_key_material_TAP(tmp, sizeof(tmp), out, out_len)) {
- goto done;
+ if (BUG(crypto_expand_key_material_TAP(tmp, sizeof(tmp), out, out_len))) {
+ goto done; // LCOV_EXCL_LINE
}
memcpy(handshake_reply_out+DIGEST_LEN, out, DIGEST_LEN);
memcpy(key_out, out+DIGEST_LEN, key_out_len);
@@ -100,10 +100,12 @@ fast_client_handshake(const fast_handshake_state_t *handshake_state,
memcpy(tmp+DIGEST_LEN, handshake_reply_out, DIGEST_LEN);
out_len = key_out_len+DIGEST_LEN;
out = tor_malloc(out_len);
- if (crypto_expand_key_material_TAP(tmp, sizeof(tmp), out, out_len)) {
+ if (BUG(crypto_expand_key_material_TAP(tmp, sizeof(tmp), out, out_len))) {
+ /* LCOV_EXCL_START */
if (msg_out)
*msg_out = "Failed to expand key material";
goto done;
+ /* LCOV_EXCL_STOP */
}
if (tor_memneq(out, handshake_reply_out+DIGEST_LEN, DIGEST_LEN)) {
/* H(K) does *not* match. Something fishy. */