mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
Mark unreachable lines in crypto_curve25519.c
Also, resolve a bug in test_ntor_cl.c
This commit is contained in:
parent
820b1984ad
commit
8a536be705
@ -65,8 +65,10 @@ STATIC int
|
|||||||
curve25519_basepoint_impl(uint8_t *output, const uint8_t *secret)
|
curve25519_basepoint_impl(uint8_t *output, const uint8_t *secret)
|
||||||
{
|
{
|
||||||
int r = 0;
|
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();
|
pick_curve25519_basepoint_impl();
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Someone should benchmark curved25519_scalarmult_basepoint versus
|
/* TODO: Someone should benchmark curved25519_scalarmult_basepoint versus
|
||||||
@ -290,10 +292,13 @@ pick_curve25519_basepoint_impl(void)
|
|||||||
if (curve25519_basepoint_spot_check() == 0)
|
if (curve25519_basepoint_spot_check() == 0)
|
||||||
return;
|
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 "
|
"multiplication seems broken; using the curve25519 "
|
||||||
"implementation.");
|
"implementation.");
|
||||||
curve25519_use_ed = 0;
|
curve25519_use_ed = 0;
|
||||||
|
/* LCOV_EXCL_STOP */
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initialize the curve25519 implementations. This is necessary if you're
|
/** Initialize the curve25519 implementations. This is necessary if you're
|
||||||
|
@ -153,7 +153,10 @@ main(int argc, char **argv)
|
|||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr, "I need arguments. Read source for more info.\n");
|
fprintf(stderr, "I need arguments. Read source for more info.\n");
|
||||||
return 1;
|
return 1;
|
||||||
} else if (!strcmp(argv[1], "client1")) {
|
}
|
||||||
|
|
||||||
|
curve25519_init();
|
||||||
|
if (!strcmp(argv[1], "client1")) {
|
||||||
return client1(argc, argv);
|
return client1(argc, argv);
|
||||||
} else if (!strcmp(argv[1], "server1")) {
|
} else if (!strcmp(argv[1], "server1")) {
|
||||||
return server1(argc, argv);
|
return server1(argc, argv);
|
||||||
|
Loading…
Reference in New Issue
Block a user