Age | Commit message (Collapse) | Author |
|
|
|
We could use one of these for holding "junk" descriptors and
unparseable things -- but we'll _need_ it for having cached
consensuses and diffs between them.
|
|
|
|
Previously, we operated on smartlists of NUL-terminated strings,
which required us to copy both inputs to produce the NUL-terminated
strings. Then we copied parts of _those_ inputs to produce an
output smartlist of NUL-terminated strings. And finally, we
concatenated everything into a final resulting string.
This implementation, instead, uses a pointer-and-extent pattern to
represent each line as a pointer into the original inputs and a
length. These line objects are then added by reference into the
output. No actual bytes are copied from the original strings until
we finally concatenate the final result together.
Bookkeeping structures and newly allocated strings (like ed
commands) are allocated inside a memarea, to avoid needless mallocs
or complicated should-I-free-this-or-not bookkeeping.
In my measurements, this improves CPU performance by something like
18%. The memory savings should be much, much higher.
|
|
This takes two fuzzers: one which generates a diff and makes sure it
works, and one which applies a diff.
So far, they won't crash, but there's a bug in my
string-manipulation code someplace that I'm having to work around,
related to the case where you have a blank line at the end of a
file, or where you diff a file with itself.
|
|
Don't alias the insides of smartlist_t; that way lies madness.
|
|
This is a protocol update from recent prop140 changes.
Also, per #21673, we need to check the entire document, including
signatures.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Previously test_consdiff.c just did #include "consdiff.c", which is
not great style, and messes up coverage testing.
|
|
(This commit was extracted by nickm based on the final outcome of
the project, taking only the changes in the files touched by this
commit from the consdiff_rebased branch. The directory-system
changes are going to get worked on separately.)
|
|
|
|
Nothing big: just some const char[]s that should have been static,
and some integer truncation warnings.
Warnings not in any released Tor.
|
|
|
|
People felt it could refer to the descriptor header section instead of
the plaintext of the superencrypted section.
|
|
|
|
- HS descriptors are now bigger than 10kb.
- encrypted_data_length_is_valid() is not that strict now.
|
|
This patch removes the `tor_fgets()` wrapper around `fgets(3)` since it
is no longer needed. The function was created due to inconsistency
between the returned values of `fgets(3)` on different versions of Unix
when using `fgets(3)` on non-blocking file descriptors, but with the
recent changes in bug #21654 we switch from unbuffered to direct I/O on
non-blocking file descriptors in our utility module.
We continue to use `fgets(3)` directly in the geoip and dirserv module
since this usage is considered safe.
This patch also removes the test-case that was created to detect
differences in the implementation of `fgets(3)` as well as the changes
file since these changes was not included in any releases yet.
See: https://bugs.torproject.org/21654
|
|
This patch adds a test case for the get_string_from_pipe() function
found in the utility module.
See: See: https://bugs.torproject.org/21654
|
|
This patch removes the buffered I/O stream usage in process_handle_t and
its related utility functions. This simplifies the code and avoids racy
code where we used buffered I/O on non-blocking file descriptors.
See: https://bugs.torproject.org/21654
|
|
|
|
|
|
This patch resets `buf` in test_util_fgets_eagain() after each succesful
ivocation to avoid stray artifacts left in the buffer by erroneous
tor_fgets() calls.
|
|
This patch changes our use of fgets() to tor_fgets() for more consistent
error handling across different versions of the C library.
|
|
|
|
Previously, this only worked on systems which had bash installed, due to
some bash-specific code in the script.
Fixes bug 19699; follow-up to 21581.
|
|
Apparently some unixes don't like this.
Part of #21581.
|
|
Apparently some unixes don't like this.
Part of #21581.
|
|
|
|
(But use bash if it's available.)
This is a workaround until we remove bash-specific code in 19699.
Fixes bug 21581; bugfix on 21562, not in any released version of tor.
|
|
|
|
|
|
|
|
This feature makes it possible to turn off memory sentinels (like
those used for safety in buffers.c and memarea.c) when fuzzing, so
that we can catch bugs that they would otherwise prevent.
|
|
|
|
This ensures we reliably call chutney's newer tools/test-network.sh when
available.
Fixes bug 21562; bugfix on tor-0.2.9.1-alpha.
|
|
Part of 21570.
|
|
Requires the equivalent chutney changes in 21571.
Part of 21570.
|
|
|
|
When encoding a legacy ESTABLISH_INTRO cell, we were using the sizeof() on a
pointer instead of using the real size of the destination buffer leading to an
overflow passing an enormous value to the signing digest function.
Fortunately, that value was only used to make sure the destination buffer
length was big enough for the key size and in this case it always was because
of the overflow.
Fixes #21553
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
And remove "password" type from the list of intro auths.
|
|
There was a missing space and an extra colon.
Fixes bug 21510; bugfix on 0.2.9.3-alpha.
|
|
Unit tests #21507.
Part of #21470.
|
|
Unit tests for #21278.
Part of #21470.
|
|
Unit tests for #21450.
Part of #21470.
|