aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto_ed25519.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-28 09:25:17 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-28 09:25:17 -0400
commita64d79ca4c5699be161a54d94e0e6c0f7d06db7c (patch)
tree5d0fa776b824fe9bd30014e92259c7d0805b3e34 /src/common/crypto_ed25519.c
parent9727a9248a474909c0ad53be9d55cd39b69d0611 (diff)
downloadtor-a64d79ca4c5699be161a54d94e0e6c0f7d06db7c.tar.gz
tor-a64d79ca4c5699be161a54d94e0e6c0f7d06db7c.zip
Move around some LCOV_EXCLs in src/common
Apparently, my compiler now generates coverage markers for label-only lines, so we need to exclude those too if they are meant to be unreachable.
Diffstat (limited to 'src/common/crypto_ed25519.c')
-rw-r--r--src/common/crypto_ed25519.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c
index 969cc1047b..94b23e31b9 100644
--- a/src/common/crypto_ed25519.c
+++ b/src/common/crypto_ed25519.c
@@ -293,9 +293,12 @@ ed25519_sign_prefixed,(ed25519_signature_t *signature_out,
prefixed_msg = get_prefixed_msg(msg, msg_len, prefix_str,
&prefixed_msg_len);
- if (!prefixed_msg) {
+ if (BUG(!prefixed_msg)) {
+ /* LCOV_EXCL_START -- only possible when the message and prefix are
+ * ridiculously huge */
log_warn(LD_GENERAL, "Failed to get prefixed msg.");
return -1;
+ /* LCOV_EXCL_STOP */
}
retval = ed25519_sign(signature_out,
@@ -338,9 +341,12 @@ ed25519_checksig_prefixed(const ed25519_signature_t *signature,
prefixed_msg = get_prefixed_msg(msg, msg_len, prefix_str,
&prefixed_msg_len);
- if (!prefixed_msg) {
+ if (BUG(!prefixed_msg)) {
+ /* LCOV_EXCL_START -- only possible when the message and prefix are
+ * ridiculously huge */
log_warn(LD_GENERAL, "Failed to get prefixed msg.");
return -1;
+ /* LCOV_EXCL_STOP */
}
retval = ed25519_checksig(signature,
@@ -718,8 +724,11 @@ ed25519_impl_spot_check,(void))
*/
goto end;
+ // LCOV_EXCL_START -- We can only reach this if our ed25519 implementation is
+ // broken.
fail:
r = -1;
+ // LCOV_EXCL_STOP
end:
return r;
}