diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-05-03 11:12:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-05-16 08:25:53 -0400 |
commit | 8a536be70511e78befa08475a109a231cde0cd0e (patch) | |
tree | 790bd9909b2db8f6da7eaa629ba3669c89ba439e /src/common/crypto_curve25519.c | |
parent | 820b1984ad61e28fbbdc7194f862c6e2d8edbf8d (diff) | |
download | tor-8a536be70511e78befa08475a109a231cde0cd0e.tar.gz tor-8a536be70511e78befa08475a109a231cde0cd0e.zip |
Mark unreachable lines in crypto_curve25519.c
Also, resolve a bug in test_ntor_cl.c
Diffstat (limited to 'src/common/crypto_curve25519.c')
-rw-r--r-- | src/common/crypto_curve25519.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/crypto_curve25519.c b/src/common/crypto_curve25519.c index 57c878b79a..58ec923638 100644 --- a/src/common/crypto_curve25519.c +++ b/src/common/crypto_curve25519.c @@ -65,8 +65,10 @@ STATIC int curve25519_basepoint_impl(uint8_t *output, const uint8_t *secret) { int r = 0; - if (PREDICT_UNLIKELY(curve25519_use_ed == -1)) { + if (BUG(curve25519_use_ed == -1)) { + /* LCOV_EXCL_START - Only reached if we forgot to call curve25519_init() */ pick_curve25519_basepoint_impl(); + /* LCOV_EXCL_STOP */ } /* TODO: Someone should benchmark curved25519_scalarmult_basepoint versus @@ -290,10 +292,13 @@ pick_curve25519_basepoint_impl(void) if (curve25519_basepoint_spot_check() == 0) return; - log_warn(LD_CRYPTO, "The ed25519-based curve25519 basepoint " + /* LCOV_EXCL_START + * only reachable if our basepoint implementation broken */ + log_warn(LD_BUG|LD_CRYPTO, "The ed25519-based curve25519 basepoint " "multiplication seems broken; using the curve25519 " "implementation."); curve25519_use_ed = 0; + /* LCOV_EXCL_STOP */ } /** Initialize the curve25519 implementations. This is necessary if you're |