Age | Commit message (Collapse) | Author |
|
|
|
Coccinelle doesn't understand it when we use "==" and "!=" and so on as
arguments to macros. To solve this, we prefer OP_EQ, OP_NE, and so
on.
This commit is automatically generated by running
./scripts/coccinelle/test_operator_cleanup over all of the source
code in src.
|
|
|
|
|
|
(This option tests our existing behavior, not necessarily the most
sensible behavior.)
|
|
|
|
ticket30924_042_04_squashed_merged
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Move it outside of the validation function since 0 is a valid value but
disables defenses.
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
One test makes sure that the toplevel magic numbers are distinct.
One test makes sure that we can parse a configuration object
with two sub-objects.
|
|
|
|
This test case, at this point, only constructs the confmgr object.
More code to come.
|
|
Fix a bug in config_find_option_name() where it did not consider
the abbreviations table.
|
|
This discovered a bug related to an extra & in
config_mgr_list_deprecated_vars(): fix that.
|
|
Right now, it doesn't do anything; this patch is meant to make sure
that we're doing memory management correctly.
|
|
The right way to free a config object is now to wrap config_free(),
always. Instead of creating an alternative free function, objects
should provide an alternative clear callback to free any fields that
the configuration manager doesn't manage.
This lets us simplify our code a little, and lets us extend the
confparse.c code to manage additional fields in config_free.
|
|
Every time we finalize a config manager, we now generate a new magic
number for it, so that we'll get an assertion failure if we ever try
to use an object with a different configuration manager than the one
that generated it.
|
|
|
|
|
|
|
|
It's good style to always add parentheses when using macro
arguments, in case somebody someday provides an argument that
contains an operator you don't expect, or causes the expression to
parse differently.
|
|
In Tor's tests, the tt_*() macros can call "goto done" on failure.
When that happens, we need to make sure that all of our allocated
memory still gets freed, or else Coverity will complain.
|
|
|
|
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Move everything to its own function in order to better log, document and tests
the introduction point validation process.
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Remove the public functions returning the HS DoS consensus param or default
values as it is exclusively used internally now.
Rename the param_* variables to consensus_param_* for better code semantic.
Finally, make some private functions available to unit tests.
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
We added a flag on the circuit to know if the DoS defenses are enabled or not.
Before, it was solely the consensus parameter.
Part of #30924
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
This commit makes tor add the DoS cell extension to the ESTABLISH_INTRO cell
if the defense is enabled on the service side with a torrc option.
Furthermore, the cell extension is only added if the introduction point
supports it. The protover version HSIntro=5 is looked for.
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
Make it clear that these functions return the consensus param only.
Introduction point can not set those values with a torrc option.
Signed-off-by: David Goulet <dgoulet@torproject.org>
|
|
hs_ident_circuit_new()
|
|
|
|
Part of 21003.
|
|
|
|
Coverity wants us to free everything that we are potentially
allocating, even stuff where allocating it would be a bug. Adding
a smartlist_free() here will fix the warning.
Fixes bug 31452; bugfix on 16a0b7ed6779bf72a8a471c, which is not in
any released Tor. This is CID 1447292.
|
|
|
|
|
|
|
|
|
|
|