summaryrefslogtreecommitdiff
path: root/src/common/tortls.c
AgeCommit message (Collapse)Author
2015-02-02Merge remote-tracking branch 'public/bug13319'Nick Mathewson
2015-01-28Try to work around changes in openssl 1.1.0Nick Mathewson
Prefer not to use a couple of deprecated functions; include more headers in tortls.c This is part of ticket 14188.
2015-01-10Fix tortls.c build with GCC<4.6Nick Mathewson
apparantly, "pragma GCC diagnostic push/pop" don't exist with older versions. Fixes bug in 740e592790f570c446cbb5e6d4a77f842f75; bug not in any released Tor.
2015-01-10Ignore warning for redundant decl in openssl/srtp.hNick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-11-02Check more thoroughly for unlogged OpenSSL errorsNick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-20Use a macro to indicate "The ecdhe group we use by default".Nick Mathewson
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
2014-10-16Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-10-16Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5Nick Mathewson
2014-10-16Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
2014-10-15Disable SSLv3 unconditionally. Closes ticket 13426.Nick Mathewson
The POODLE attack doesn't affect Tor, but there's no reason to tempt fate: SSLv3 isn't going to get any better.
2014-10-03Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-10-03Merge remote-tracking branch 'public/bug13325_024' into maint-0.2.5Nick Mathewson
2014-10-03Run correctly on OpenBSD systems without SSL_METHOD.get_cipher_by_charNick Mathewson
Also, make sure we will compile correctly on systems where they finally rip it out. Fixes issue #13325. Caused by this openbsd commit: ​http://marc.info/?l=openbsd-cvs&m=140768179627976&w=2 Reported by Fredzupy.
2014-08-24Use the ARRAY_LENGTH macro more consistently.Nick Mathewson
2014-08-21Make the two branches of tor_tls_used_v1_handshake into one.Nick Mathewson
(Coverity thinks that "if (a) X; else X;" is probably a bug.) [Coverity CID 1232086]
2014-07-24Avoid illegal read off end of an array in prune_v2_cipher_listNick Mathewson
This function is supposed to construct a list of all the ciphers in the "v2 link protocol cipher list" that are supported by Tor's openssl. It does this by invoking ssl23_get_cipher_by_char on each two-byte ciphersuite ID to see which ones give a match. But when ssl23_get_cipher_by_char cannot find a match for a two-byte SSL3/TLS ciphersuite ID, it checks to see whether it has a match for a three-byte SSL2 ciphersuite ID. This was causing a read off the end of the 'cipherid' array. This was probably harmless in practice, but we shouldn't be having any uninitialized reads. (Using ssl23_get_cipher_by_char in this way is a kludge, but then again the entire existence of the v2 link protocol is kind of a kludge. Once Tor 0.2.2 clients are all gone, we can drop this code entirely.) Found by starlight. Fix on 0.2.4.8-alpha. Fixes bug 12227.
2014-07-17Merge remote-tracking branch 'origin/maint-0.2.5'Nick Mathewson
2014-07-17Merge remote-tracking branch 'public/bug12602_024' into maint-0.2.5Nick Mathewson
2014-07-17Fix compilation with no-compression OpenSSL builds and forksNick Mathewson
Found because LibreSSL has OPENSSL_NO_COMP always-on, but this conflicts with the way that _we_ turn off compression. Patch from dhill, who attributes it to "OpenBSD". Fixes bug 12602; bugfix on 0.2.1.1-alpha, which introduced this turn-compression-off code.
2014-06-20Remove code for Windows CE supportNick Mathewson
As far as I know, nobody has used this in ages. It would be a pretty big surprise if it had worked. Closes ticket 11446.
2014-06-10Merge remote-tracking branch 'public/bug12227_024'Nick Mathewson
2014-06-10Avoid illegal read off end of an array in prune_v2_cipher_listNick Mathewson
This function is supposed to construct a list of all the ciphers in the "v2 link protocol cipher list" that are supported by Tor's openssl. It does this by invoking ssl23_get_cipher_by_char on each two-byte ciphersuite ID to see which ones give a match. But when ssl23_get_cipher_by_char cannot find a match for a two-byte SSL3/TLS ciphersuite ID, it checks to see whether it has a match for a three-byte SSL2 ciphersuite ID. This was causing a read off the end of the 'cipherid' array. This was probably harmless in practice, but we shouldn't be having any uninitialized reads. (Using ssl23_get_cipher_by_char in this way is a kludge, but then again the entire existence of the v2 link protocol is kind of a kludge. Once Tor 0.2.2 clients are all gone, we can drop this code entirely.) Found by starlight. Fix on 0.2.4.8-alpha. Fixes bug 12227.
2014-05-07Merge remote-tracking branch 'public/ticket11528_024' into maint-0.2.4Nick Mathewson
2014-04-17Merge remote-tracking branch 'public/ticket11528_024'Nick Mathewson
2014-04-17Elevate server TLS cipher preferences over clientNick Mathewson
The server cipher list is (thanks to #11513) chosen systematically to put the best choices for Tor first. The client cipher list is chosen to resemble a browser. So let's set SSL_OP_CIPHER_SERVER_PREFERENCE to have the servers pick according to their own preference order.
2014-04-15Uplift status.c unit test coverage with new test cases and macros.dana koch
A new set of unit test cases are provided, as well as introducing an alternative paradigm and macros to support it. Primarily, each test case is given its own namespace, in order to isolate tests from each other. We do this by in the usual fashion, by appending module and submodule names to our symbols. New macros assist by reducing friction for this and other tasks, like overriding a function in the global namespace with one in the current namespace, or declaring integer variables to assist tracking how many times a mock has been called. A set of tests for a small-scale module has been included in this commit, in order to highlight how the paradigm can be used. This suite gives 100% coverage to status.c in test execution.
2014-04-15Merge remote-tracking branch 'public/bug11513_024'Nick Mathewson
2014-04-14New sort order for server choice of ciphersuites.Nick Mathewson
Back in 175b2678, we allowed servers to recognize clients who are telling them the truth about their ciphersuites, and select the best cipher from on that list. This implemented the server side of proposal 198. In bugs 11492, 11498, and 11499, cypherpunks found a bunch of mistakes and omissions and typos in the UNRESTRICTED_SERVER_CIPHER_LIST we had. In #11513, I found a couple more. Rather than try to hand-edit this list, I wrote a short python script to generate our ciphersuite preferences from the openssl headers. The new rules are: * Require forward secrecy. * Require RSA (since our servers only configure RSA keys) * Require AES or 3DES. (This means, reject RC4, DES, SEED, CAMELLIA, and NULL.) * No export ciphersuites. Then: * Prefer AES to 3DES. * If both suites have the same cipher, prefer ECDHE to DHE. * If both suites have the same DHE group type, prefer GCM to CBC. * If both suites have the same cipher mode, prefer SHA384 to SHA256 to SHA1. * If both suites have the same digest, prefer AES256 to AES128.
2014-03-31Merge branch 'bug8787_squashed'Nick Mathewson
2014-03-31Check strftime() return in tortls.cAndrea Shepard
2014-03-25Fix warnings from doxygenNick Mathewson
Most of these are simple. The only nontrivial part is that our pattern for using ENUM_BF was confusing doxygen by making declarations that didn't look like declarations.
2014-02-06Some anti-forensics paranoia...Florent Daigniere
sed -i 's/BN_free/BN_clear_free/g'
2014-02-03Some anti-forensics paranoia...Florent Daigniere
sed -i 's/BN_free/BN_clear_free/g'
2013-11-25Restore prop198 behavior from 4677 patchNick Mathewson
The previous commit from piet would have backed out some of proposal 198 and made servers built without the V2 handshake not use the unrestricted cipher list from prop198. Bug not in any released Tor.
2013-11-25Restore ability to build with V2_HANDSHAKE_SERVERNick Mathewson
Fixes bug 4677; bugfix on 0.2.3.2-alpha. Fix by "piet".
2013-10-31Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson
2013-10-31Merge remote-tracking branch 'public/bug9780_024_v2' into maint-0.2.4Nick Mathewson
2013-10-08Switch ECDHE group default logic for bridge/relay TLSNick Mathewson
According to the manpage, bridges use P256 for conformity and relays use P224 for speed. But skruffy points out that we've gotten it backwards in the code. In this patch, we make the default P256 for everybody. Fixes bug 9780; bugfix on 0.2.4.8-alpha.
2013-09-25Merge remote-tracking branch 'public/bug6055_v2_024'Nick Mathewson
2013-09-25Re-enable TLS 1.[12] when building with OpenSSL >= 1.0.1eNick Mathewson
To fix #6033, we disabled TLS 1.1 and 1.2. Eventually, OpenSSL fixed the bug behind #6033. I've considered alternate implementations that do more testing to see if there's secretly an OpenSSL 1.0.1c or something that secretly has a backport of the OpenSSL 1.0.1e fix, and decided against it on the grounds of complexity.
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-06-12Fix #9043 - simplyfy the code and use EVP_PKEY_cmp instead of pkey_eq / ↵Marek Majkowski
tor_tls_evp_pkey_eq
2013-06-10Bug #5170 - make pkey_eq testable, introduce test_tortls.cMarek Majkowski
2013-06-06Bug 5170 - simplify i2d_PublicKey in pkey_eqMarek Majkowski
2013-06-06Bug #5170 - simplify i2d_X509Marek Majkowski
2013-03-11Track TLS overhead: diagnostic for bug 7707Nick Mathewson
2013-03-10start part-way through the ssl cert lifetimeRoger Dingledine
also, snap the start time and end time to a day boundary, since most certs in the wild seem to do this.
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;