aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2017-08-08hs: Rename num_rend_services()David Goulet
Renamed to rend_num_services() so it is consistent with the legacy naming. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Fix prop224 HS descriptor to use subcredentialGeorge Kadianakis
We used to use NULL subcredential which is a terrible terrible idea. Refactor HS unittests to use subcredentials. Also add some non-fatal asserts to make sure that we always use subcredentials when decoding/encoding descs. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add unit test coverage of hs_service.cDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Refactor HS tests to use the new ESTABLISH_INTRO cell codeDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add test_hs_common unit testsDavid Goulet
Move tests from test_hs_service.c to this file. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add test_hs_ntor unit testsDavid Goulet
Move the ntor test from test_hs_service.c to this file. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08test: Add test_hs_cell unit testsDavid Goulet
Move ESTABLISH_INTRO tests from test_hs_service.c to this new file. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Circuit has opened and ESTABLISH_INTRO cellDavid Goulet
Add the entry point from the circuit subsystem of "circuit has opened" which is for all type of hidden service circuits. For the introduction point, this commit actually adds the support for handling those circuits when opened and sending ESTABLISH_INTRO on a circuit. Rendevzou point circuit aren't supported yet at this commit. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: Add descriptor overlap mode functionGeorge Kadianakis
The function has been added but not used except for the unit tests. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08prop224: API for the creation of blinded keysDavid Goulet
Add a function for both the client and service side that is building a blinded key from a keypair (service) and from a public key (client). Those two functions uses the current time period information to build the key. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08hs: Implement constructor for hs_desc_intro_point_tDavid Goulet
Add a new and free function for hs_desc_intro_point_t so the service can use them to setup those objects properly. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-24Fix remaining cases of hs_config failures without af_unixNick Mathewson
2017-07-24Fix hs_config unit test on systems without unix socketsNick Mathewson
Bugfix on 418059dd96f5f427eceffff1daeb2a2f6c4adbeb; jenkins found this.
2017-07-24Rename the hybrid_encrypt/decrypt functions; label them as dangerousNick Mathewson
We need to keep these around for TAP and old-style hidden services, but they're obsolete, and we shouldn't encourage anyone to use them. So I've added "obsolete" to their names, and a comment explaining what the problem is. Closes ticket 23026.
2017-07-24test: Remove buggy unit test in test_hs_serviceDavid Goulet
There isn't much of a point of this buggy test afterall to add twice the same service object but with a different key which ultinately can end up failing the test because 1/N_BUCKETS of probability that we end up to put the service in the same bucket. Fixes #23023 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-14Merge branch 'bug17750_029_squashed'Nick Mathewson
2017-07-14Fix a signed integer overflow in dir/download_status_random_backoffNick Mathewson
Fix for 22924. Bugfix on 0.2.9.1-alpha when the test was introducd -- though it couldn't actually overflow until we fixed 17750. Additionally, this only seems to overflow on 32-bit, and only when the compiler doesn't re-order the (possibly dead) assignment out of the way. We ran into it on a 32-bit ubuntu trusty builder.
2017-07-14Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-14Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-07-14Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-07-14Merge branch 'bug22916_027' into maint-0.2.9Nick Mathewson
2017-07-14Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-14Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-07-14Merge branch 'bug22803_030' into maint-0.3.0Nick Mathewson
2017-07-13Fix compiler warnings with openssl-scrypt/libscrypt test on clangNick Mathewson
Clang didn't like that we were passing uint64_t values to an API that wanted uint32_t. GCC has either not cared, or has figured out that the values in question were safe to cast to uint32_t. Fixes bug22916; bugfix on 0.2.7.2-alpha.
2017-07-13Merge remote-tracking branch 'dgoulet/ticket21979_032_04'Nick Mathewson
2017-07-13Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-13Merge remote-tracking branch 'isis/bug22830_0.3.1' into maint-0.3.1Nick Mathewson
2017-07-13prop224: Move service version into config objectDavid Goulet
It makes more sense to have the version in the configuration object of the service because it is afterall a torrc option (HiddenServiceVersion). Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13test: Add v3 service load keys and accessorsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13test: Add v3 service config and registration testDavid Goulet
This tests our hs_config.c API to properly load v3 services and register them to the global map. It does NOT test the service object validity, that will be the hs service unit test later on. At this commit, we have 100% code coverage of hs_config.c. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Service address creation/validationDavid Goulet
This also adds unit test and a small python script generating a deterministic test vector that a unit test tries to match. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13test: Add HS v2 service configuration unit testsDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13prop224: Add hs_config.{c|h} with a refactoringDavid Goulet
Add the hs_config.{c|h} files contains everything that the HS subsystem needs to load and configure services. Ultimately, it should also contain client functions such as client authorization. This comes with a big refactoring of rend_config_services() which has now changed to only configure a single service and it is stripped down of the common directives which are now part of the generic handler. This is ground work for prop224 of course but only touches version 2 services and add XXX note for version 3. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-13use CARGO_HOME instead of HOME when building with rustChelsea H. Komlo
2017-07-12Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-12Restore openssl and libscrypt includes in test_crypto_slow.cNick Mathewson
This reverts part of commit 706c44a6ce0bbeee51c800521a3199d76e1dcd96. It was a mistake to remove these includes: they were needed on systems where we have openssl 1.1.0 *and* libscrypt, and where we were validating the one against the other. Fixes bug 22892; bugfix on 0.3.1.1-alpha.
2017-07-10Merge branch 'maint-0.3.1'Nick Mathewson
2017-07-10Make consdiff tests pass on OS X tooMatt Traudt
2017-07-07Merge branch 'bug17750_029_squashed'Nick Mathewson
2017-07-07Refactor exponential backoff multipliers into macrosteor
There are only so many times you can type "4".
2017-07-07Add regression tests for 17750 and 20534teor
2017-07-07Make clients try fallbacks before authoritiesteor
Make clients wait for 6 seconds before trying to download their consensus from an authority. Fixes bug 17750, bugfix on 0.2.8.1-alpha.
2017-07-07Fix the expected bug warning in dir/param_voting_lookup testsNick Mathewson
2017-07-07Fix a couple of clang warningsNick Mathewson
2017-07-07Merge branch 'ticket21859_032_01_squashed'Nick Mathewson
2017-07-07Fix wide linesNick Mathewson
2017-07-07Hide crypto_digest_t again and use an accessor for tests.George Kadianakis
2017-07-07Explicit length checks in create_rend_cpath().George Kadianakis
Had to also edit hs_ntor_circuit_key_expansion() to make it happen.
2017-07-07test: Add service-side unittests for e2e rendezvous circuits.George Kadianakis