diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-12-18 10:04:01 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-12-18 10:04:01 -0500 |
commit | 9e2c4ee557a499a0fa6b12f5912cef4fccc46e5a (patch) | |
tree | f080f2d038cad92709b969f53b47f80d4a53fd1b /src/common/tortls.c | |
parent | 4604b3ab197af5f6d0d407bd2dbe4b0d6a14e22b (diff) | |
download | tor-9e2c4ee557a499a0fa6b12f5912cef4fccc46e5a.tar.gz tor-9e2c4ee557a499a0fa6b12f5912cef4fccc46e5a.zip |
Fix some dead code in tortls.c
If SSL_CIPHER_find exists, then we won't use either of the two
kludges that would replace it.
Found by Coverity; fixes CID 1340256.
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index b1d3f6f9e8..a1facec409 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -1322,7 +1322,8 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher) tor_assert((SSL_CIPHER_get_id(c) & 0xffff) == cipher); return c != NULL; } -#elif defined(HAVE_STRUCT_SSL_METHOD_ST_GET_CIPHER_BY_CHAR) +#else +#if defined(HAVE_STRUCT_SSL_METHOD_ST_GET_CIPHER_BY_CHAR) if (m && m->get_cipher_by_char) { unsigned char cipherid[3]; set_uint16(cipherid, htons(cipher)); @@ -1333,7 +1334,7 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher) if (c) tor_assert((c->id & 0xffff) == cipher); return c != NULL; - } else + } #endif #if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,1,0) if (m && m->get_cipher && m->num_ciphers) { @@ -1351,6 +1352,7 @@ find_cipher_by_id(const SSL *ssl, const SSL_METHOD *m, uint16_t cipher) return 0; } #endif +#endif (void) ssl; (void) m; (void) cipher; |