aboutsummaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2015-09-08Handle negative inputs to crypto_random_time_range().Nick Mathewson
(These inputs are possible when Shadow starts the world at time_t 0, and breaks our assumption that Tor didn't exist in the 1970s.) Fixes regression introduced in 241e6b09. Fixes #16980.
2015-08-21Fix a bunch of check-spaces complaintsSebastian Hahn
2015-08-21Ensure worker threads actually exit when it is timeSebastian Hahn
This includes a small refactoring to use a new enum (workqueue_reply_t) for the return values instead of just ints.
2015-08-18Merge branch 'decouple_controller_events_squashed'Nick Mathewson
2015-08-18Log meaningful messages before failing on windows with threadlocal.Nick Mathewson
2015-08-18Improve threadlocal documentationNick Mathewson
2015-08-18Add comments for thread-local storage functionsNick Mathewson
2015-08-18Use thread-local storage to block event_queue recursion.Nick Mathewson
2015-08-17Merge remote-tracking branch 'public/bug16741_026'Nick Mathewson
2015-08-17Merge remote-tracking branch 'yawning/feature16533'Nick Mathewson
2015-08-13Fix some types on container fnsNick Mathewson
2015-08-12Use ed25519-donna's batch verification support when applicable.Yawning Angel
The code was always in our Ed25519 wrappers, so enable it when using the ed25519-donna backend, and deal with the mocking related crypto_rand silliness. Implements feature 16533.
2015-08-12Add crypto_rand_unmocked, which is crypto_rand without mocking.Yawning Angel
There is odd issues with calling crypto_rand from our copy of ed25519-donna, due to mocking that are not easily resolved.
2015-08-11Merge branch 'bug16389_027_03_squashed'Nick Mathewson
2015-08-11Fix typo in comment about digest256map_tDavid Goulet
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-11Fix windows compilationNick Mathewson
2015-08-10Merge remote-tracking branch 'public/feature16734'Nick Mathewson
2015-08-07Check for EINTR correctly on windowsNick Mathewson
(even though these are nonblocking calls and EINTR shouldn't be possible). Also, log what error we're seing if drain_fn fails.
2015-08-05Add a compat function to check how much disk space is free.Nick Mathewson
Closes ticket 16734.
2015-08-05Set the open file limit to the current value before changing itDavid Goulet
If setrlimit() failed, max_out wasn't set in set_max_file_descriptors() ending in a state where we don't use ULIMIT_BUFFER for things like tor private key files. Also fix the set_max_file_descriptors() documentation. Fixes #16274 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-08-04Switch order of unblocking threads and releasing the mutex.cypherpunks
According to POSIX, the mutex must be locked by the thread calling the signal functions to ensure predictable scheduling behavior. Found the issue using Helgrind which gave the warning `dubious: associated lock is not held by any thread`.
2015-07-31Move formatting functions around.Nick Mathewson
The base64 and base32 functions used to be in crypto.c; crypto_format.h had no header; some general-purpose functions were in crypto_curve25519.c. This patch makes a {crypto,util}_format.[ch], and puts more functions there. Small modules are beautiful!
2015-07-30Add get_max_sockets() and remove dead codeDavid Goulet
The control port was using set_max_file_descriptors() with a limit set to 0 to query the number of maximum socket Tor can use. With the recent changes to that function, a check was introduced to make sure a user can not set a value below the amount we reserved for non socket. This commit adds get_max_sockets() that returns the value of max_sockets so we can stop using that "setter" function to get the current value. Finally, the dead code is removed that is the code that checked for limit equal to 0. From now on, set_max_file_descriptors() should never be used with a limit set to 0 for a valid use case. Fixes #16697 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2015-07-30Wrap windows-only C files in #ifdef _WIN32Nick Mathewson
This should make some scripts and IDEs happier.
2015-07-27Allow a single trailing `.` when validating FQDNs from SOCKS.Yawning Angel
URI syntax (and DNS syntax) allows for a single trailing `.` to explicitly distinguish between a relative and absolute (fully-qualified) domain name. While this is redundant in that RFC 1928 DOMAINNAME addresses are *always* fully-qualified, certain clients blindly pass the trailing `.` along in the request. Fixes bug 16674; bugfix on 0.2.6.2-alpha.
2015-07-23Fix a couple more msvc issues, reported by gisle vanemNick Mathewson
2015-07-22Merge branch 'ticket2325_squashed'Nick Mathewson
2015-07-21Fix some potential memory leaks in the thread pool code.cypherpunks
2015-07-20Document the torrc format as thoroughly as possibleNick Mathewson
Closes ticket 2325
2015-07-16Fix most check-spaces issuesNick Mathewson
2015-07-15Use C99 variadic macros when not on GCC.Nick Mathewson
1) We already require C99. 2) This allows us to support MSVC again (thanks to Gisle Vanem for this part) 3) This change allows us to dump some rotten old compatibility code from log.c
2015-07-15Add more EINVAL errno setting on key read failuresNick Mathewson
Teor found these. This is for part of #16582.
2015-07-14Make file-reading and key-reading preserve errnoNick Mathewson
This is an important part of #16582.
2015-07-12Okay, this time it was my faultNick Mathewson
2015-07-12Fine, mingw! fine! are you happy now??Nick Mathewson
2015-07-12This should be the last SecureZeroMemory fixNick Mathewson
2015-07-12Dammit, autoconf!Nick Mathewson
2015-07-12Nth time is maybe the charm for fixing windows readpassword build errorsNick Mathewson
2015-07-11note some dead code in set_max_file_descriptorsNick Mathewson
2015-07-10Try one more one more time to get tor-ci-windows workingNick Mathewson
Apparently its mingw headers are missing some stuff.
2015-07-10Attempt yet again to make the tor-ci-windows builder happyNick Mathewson
2015-07-09Merge remote-tracking branch 'yawning/feature16467_9663'Nick Mathewson
2015-07-08Always use the sandbox in tor_open_cloexecteor
Use the sandbox in tor_open_cloexec, whether or not O_CLOEXEC is defined. Patch by "teor". Fix on 0.2.3.1-alpha.
2015-07-06Integrate and enable ed25519-donna.Yawning Angel
The runtime sanity checking is slightly different from the optimized basepoint stuff in that it uses a given implementation's self tests if available, and checks if signing/verification works with a test vector from the IETF EdDSA draft. The unit tests include a new testcase that will fuzz donna against ref0, including the blinding and curve25519 key conversion routines. If this is something that should be done at runtime (No?), the code can be stolen from there. Note: Integrating batch verification is not done yet.
2015-07-06Integrate the accelerated Curve25519 scalar basemult.Yawning Angel
Integration work scavanged from nickm's `ticket8897_9663_v2` branch, with minor modifications. Tor will still sanity check the output but now also attempts to catch extreme breakage by spot checking the optimized implementation vs known values from the NaCl documentation. Implements feature 9663.
2015-07-06Integrate ed25519-donna (Not yet used).Yawning Angel
Integrate ed25519-donna into the build process, and provide an interface that matches the `ref10` code. Apart from the blinding and Curve25519 key conversion, this functions as a drop-in replacement for ref10 (verified by modifying crypto_ed25519.c). Tests pass, and the benchmarks claim it is quite a bit faster, however actually using the code requires additional integration work.
2015-06-29Try a little harder to fix the tor-ci-windows builder, or figure out why it ↵Nick Mathewson
is broke
2015-06-29More tweaks for windows compilation. (ick)Nick Mathewson
2015-06-29Remove checks for visual C 6.Nick Mathewson
2015-06-27Fix some compilation issues.Nick Mathewson