summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-10-20 09:08:42 -0400
committerNick Mathewson <nickm@torproject.org>2014-10-20 09:08:42 -0400
commitaffa251c83716eacc49dad5b48c0769c58a62907 (patch)
tree5eed1389ca7cf5991c0af15fd201b571928d1308
parent2d4c40ee5f046ef99e530fc8808f302275c27788 (diff)
downloadtor-affa251c83716eacc49dad5b48c0769c58a62907.tar.gz
tor-affa251c83716eacc49dad5b48c0769c58a62907.zip
Use a macro to indicate "The ecdhe group we use by default".
This might make Coverity happier about the if statement where we have a default case that's the same as one of the other cases. CID 1248515
-rw-r--r--src/common/tortls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 32809b8889..b159ae4139 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1170,6 +1170,9 @@ tor_tls_context_init_one(tor_tls_context_t **ppcontext,
return ((new_ctx != NULL) ? 0 : -1);
}
+/** The group we should use for ecdhe when none was selected. */
+#define NID_tor_default_ecdhe_group NID_X9_62_prime256v1
+
/** Create a new TLS context for use with Tor TLS handshakes.
* <b>identity</b> should be set to the identity key used to sign the
* certificate.
@@ -1365,7 +1368,7 @@ tor_tls_context_new(crypto_pk_t *identity, unsigned int key_lifetime,
else if (flags & TOR_TLS_CTX_USE_ECDHE_P256)
nid = NID_X9_62_prime256v1;
else
- nid = NID_X9_62_prime256v1;
+ nid = NID_tor_default_ecdhe_group;
/* Use P-256 for ECDHE. */
ec_key = EC_KEY_new_by_curve_name(nid);
if (ec_key != NULL) /*XXXX Handle errors? */