summaryrefslogtreecommitdiff
path: root/src/feature
AgeCommit message (Collapse)Author
2018-09-04Merge branch 'nss_squashed' into nss_mergeNick Mathewson
2018-09-04Rename crypto_pk_check_key(), use it more reasonably, add testsNick Mathewson
This function was a wrapper around RSA_check_key() in openssl, which checks for invalid RSA private keys (like those where p or q are composite, or where d is not the inverse of e, or where n != p*q). We don't need a function like this in NSS, since unlike OpenSSL, NSS won't let you import a bogus private key. I've renamed the function and changed its return type to make it more reasonable, and added a unit test for trying to read a key where n != p*q.
2018-09-04c99 style in loopNick Mathewson
2018-09-04Merge branch 'tor_api_owning_control'Nick Mathewson
2018-09-04Merge branch 'bug24104_029_squashed'Nick Mathewson
2018-08-29Change mention of is_extrainfo router_parse_list_from_string() to want_extrainfoNeel Chauhan
2018-08-29Merge branch 'ticket27246_035_01_squashed'Nick Mathewson
2018-08-29Expand the comments on ASN.1-encoded TAP keysNick Mathewson
2018-08-29router: Keep RSA onion public key in ASN.1 formatDavid Goulet
The OpenSSL "RSA" object is currently 408 bytes compares to the ASN.1 encoding which is 140 for a 1024 RSA key. We save 268 bytes per descriptor (routerinfo_t) *and* microdescriptor (microdesc_t). Scaling this to 6000 relays, and considering client usually only have microdescriptors, we save 1.608 MB of RAM which is considerable for mobile client. This commit makes it that we keep the RSA onion public key (used for TAP handshake) in ASN.1 format instead of an OpenSSL RSA object. Changes is done in both routerinfo_t and microdesc_t. Closes #27246 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-28Merge branch 'bug26367_035_01'Nick Mathewson
2018-08-28hs: Remove rend_client_non_anonymous_mode_enabledDavid Goulet
The removal of Tor2Web made this function useless. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-28hs: Remove rend_client_allow_non_anonymous_connectionDavid Goulet
By removing Tor2Web, there is no way a client can be non anonymous so we remove that function and the callsites. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-28hs: Render obsolete Tor2webDavid Goulet
Remove support for Tor2web in the code and build system. At this commit, tor doesn't have Tor2web support anymore. Ref: https://lists.torproject.org/pipermail/tor-dev/2018-July/013295.html Close #26367 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-28Fix log.c comments about assert vs tor_assert vs raw_assert.Nick Mathewson
2018-08-28Merge branch 'bug26896_034'Nick Mathewson
2018-08-28fixup! hs: Learn service version by trying to load the keysDavid Goulet
2018-08-24Merge remote-tracking branch 'tor-github/pr/289'Nick Mathewson
2018-08-24Merge remote-tracking branch 'teor/bug27237'Nick Mathewson
2018-08-24Merge branch 'maint-0.3.4'Nick Mathewson
2018-08-24Merge branch 'maint-0.3.4'Nick Mathewson
2018-08-24Merge branch 'maint-0.3.4'Nick Mathewson
2018-08-24Bootstrap: try harder to get descriptors in non-exit test networksteor
Use the mid weight for the third hop when there are no exits. Fixes bug 27237; bugfix on 0.2.6.2-alpha.
2018-08-23Merge branch 'maint-0.3.4'Nick Mathewson
2018-08-22hs: Change default version from 2 to 3David Goulet
Closes #27215 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-22hs: Learn service version by trying to load the keysDavid Goulet
In order to switch the default HS version from 2 to 3, we need tor to be smart and be able to decide on the version by trying to load the service keys during configuration validation. Part of #27215 Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-22key: Make ed_key_init_from_file() take an or_options_tDavid Goulet
Part of #27215, we need to call the ed_key_init_from_file function during option_validate() which is before the global_options variable is set. This commit make ed_key_init_from_file() stop using get_options() and instead now has a or_options_t parameter. Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-08-22Fix revision counter bugs caused by bad SRV start time computation.George Kadianakis
Bug description: For each descriptor, its revision counter is the OPE ciphertext of the number of seconds since the start time of its SRV value. This bug caused us to confuse the SRV start time in the middle of the lifetime of a descriptor in some edge-cases, which caused descriptor rejects. Bug cause: The bug occurs when we fetch a 23:00 consensus after midnight (e.g. at 00:08 when not all dirauths have fetched the latest 00:00 consensus). In that case, the voting schedule (which was used for SRV start time calculation) would return a valid-after past-midnight, whereas our consensus would be pre-midnight, and that would confuse the SRV start time computation which is used by HS revision counters (because we would reset the start time of SRV, without rotating descriptors). Bug fix: We now use our local consensus time to calculate the SRV start time, instead of the voting schedule. The voting schedule does not work as originally envisioned in this case, because it was created for voting by dirauths and not for scheduling stuff on clients.
2018-08-21Split X509 code out of tortls.cNick Mathewson
2018-08-21Rename functions that encode/decode private keysNick Mathewson
It is not nice to expose a private key's contents without having the function name advertise the fact. Fortunately, we weren't misusing these yet.
2018-08-20Fix typo in comment for getinfo_helper_current_time()Neel Chauhan
2018-08-17In addrs_in_same_network_family(), choose IP subnet size based on IP typeNeel Chauhan
2018-08-16Merge branch 'maint-0.3.4'Nick Mathewson
2018-08-11Merge remote-tracking branch 'tor-github/pr/268'Nick Mathewson
2018-08-10Merge remote-tracking branch 'tor-github/pr/239'Nick Mathewson
2018-08-08Provide examples of tor_api_get_provider_version() outputNick Mathewson
At the same time, sternly warn any person thinking about relying on any particular format too strictly. If you do this, and your program breaks, it is your bug, not mine.
2018-08-08Merge branch 'ticket26947'Nick Mathewson
2018-08-08Print stacktrace when crypto_pk_get_digest() fails in ↵rl1987
router_build_fresh_descriptor()
2018-08-08Consider all routerinfo errors other than "not a server" transientrl1987
2018-08-08Fix typo in control_event_hs_descriptor_content()Neel Chauhan
2018-08-01Add API for creating an owning controller FD and passing it to tor_mainNick Mathewson
2018-08-01tor_api: Extend tor_api code so it can pass extra arguments to main.Nick Mathewson
We need this so that the tor_api user can specify some arguments, while the tor_api implementation adds others. This implementation detail should not be visible to tor_api users.
2018-07-31Merge branch 'nss_dh_squashed' into nss_dh_squashed_mergedNick Mathewson
2018-07-31Add a new function, tor_api_get_provider_version()Nick Mathewson
Closes ticket 26947.
2018-07-30fix wrong word in commentRoger Dingledine
2018-07-30Merge remote-tracking branch 'teor/bug26627_033_merged_master'Nick Mathewson
2018-07-30Merge remote-tracking branch 'rl1987/ticket21349_4'Nick Mathewson
2018-07-30Merge remote-tracking branch 'juga/ticket3723_03_squashed_rebased'Nick Mathewson
2018-07-26Early bailout from log_addr_has_changed() if running as clientrl1987
2018-07-25Merge branch 'bug26627_033' into bug26627_033_merged_masterteor
2018-07-21Split select_entry_guard_for_circuit()rl1987