- Feb 19, 2019
-
-
Nick Mathewson authored
The subsystems API makes this really simple, fortunately. Closes ticket 29536
-
- Feb 14, 2019
-
-
Nick Mathewson authored
This module is currently implemented to use the same technique as libottery (later used by the bsds' arc4random replacement), using AES-CTR-256 as its underlying stream cipher. It's backtracking- resistant immediately after each call, and prediction-resistant after a while. Here's how it works: We generate psuedorandom bytes using AES-CTR-256. We generate BUFLEN bytes at a time. When we do this, we keep the first SEED_LEN bytes as the key and the IV for our next invocation of AES_CTR, and yield the remaining BUFLEN - SEED_LEN bytes to the user as they invoke the PRNG. As we yield bytes to the user, we clear them from the buffer. Every RESEED_AFTER times we refill the buffer, we mix in an additional SEED_LEN bytes from our strong PRNG into the seed. If the user ever asks for a huge number of bytes at once, we pull SEED_LEN bytes from the PRNG and use them with our stream cipher to fill the user's request.
-
Nick Mathewson authored
This is the second part of refactoring the random-int-in-range code.
-
- Feb 08, 2019
-
-
Nick Mathewson authored
Closes ticket 29026; patch from Mangix.
-
Nick Mathewson authored
Patch from Mangix. Closes part of ticket 29026.
-
- Feb 07, 2019
-
-
Nick Mathewson authored
Some of the code for getting a random value within a range wants to be shared between crypto_rand() and the new crypto_fast_rng() code.
-
Nick Mathewson authored
I don't know how this got here, but this kind of a wrapper only belongs in a header file.
-
Nick Mathewson authored
Using an anonymous mmap() is a good way to get pages that we can set kernel-level flags on, like minherit() or madvise() or mlock(). We're going to use that so that we can make uninheritable locked pages to store PRNG data.
-
- Jan 23, 2019
-
-
Nick Mathewson authored
These are ones that happen on windows only. Fixes bug 29161.
-
- Jan 22, 2019
-
-
Peter Gerber authored
SO_ACCEPTCONN checks whether socket listening is enabled and is used ever since 9369152a has been merged. Closes ticket #29150
-
- Jan 16, 2019
-
-
This fixes a typo and also notes that HW_PHYSMEM64 is defined on NetBSD (not just OpenBSD). Signed-off-by:
Kris Katterjohn <katterjohn@gmail.com>
-
The code checked for sysctl being available and HW_PHYSMEM being defined, but HW_USERMEM was actually being used with sysctl instead of HW_PHYSMEM. The case for OpenBSD, etc. use HW_PHYSMEM64 (which is obviously a 64-bit variant of HW_PHYSMEM) and the case for OSX uses HW_MEMSIZE (which appears to be a 64-bit variant of HW_PHYSMEM). Signed-off-by:
Kris Katterjohn <katterjohn@gmail.com>
-
Nick Mathewson authored
We log these messages at INFO level, except when we are reading a private key from a file, in which case we log at WARN. This fixes a regression from when we re-wrote our PEM code to be generic between nss and openssl. Fixes bug 29042, bugfix on 0.3.5.1-alpha.
-
Nick Mathewson authored
-
Nick Mathewson authored
-
- Jan 11, 2019
-
-
When cleaning up after an error in process_unix_exec, the stdin pipe was being double closed instead of closing both the stdin and stdout pipes. This occurred in two places. Signed-off-by:
Kris Katterjohn <katterjohn@gmail.com>
-
Nick Mathewson authored
-
Taylor R Campbell authored
NOTE: This commit breaks the build, because there was a mistake in an earlier change of exactly the sort that this is meant to detect! I'm leaving it broken for illustration.
-
Taylor R Campbell authored
-
Taylor R Campbell authored
Test exactly what the geometric sampler returns, because that's what the downstream callers of it are going to use. While here, also assert that the geometric sampler returns a positive integer. (Our geometric distribution is the one suported on {1, 2, 3, ...} that returns the number of trials before the first success, not the one supported on {0, 1, 2, ...} that returns the number of failures before the first success.)
-
- Jan 10, 2019
-
- Jan 09, 2019
-
-
Prior to this commit, the testsuite was failing on OpenBSD. After this commit the testsuite runs fine on OpenBSD. It was previously decided to test for the OpenBSD macro (rather than __OpenBSD__, etc.) because OpenBSD forks seem to have the former macro defined. sys/param.h must be included for the OpenBSD macro definition; however, many files tested for the OpenBSD macro without having this header included. This commit includes sys/param.h in the files where the OpenBSD macro is used (and sys/param.h is not already included), and it also changes some instances of the __OpenBSD__ macro to OpenBSD. See commit 27df23ab which changed everything to use OpenBSD instead of __OpenBSD__ or OPENBSD. See also tickets #6982 and #20980 (the latter ticket is where it was decided to use the OpenBSD macro). Signed-off-by:
Kris Katterjohn <katterjohn@gmail.com>
-
- Jan 08, 2019
-
-
teor authored
Add some details about IP family support, and point to tor_socketpair() from tor_ersatz_socketpair(). Closes ticket 29015.
-
- Jan 07, 2019
-
-
Kris Katterjohn authored
In get_local_listener used by tor_ersatz_socketpair, the address family used when binding the IPv6 socket was AF_INET instead of AF_INET6. Fixes bug 28995; bugfix on 0.3.5.1-alpha. Signed-off-by:
Kris Katterjohn <katterjohn@gmail.com>
-
- Jan 03, 2019
-
-
Nick Mathewson authored
Reported on tor-dev by Gisle Vanem. Bug not in any released Tor (The suggested patch used _MSC_VER, but that's not how we do stuff with autoconf. With autoconf, you detect the feature you want, rather than trying to list all the systems that do or do not have it.)
-
Nick Mathewson authored
Closes ticket 28851.
-
- Jan 02, 2019
-
-
Nick Mathewson authored
-
George Kadianakis authored
Co-authored-by:
Mike Perry <mikeperry-git@torproject.org>
-
George Kadianakis authored
This project introduces the prob_distr.c subsystem which implements all the probability distributions that WTF-PAD needs. It also adds unittests for all of them. Code and tests courtesy of Riastradh. Co-authored-by:
Taylor R Campbell <campbell+tor@mumble.net> Co-authored-by:
Mike Perry <mikeperry-git@torproject.org>
-
George Kadianakis authored
Co-authored-by:
George Kadianakis <desnacked@riseup.net>
-
Mike Perry authored
We need this for padding negotiation so that we can have later machine revisions supercede earlier ones. Co-authored-by:
George Kadianakis <desnacked@riseup.net>
-
- Dec 21, 2018
-
-
Nick Mathewson authored
-
-
This patch makes the process module use the subsystem list for initializing and shutting down. See: https://bugs.torproject.org/28847
-
Taylor Yu authored
Part of ticket 27167.
-
- Dec 20, 2018
-
-
Alexander Hansen Færøy authored
This allows other libraries to include process.h without including the smartlist_t headers first. See: https://bugs.torproject.org/28847
-
Alexander Hansen Færøy authored
Let's not use log_warn() when a pipe is closed under what should be considered normal conditions. See: https://bugs.torproject.org/28179
-
Alexander Hansen Færøy authored
This patch changes the CancelIoEx() example code to use CancelIo(), which is available for older versions of Windows too. I still think the kernel handles this nicely by sending broken pipes if either side closes the pipe while I/O operations are pending. See: https://bugs.torproject.org/28179
-
Alexander Hansen Færøy authored
Handle `ERROR_BROKEN_PIPE` from ReadFileEx() and WriteFileEx() in process_win32_stdin_write_done() and process_win32_handle_read_completion() instead of in the early handler. This most importantmly makes sure that `reached_eof` is set to true when these errors appears. See: https://bugs.torproject.org/28179
-
Alexander Hansen Færøy authored
This patch adds some missing calls to set `reached_eof` of our handles when various error conditions happens or when we close our handle (which happens at `process_terminate()`. See: https://bugs.torproject.org/28179
-