aboutsummaryrefslogtreecommitdiff
path: root/src/lib
AgeCommit message (Collapse)Author
2019-06-25Make "invisibility" and "undumpability" properties of variables.Nick Mathewson
Previously, these were magical things that we detected by checking whether a variable's name was prefixed with two or three underscores.
2019-06-25Turn several properties of types or variables into flags.Nick Mathewson
"unsettable" is a property of types. LINELIST_V and OBSOLETE are unsettable, meaning that they cannot be set by name. "contained" is a property of types. I'm hoping to find a better name here. LINELIST_S is "contained" because it always appears within a LINELIST_V, and as such doesn't need to be dumped ore copied independently. "cumulative" is a property of types. Cumulative types can appear more than once in a torrc without causing a warning, because they add to each other rather than replacing each other. "obsolete" is a property of variables. "marking fragile" is now a command that struct members can accept. With these changes, confparse and config no longer ever need to mention CONFIG_TYPE_XYZ values by name.
2019-06-25Extend macros to allow flag arguments.Nick Mathewson
2019-06-25Add a "flags" member to config_var_tNick Mathewson
Additionally, adjust the macros so that we can add new members like this more easily.
2019-06-25Move responsibility for config var macrosNick Mathewson
The testing-only parts now live in a conftesting.h; the shared parts of the macros live in confmacros.h
2019-06-25Move config_var_t info conftypes.hNick Mathewson
2019-06-25A few more test cases and unreachable linesNick Mathewson
2019-06-25Use structvar to find the types for config vars.Nick Mathewson
2019-06-25Add new "struct_var_" functions to manipulate struct fields.Nick Mathewson
These functions exist one level higher than typed_var_t. They describe a type, a name, and an offset within a structure.
2019-06-24Add unit tests for the unitparse.c module.Nick Mathewson
2019-06-24Further clarify our clarification about the type of POSINTNick Mathewson
2019-06-24Add a "typed_var" abstraction to implement lvalue access in C.Nick Mathewson
Right now, this has been done at a high level by confparse.c, but it makes more sense to lower it. This API is radically un-typesafe as it stands; we'll be wrapping it in a safer API as we do #30914 and lower the struct manipulation code as well. Closes ticket 30864.
2019-06-24Add a function to append an existing line to a config line list.Nick Mathewson
We had an existing function to do this, but it took a pair of strings rather than a line.
2019-06-24Move unit-parsing code to src/lib/confmgtNick Mathewson
lib/confmgt is at a higher level than lib/conf, since it needs to call down to logging and similar modules.
2019-06-24Start moving types that will be used for config vars to lib/confNick Mathewson
This will be a lower-level module than anything that actually sets or handles configuration variables. Part of 30864.
2019-06-14Merge branch 'bug30806'George Kadianakis
2019-06-14Make evloop into a subsystem.Nick Mathewson
Note that the event base object is _not_ created from the initialize function, since it is configuration-dependent. This will wait until configuration is integrated into subsystems. Closes ticket 30806.
2019-06-11Merge branch 'tor-github/pr/1040'David Goulet
2019-06-11Merge branch 'maint-0.4.1'David Goulet
2019-06-11Merge branch 'tor-github/pr/1050' into maint-0.4.1David Goulet
2019-06-11Give a compile warning when we don't have any flags for minherit().Nick Mathewson
Part of ticket 30686.
2019-06-11Give a more useful failure messgae when we fail to minherit().Nick Mathewson
Part of ticket 30686.
2019-06-11Merge branch 'ticket30687_042_01'George Kadianakis
2019-06-11token-bucket: Implement a single counter objectDavid Goulet
Closes #30687. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-05Replace a missing end-of-comment stringNick Mathewson
This happened when I went to fix long lines after running "make autostyle".
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-30Merge branch 'tor-github/pr/1054'David Goulet
2019-05-30Merge branch 'tor-github/pr/1049'David Goulet
2019-05-29Merge branch 'ticket30561_029' into ticket30561_035Nick Mathewson
2019-05-29Use MAP_INHERIT_ZERO or MAP_INHERIT_NONE if available.Taylor R Campbell
Fixes assertion failure in tests on NetBSD: slow/prob_distr/stochastic_log_logistic: [forking] May 25 03:56:58.091 [err] tor_assertion_failed_(): Bug: src/lib/crypt_ops/crypto_rand_fast.c:184: crypto_fast_rng_new_from_seed: Assertion inherit != INHERIT_RES_KEEP failed; aborting. (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61) May 25 03:56:58.091 [err] Bug: Assertion inherit != INHERIT_RES_KEEP failed in crypto_fast_rng_new_from_seed at src/lib/crypt_ops/crypto_rand_fast.c:184: . (Stack trace not available) (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61) [Lost connection!]
2019-05-28Trivial fix for a trivial warning with gcc 9.1.1Nick Mathewson
Fix on 4e3d144fb0940d8ee5a89427d471ea3656e8e122; bug not in any released Tor.
2019-05-23In coverage builds, use branch-free timeradd() and timersub()Nick Mathewson
The ordinary definitions of timeradd() and timersub() contain a branch. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-23In coverage builds, avoid basic-block complexity in log_debugNick Mathewson
Ordinarily we skip calling log_fn(LOG_DEBUG,...) if debug logging is completely disabled. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-22Multiple subscribers or publishers per subsystemTaylor Yu
Allow a subsystem to register to publish or subscribe a given message from multiple places. Part of ticket 29976.
2019-05-07Merge branch 'tor-github/pr/994'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03Merge branch 'tor-github/pr/954'David Goulet
2019-05-02Add comments to include.am files to note where new sources goNick Mathewson
This mechanism isn't perfect, and sometimes it will guess wrong, but it will help our automation.
2019-04-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-30Use safe_mem_is_zero in a few more places.Nick Mathewson
I don't believe any of these represent a real timing vulnerability (remote timing against memcmp() on a modern CPU is not easy), but these are the ones where I believe we should be more careful.
2019-04-30Rename tor_mem_is_zero to fast_mem_is_zero()Nick Mathewson
For memeq and friends, "tor_" indicates constant-time and "fast_" indicates optimized. I'm fine with leaving the constant-time "safe_mem_is_zero" with its current name, but the "tor_" prefix on the current optimized version is misleading. Also, make the tor_digest*_is_zero() uniformly constant-time, and add a fast_digest*_is_zero() version to use as needed. A later commit in this branch will fix all the users of tor_mem_is_zero(). Closes ticket 30309.
2019-04-30Merge branch 'tor-github/pr/936'George Kadianakis
2019-04-30Merge branch 'tor-github/pr/980'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-30Merge branch 'tor-github/pr/909'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-04-30Add improved debugging support to crypto_rand_fast code.Nick Mathewson
2019-04-30Extract add-entropy code from crypto_fast_rng to a new functionNick Mathewson
2019-04-25Add rudimentary qstring support to kvline.cNick Mathewson
2019-04-25Move and rename decode_escaped_string()Nick Mathewson
This function decodes something different from the usual c-escaped format. It is only used in controller authorization.
2019-04-25Add a case-insensitive variant to config_line_find()Nick Mathewson
2019-04-25kvline: handle empty alues as well as empty keysNick Mathewson
The two options are mutually exclusive, since otherwise an entry like "Foo" would be ambiguous. We want to have the ability to treat entries like this as keys, though, since some controller commands interpret them as flags.
2019-04-25Merge branch 'tor-github/pr/953'George Kadianakis