aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.c
AgeCommit message (Collapse)Author
2018-07-05Move literally everything out of src/orNick Mathewson
This commit won't build yet -- it just puts everything in a slightly more logical place. The reasoning here is that "src/core" will hold the stuff that every (or nearly every) tor instance will need in order to do onion routing. Other features (including some necessary ones) will live in "src/feature". The "src/app" directory will hold the stuff needed to have Tor be an application you can actually run. This commit DOES NOT refactor the former contents of src/or into a logical set of acyclic libraries, or change any code at all. That will have to come in the future. We will continue to move things around and split them in the future, but I hope this lays a reasonable groundwork for doing so.
2018-07-01Remove needless includes from or.hNick Mathewson
or.h should really include only the minimum of stuff from or/*, common/*, and lib/*.
2018-07-01Combine DH_BYTES and DH_KEY_LEN; put them in a lib/defs header.Nick Mathewson
2018-06-21Rectify include paths (automated)Nick Mathewson
2018-06-20Run rectify_include_paths.pyNick Mathewson
2018-06-20Update copyrights to 2018.Nick Mathewson
2018-06-15Move extend_info_t into its own header.Nick Mathewson
2018-06-15Extract cell type and their queues into new headersNick Mathewson
Since packed_cell and destroy_cell exist only to be queued, they go in the same headers as the queues.
2018-06-15Extract {or,origin}_circuit_t into their own headersNick Mathewson
2018-04-06crypto: Refactor (P)RNG functionality into new crypto_rand module.Isis Lovecruft
* ADD new /src/common/crypto_rand.[ch] module. * ADD new /src/common/crypto_util.[ch] module (contains the memwipe() function, since all crypto_* modules need this). * FIXES part of #24658: https://bugs.torproject.org/24658
2018-02-15Fix a stack-protector warning: don't use a variable-length bufferNick Mathewson
Instead, define a maximum size, and enforce it with an assertion.
2018-02-05Avoid a malloc/free pair for each (server-side) ntor handshakeNick Mathewson
Closes ticket 25150
2017-12-08Change the free macro convention in the rest of src/or/*.hNick Mathewson
2017-08-04Fix ntohs() that should have been htons()Nick Mathewson
Fixes bug 23106; bugfix on 0.2.4.8-alpha. Fortunately, we only support big-endian and little-endian platforms, and on both of those, hton*() and ntoh*() behave the same. And if we did start to support middle endian systems (haha, no), most of _those_ have hton*(x) == ntoh*(x) too.
2017-03-15Run the copyright update script.Nick Mathewson
2017-03-15Merge branch 'bug20059_024_v2' into maint-0.3.0Nick Mathewson
2017-03-15Avoid a double-mark bug when makring a pending circuit as "too old"Nick Mathewson
Fixes bug 20059; bugfix on 0.1.0.1-rc.
2016-12-08Adding some assertions to onion.cNick Mathewson
2016-12-08Add ExtendByEd25519ID consensus parameter/torrc optionNick Mathewson
I need to be able to turn on Ed25519 support in client generation of extend cells so I can test it, but leave it off-by-default until enough clients support it for us to turn it on for a bunch at once. This is part of #15056 / prop#220.
2016-11-11Migrate extend2/create2 cell encoding to TrunnelNick Mathewson
(Not extended2/created2; that's too simple.) Incidentally, add ed25519 identities to the mix when we have them.
2016-10-17Write a bunch of module documentation.Nick Mathewson
This commit adds or improves the module-level documenation for: buffers.c circuitstats.c command.c connection_edge.c control.c cpuworker.c crypto_curve25519.c crypto_curve25519.h crypto_ed25519.c crypto_format.c dircollate.c dirserv.c dns.c dns_structs.h fp_pair.c geoip.c hibernate.c keypin.c ntmain.c onion.c onion_fast.c onion_ntor.c onion_tap.c periodic.c protover.c protover.h reasons.c rephist.c replaycache.c routerlist.c routerparse.c routerset.c statefile.c status.c tor_main.c workqueue.c In particular, I've tried to explain (for each documented module) what each module does, what's in it, what the big idea is, why it belongs in Tor, and who calls it. In a few cases, I've added TODO notes about refactoring opportunities. I've also renamed an argument, and fixed a few DOCDOC comments.
2016-08-24Client & HS make sure every hop in every non-HS path supports ntorteor (Tim Wilson-Brown)
When a client connects to an intro point not in the client's consensus, or a hidden service connects to a rend point not in the hidden service's consensus, we are stuck with using TAP, because there is no ntor link specifier.
2016-07-06Improve test coverage a little on onion*.cNick Mathewson
2016-06-12Keep make check-spaces happyAndrea Shepard
2016-06-11Merge branch 'bug19180_easy_squashed'Nick Mathewson
2016-06-11Add -Wmissing-variable-declarations, with attendant fixesNick Mathewson
This is a big-ish patch, but it's very straightforward. Under this clang warning, we're not actually allowed to have a global variable without a previous extern declaration for it. The cases where we violated this rule fall into three roughly equal groups: * Stuff that should have been static. * Stuff that was global but where the extern was local to some other C file. * Stuff that was only global when built for the unit tests, that needed a conditional extern in the headers. The first two were IMO genuine problems; the last is a wart of how we build tests.
2016-05-30Replace nearly all XXX0vv comments with smarter onesNick Mathewson
So, back long ago, XXX012 meant, "before Tor 0.1.2 is released, we had better revisit this comment and fix it!" But we have a huge pile of such comments accumulated for a large number of released versions! Not cool. So, here's what I tried to do: * 0.2.9 and 0.2.8 are retained, since those are not yet released. * XXX+ or XXX++ or XXX++++ or whatever means, "This one looks quite important!" * The others, after one-by-one examination, are downgraded to plain old XXX. Which doesn't mean they aren't a problem -- just that they cannot possibly be a release-blocking problem.
2016-03-29fix typo in commentRoger Dingledine
2016-02-27Update the copyright year.Nick Mathewson
2015-02-02Merge remote-tracking branch 'public/bug9635_warnings_025'Nick Mathewson
Conflicts: src/test/test.c
2015-01-14Refactor cpuworker to use workqueue/threadpool code.Nick Mathewson
2015-01-02Bump copyright dates to 2015, in case someday this matters.Nick Mathewson
2014-10-28Add another year to our copyright dates.Nick Mathewson
Because in 95 years, we or our successors will surely care about enforcing the BSD license terms on this code. Right?
2014-10-27Remove configure option to disable curve25519Sebastian Hahn
By now, support in the network is widespread and it's time to require more modern crypto on all Tor instances, whether they're clients or servers. By doing this early in 0.2.6, we can be sure that at some point all clients will have reasonable support.
2014-10-16Downgrade 'invalid result from curve25519 handshake: 4' warningNick Mathewson
Also, refactor the way we handle failed handshakes so that this warning doesn't propagate itself to "onion_skin_client_handshake failed" and "circuit_finish_handshake failed" and "connection_edge_process_relay_cell (at origin) failed." Resolves warning from 9635.
2014-05-01Merge remote-tracking branch 'public/bug9635'Nick Mathewson
2014-04-18scan-build: Have clear_pending_onions walk the lists more obviouslyNick Mathewson
As it stands, it relies on the fact that onion_queue_entry_remove will magically remove each onionskin from the right list. This patch changes the logic to be more resilient to possible bugs in onion_queue_entry_remove, and less confusing to static analysis tools.
2014-03-27Give specific warnings when client-side onionskin handshakes failNick Mathewson
Fix for bug9635.
2014-01-03Add explicit check for 0-length extend2 cellsNick Mathewson
This is harmless in the Tor of today, but important for correctness. Fixes bug 10536; bugfix on 0.2.4.8-alpha. Reported by "cypherpunks".
2013-09-05Merge branch 'maint-0.2.4'Roger Dingledine
2013-09-05Revert e443beff and solve it a different wayRoger Dingledine
Now we explicitly check for overflow. This approach seemed smarter than a cascade of "change int to unsigned int and hope nothing breaks right before the release". Nick, feel free to fix in a better way, maybe in master.
2013-09-05don't let recently_chosen_ntors overflowRoger Dingledine
with commit c6f1668d we let it grow arbitrarily large. it can still overflow, but the damage is very small now.
2013-09-04Merge branch 'maint-0.2.4'Roger Dingledine
Conflicts: src/test/test.c
2013-09-04nickm wants us to prioritize tap in a currently-rare edge caseRoger Dingledine
2013-09-04Be more general in calculating expected onion queue processing timeRoger Dingledine
Now we consider the TAP cells we'll process while draining the NTor queue, and vice versa.
2013-09-04let the NumNTorsPerTAP consensus param override our queue choiceRoger Dingledine
2013-09-04do a lopsided round-robin between the onion queuesRoger Dingledine
that way tap won't starve entirely, but we'll still handle ntor requests quicker.
2013-09-04check bounds on handshake_type more thoroughlyRoger Dingledine
2013-09-04add info-level logs to help track onion queue sizesRoger Dingledine
2013-09-04refactor and give it unit testsRoger Dingledine