summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-05-30Merge branch 'tor-github/pr/1049'David Goulet
2019-05-29Merge branch 'tor-github/pr/1037'George Kadianakis
2019-05-29Merge branch 'maint-0.4.0'George Kadianakis
2019-05-29Merge branch 'tor-github/pr/924' into maint-0.4.0George Kadianakis
2019-05-29Changes file for bug 30614Nick 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-28Merge branch 'tor-github/pr/1047'David Goulet
2019-05-27Merge branch 'tor-github/pr/1042'George Kadianakis
2019-05-27Merge branch 'tor-github/pr/1043'George Kadianakis
2019-05-27Tests for deciding how full our relay cells should beNick Mathewson
2019-05-27Make sure that we send at least some random data in RELAY_DATA cellsNick Mathewson
Proposal 289 prevents SENDME-flooding by requiring the other side to authenticate the data it has received. But this data won't actually be random if they are downloading a known resource. "No problem", we said, "let's fell the empty parts of our cells with some randomness!" and we did that in #26871. Unfortunately, if the relay data payloads are all completely full, there won't be any empty parts for us to randomize. Therefore, we now pick random "randomness windows" between CIRCWINDOW_INCREMENT/2 and CIRCWINDOW_INCREMENT. We remember whether we have sent a cell containing at least 16 bytes of randomness in that window. If we haven't, then when the window is exhausted, we send one. (This window approach is designed to lower the number of rng checks we have to do. The number 16 is pulled out of a hat to change the attacker's guessing difficulty to "impossible".) Implements 28646.
2019-05-26trivial whitespace fixesRoger Dingledine
2019-05-24changes file for test coverageNick Mathewson
2019-05-23cov-test-determinism: use the same RNG seed as in travis.ymlNick Mathewson
We added this facility so that we could get deterministic PRNG behavior for coverage testing on tests that use a replaced PRNG. We need to have our coverage determinism tool test for this as well.
2019-05-23Coverage: do not include test-rebind in coverage builds.Nick Mathewson
Because it invokes the Tor mainloop, it does unpredictable things to test coverage of a lot of code that it doesn't actually test at all. (It is more an integration test than anything else.)
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-23Merge branch 'tor-github/pr/1022'David Goulet
2019-05-23Merge branch 'tor-github/pr/1034'David Goulet
2019-05-23Merge branch 'tor-github/pr/988'David Goulet
2019-05-23Extract length-deciding function from package_raw_inbuf.Nick Mathewson
2019-05-23refactor logic to decide how much to package from inbufRoger Dingledine
no actual changes in behavior
2019-05-23Only reject POSTDESCRIPTOR purpose= when the purpose is unrecognizedNick Mathewson
Fixes bug 30580; bugfix on 0.4.1.1-alpha.
2019-05-22Now this repository is full of 0.4.1.1-alpha-devNick Mathewson
2019-05-22circuitpadding tests: Use tt_i64_op() to compare int64_t valuestor-0.4.1.1-alphaNick Mathewson
Bug not in any released Tor.
2019-05-22More 0.4.1.1-alpha hangelogs editsNick Mathewson
(credit to seborn here)
2019-05-22Fold last entry into changelogNick Mathewson
2019-05-22Bump to 0.4.1.1-alphaNick Mathewson
2019-05-22Merge remote-tracking branch 'dgoulet/ticket30454_035_01'Nick Mathewson
2019-05-22Merge branch 'ticket30428_041_02_squashed'Nick Mathewson
2019-05-22sendme: Add non fatal asserts for extra safetyDavid Goulet
Two non fatal asserts are added in this commit. First one is to see if the SENDME digest list kept on the circuit for validation ever grows bigger than the maximum number of expected SENDME on a circuit (currently 10). The second one is to know if we ever send more than one SENDME at a time on a circuit. In theory, we shouldn't but if we ever do, the v1 implementation wouldn't work because we only keep one single cell digest (the previous cell to the SENDME) on the circuit/cpath. Thus, sending two SENDME consecutively will lead to a mismatch on the other side because the same cell digest would be use and thus the circuit would collapse. Finally, add an extra debug log in case we emit a v0 which also includes the consensus emit version in that case. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Always pop last SENDME digest from circuitDavid Goulet
We must not accumulate digests on the circuit if the other end point is using another SENDME version that is not using those digests like v0. This commit makes it that we always pop the digest regardless of the version. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Clarify how sendme_circuit_cell_is_next() worksDavid Goulet
Commit 4ef8470fa5480d3b was actually reverted before because in the end we needed to do this minus 1 check on the window. This commit clarifies that in the code, takes the useful comment changes from 4ef8470fa5480d3b and makes sendme_circuit_cell_is_next() private since it behaves in a very specific way that one external caller might expect. Part of #30428. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Properly record SENDMEs on both edgesDavid Goulet
Turns out that we were only recording the "b_digest" but to have bidirectionnal authenticated SENDMEs, we need to use the "f_digest" in the forward cell situation. Because of the cpath refactoring, this commit plays with the crypt_path_ and relay_crypto_t API a little bit in order to respect the abstractions. Previously, we would record the cell digest as the SENDME digest in the decrypt cell function but to avoid code duplication (both directions needs to record), we now do that right after iff the cell is recognized (at the edge). It is now done in circuit_receive_relay_cell() instead. We now also record the cell digest as the SENDME digest in both relay cell encryption functions since they are split depending on the direction. relay_encrypt_cell_outbound() and relay_encrypt_cell_inbound() need to consider recording the cell digest depending on their direction (f vs b digest). Fixes #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Never fallback to v0 if unknown versionDavid Goulet
There was a missing cell version check against our max supported version. In other words, we do not fallback to v0 anymore in case we do know the SENDME version. We can either handle it or not, never fallback to the unauthenticated version in order to avoid gaming the authenticated logic. Add a unit tests making sure we properly test that and also test that we can always handle the default emit and accepted versions. Fixes #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Validate v1 SENDMEs on both client and exit sideDavid Goulet
The validation of the SENDME cell is now done as the very first thing when receiving it for both client and exit. On failure to validate, the circuit is closed as detailed in the specification. Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22sendme: Record cell digest on both client and exitDavid Goulet
It turns out that only the exit side is validating the authenticated SENDME v1 logic and never the client side. Which means that if a client ever uploaded data towards an exit, the authenticated SENDME logic wouldn't apply. For this to work, we have to record the cell digest client side as well which introduced a new function that supports both type of edges. This also removes a test that is not valid anymore which was that we didn't allow cell recording on an origin circuit (client). Part of #30428 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-22Merge remote-tracking branch 'nickm/ticket30454_034_01_squashed' into ↵David Goulet
ticket30454_035_01
2019-05-22Edit changelog entries for clarity and concisenessNick Mathewson
2019-05-21light movement and editing on changelogNick Mathewson
2019-05-20Add a new "autostyle" make target to run all of our reformattingNick Mathewson
Closes ticket 30539.
2019-05-20updateCopyright: look at the current year.Nick Mathewson
2019-05-20rectify_include_paths: warn instead of aborting on duplicate headersNick Mathewson
We have two sendme.h files at the moment; we should fix that, but not in this branch.
2019-05-20In microdesc_cache_reload(), set journal length to length of string we readrl1987
Hopefully this will fix CID 1444769.
2019-05-20hs: Remove hs_cell_onion_key_type_t enumDavid Goulet
Unify this with the trunnel ABI so we don't duplicate. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20trunnel: Remove INTRODUCE1 status code IN statementDavid Goulet
We want to support parsing a cell with unknown status code so we are forward compatible. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20hs: Add changes file for #30454David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20hs: Remove hs_intro_auth_key_type_t enumDavid Goulet
Like the previous commit about the INTRODUCE_ACK status code, change all auth key type to use the one defined in the trunnel file. Standardize the use of these auth type to a common ABI. Part of #30454 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-20hs: Get rid of duplicate hs_cell_introd_ack_status_tDavid Goulet
This enum was the exact same as hs_intro_ack_status_t that was removed at the previous commit. It was used client side when parsing the INTRODUCE_ACK cell. Now, the entire code dealing with the INTRODUCE_ACK cell (both sending and receiving) have been modified to all use the same ABI defined in the trunnel introduce1 file. Finally, the client will default to the normal behavior when receiving an unknown NACK status code which is to note down that we've failed and re-extend to the next intro point. This way, unknown status code won't trigger a different behavior client side. Part of #30454. Signed-off-by: David Goulet <dgoulet@torproject.org>