summaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2012-11-08Turn a memwipe in tor_process_handle_destroy() back to memsetNick Mathewson
It broke linking on tor-resolve.c, and it's not actually sanitizing anything sensitive. Fix for bug 7420; bug not on ony released Tor.
2012-11-08Add and use and unlikely-to-be-eliminated memwipe()Nick Mathewson
Apparently some compilers like to eliminate memset() operations on data that's about to go out-of-scope. I've gone with the safest possible replacement, which might be a bit slow. I don't think this is critical path in any way that will affect performance, but if it is, we can work on that in 0.2.4. Fixes bug 7352.
2012-10-23Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3Nick Mathewson
2012-10-23Fix binary search on lists of 0 or 1 element.Nick Mathewson
The implementation we added has a tendency to crash with lists of 0 or one element. That can happen if we get a consensus vote, v2 consensus, consensus, or geoip file with 0 or 1 element. There's a DOS opportunity there that authorities could exploit against one another, and which an evil v2 authority could exploit against anything downloading v2 directory information.. This fix is minimalistic: It just adds a special-case for 0- and 1-element lists. For 0.2.4 (the current alpha series) we'll want a better patch. This is bug 7191; it's a fix on 0.2.0.10-alpha.
2012-10-19Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3Nick Mathewson
2012-10-19Disable TLS Session Tickets, which we were apparently getting for freeNick Mathewson
OpenSSL 1.0.0 added an implementation of TLS session tickets, a "feature" that let session resumption occur without server-side state by giving clients an encrypted "ticket" that the client could present later to get the session going again with the same keys as before. OpenSSL was giving the keys to decrypt these tickets the lifetime of the SSL contexts, which would have been terrible for PFS if we had long-lived SSL contexts. Fortunately, we don't. Still, it's pretty bad. We should also drop these, since our use of the extension stands out with our non-use of session cacheing. Found by nextgens. Bugfix on all versions of Tor when built with openssl 1.0.0 or later. Fixes bug 7139.
2012-09-14Use file-size-fixup code on cygwin too.Nick Mathewson
We already had code on windows to fix our file sizes when we're reading a file in text mode and its size doesn't match the size from fstat. But that code was only enabled when _WIN32 was defined, and Cygwin defines __CYGWIN__ instead. Fixes bug 6844; bugfix on 0.1.2.7-alpha.
2012-09-11Merge remote-tracking branch 'origin/maint-0.2.2' into maint-0.2.3Nick Mathewson
Conflicts: src/test/test_util.c
2012-09-11Fix assertion failure in tor_timegm.Nick Mathewson
Fixes bug 6811.
2012-08-17Fix more warnings from openbsd_mallocNick Mathewson
Apparently, (void)writev is not enough to suppress the "you are ignoring the return value!" warnings on Linux. Instead, remove the whole warning/error logic when compiling openbsd_malloc for Tor: we can't use it.
2012-08-15Fix warnings and 64-bit problems in openbsd-malloc codeNick Mathewson
The warning fixes are: - Only define issetugid if it's missing. - Explicitly ignore the return value of writev. - Explicitly cast the retval of readlink() to int. The 64-bit problems are related to just storing a size_t in an int. Not cool! Use a size_t instead. Fix for bug 6379. Bugfix on 0.2.0.20-rc, which introduced openbsd-malloc.
2012-07-18Tweaks to 6400 changes file and docs as suggested by armaNick Mathewson
2012-07-17Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/ENDNick Mathewson
The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when you have a nice short loop body, but using it for long bodies makes your preprocessor tell the compiler that all the code is on the same line. That causes grief, since compiler warnings and debugger lines will all refer to that one line. So, here's a new style rule: SMARTLIST_FOREACH blocks need to be short.
2012-07-06Fix port range in parse_port_range().George Kadianakis
2012-07-05On windows, ENOBUFS starts with WSA. #6296. Fix on 0.2.18-rcNick Mathewson
2012-06-28add a blurb for 0.2.3.18-rc, other minor cleanupsRoger Dingledine
2012-06-26Fix a warning when using glibc's strcspn with clang.Nick Mathewson
With glibc 2.15 and clang 3.0, I get warnings from where we use the strcpsn implementation in the header as strcspn(string, "="). This is apparently because clang sees that part of the strcspn macro expands to "="[2], and doesn't realize that that part of the macro is only evaluated when "="[1] != 0.
2012-06-26Fix a compilation warning with clang 3.0Nick Mathewson
In b1ad1a1d0266a20bb we introduced an implicit (but safe) long-to-int shortening that clang didn't like. Warning not in any released version of Tor.
2012-06-23Don't assert in get_string_from_pipe() on len==0Nick Mathewson
We can treat this case as an EAGAIN (probably because of an unexpected internal NUL) rather than a crash-worthy problem. Fixes bug 6225, again. Bug not in any released version of Tor.
2012-06-23Resolve crash caused by format_helper_exit_status changes in #5557Nick Mathewson
Because the string output was no longer equal in length to HEX_ERRNO_SIZE, the write() call would add some extra spaces and maybe a NUL, and the NUL would trigger an assert in get_string_from_pipe. Fixes bug 6225; bug not in any released version of Tor.
2012-06-22Style tweaks and add a warning about NUL-terminationNick Mathewson
2012-06-22Refactor unsigned int hex formatting out of format_helper_exit_status() in ↵Andrea Shepard
util.c
2012-06-22Make format_helper_exit_status() avoid unnecessary spacesAndrea Shepard
2012-06-15fix a compiler warning added in one of my XXX023 fixes.Nick Mathewson
2012-06-15Whitespace fixNick Mathewson
2012-06-15Move tor_gettimeofday_cached() into compat_libeventNick Mathewson
2012-06-15Refactor GETINFO process/descriptor-limitNick Mathewson
Previously it duplicated some getrlimit code and content from compat.c; now it doesn't.
2012-06-15Triage the XXX023 and XXX022 comments: postpone many.Nick Mathewson
2012-06-13Change smartlist_create->smartlist_new in bug4744 branch as merged to masterNick Mathewson
2012-06-13Merge branch 'bug4744_squashed'Nick Mathewson
2012-06-13Implement the client side of proposal 198Nick Mathewson
This is a feature removal: we no longer fake any ciphersuite other than the not-really-standard SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA (0xfeff). This change will let servers rely on our actually supporting what we claim to support, and thereby let Tor migrate to better TLS ciphersuites. As a drawback, Tor instances that use old openssl versions and openssl builds with ciphers disabled will no longer give the "firefox" cipher list.
2012-06-13Fix another clang compile warningSebastian Hahn
We forgot this when we fixed 5969.
2012-06-11Merge remote-tracking branch 'public/bug4592'Nick Mathewson
2012-06-11Merge branch 'bug6097'Nick Mathewson
2012-06-07typo noticed by "_raptor"Roger Dingledine
2012-06-07Fix mingw build with -DUNICODE -D_UNICODENick Mathewson
This is a very blunt fix, and mostly just turns some func() calls into FuncA() to make things build again. Fixes bug 6097.
2012-06-07Be more careful calling wcstombsNick Mathewson
The function is not guaranteed to NUL-terminate its output. It *is*, however, guaranteed not to generate more than two bytes per multibyte character (plus terminating nul), so the general approach I'm taking is to try to allocate enough space, AND to manually add a NUL at the end of each buffer just in case I screwed up the "enough space" thing. Fixes bug 5909.
2012-06-05Merge remote-tracking branch 'public/getfilesize_64'Nick Mathewson
Conflicts: src/common/compat.c The getfilesize change conflicted with the removal of file_handle from the windows tor_mmap_t.
2012-06-05Fix some mingw build warningsNick Mathewson
These include: - Having a weird in_addr that can't be initialized with {0} - Needing INVALID_HANDLE_VALUE instead of -1 for file handles. - Having a weird dependent definition for struct stat. - pid is signed, not unsigned.
2012-06-05Merge remote-tracking branch 'public/bug3894'Nick Mathewson
2012-06-05Fix "make check-spaces" issuesNick Mathewson
2012-06-05Resolve about 24 DOCDOCsNick Mathewson
2012-06-04Missing copyright/license statement for procmon.cNick Mathewson
2012-06-04Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson
2012-06-04Add about 60 more DOCDOC comments to 0.2.3Nick Mathewson
Also, try to resolve some doxygen issues. First, define a magic "This is doxygen!" macro so that we take the correct branch in various #if/#else/#endifs in order to get the right documentation. Second, add in a few grouping @{ and @} entries in order to get some variables and fields to get grouped together.
2012-06-04Resolve some markup complaints from doxygenNick Mathewson
2012-06-04Resolve all currently pending DOCDOC items in masterNick Mathewson
2012-06-04Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2012-06-04Merge remote-tracking branch 'public/bug6033' into maint-0.2.2Nick Mathewson
2012-06-02Work around a bug in OpenSSL 1.0.1's TLS 1.1 and TLS 1.2 supportNick Mathewson
It appears that when OpenSSL negotiates a 1.1 or 1.2 connection, and it decides to renegotiate, the client will send a record with version "1.0" rather than with the current TLS version. This would cause the connection to fail whenever both sides had OpenSSL 1.0.1, and the v2 Tor handshake was in use. As a workaround, disable TLS 1.1 and TLS 1.2. When a later version of OpenSSL is released, we can make this conditional on running a fixed version of OpenSSL. Alternatively, we could disable TLS 1.1 and TLS 1.2 only on the client side. But doing it this way for now means that we not only fix TLS with patched clients; we also fix TLS when the server has this patch and the client does not. That could be important to keep the network running well. Fixes bug 6033.