TODO 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. Obvious things I'd like to do that won't break anything:
  2. * Abstract out crypto calls, with the eventual goal of moving
  3. from openssl to something with a more flexible license.
  4. * Test suite. We need one.
  5. * Switch the "return -1" cases that really mean "you've got a bug"
  6. into calls to assert().
  7. * Since my OR can handle multiple circuits through a given OP,
  8. I think it's clear that the OP should pass new create cells through the
  9. same channel. Thus we can take advantage of the padding we're already
  10. getting. Does that mean the choose_onion functions should be changed
  11. to always pick a favorite OR first, so the OP can minimize the number
  12. of outgoing connections it must sustain?
  13. * Rewrite the OP to be non-blocking single-process.
  14. * Add autoconf support.
  15. Figure out what .h files we're actually using, and how portable
  16. those are.
  17. * Since we're using a stream cipher, an adversary's cell arriving with the
  18. same aci will forever trash our circuit. Since each side picks half
  19. the aci, for each cell the adversary has a 1/256 chance of trashing a
  20. circuit. This is really nasty. We want to make ACIs something reasonably
  21. hard to collide with, such as 20 bytes.
  22. While we're at it, I'd like more than 4 bits for Version. :)
  23. * Exit policies. Since we don't really know what protocol is being spoken,
  24. it really comes down to an IP range and port range that we
  25. allow/disallow. The 'application' connection can evaluate it and make
  26. a decision.
  27. * We currently block on gethostbyname in OR. This is poor. The complex
  28. solution is to have a separate process that we talk to. There are some
  29. free software versions we can use, but they'll still be tricky. The
  30. better answer is to realize that the OP can do the resolution and
  31. simply hand the OR an IP directly.
  32. A) This prevents us from doing sneaky things like having the name resolve
  33. differently at the OR than at the OP. I'm ok with that.
  34. B) It actually just shunts the "dns lookups block" problem back onto the
  35. OP. But that's ok too, because the OP doesn't have to be as robust.
  36. (Heck, can we have the application proxy resolve it, even?)
  37. * I'd like a cleaner interface for the configuration files, keys, etc.
  38. Perhaps the next step is a central repository where we download router
  39. lists? Something that takes the human more out of the loop.
  40. We should look into a 'topology communication protocol'; there's one
  41. mentioned in the spec that Paul has, but I haven't looked at it to
  42. know how complete it is or how well it would work. This would also
  43. allow us to add new ORs on the fly. Directory servers, a la the ones
  44. we're developing for Mixminion (see http://mixminion.net/), are also
  45. a very nice approach to consider.
  46. * Should ORs rotate their link keys periodically?
  47. * We probably want OAEP padding for RSA.
  48. * The parts of the code that say 'FIXME'
  49. * Clean up the number of places that get to look at prkey.
  50. * Circuits should expire sometime, say, when circuit->expire triggers?
  51. Non-obvious things I'd like to do:
  52. (Many of these topics are inter-related. It's clear that we need more
  53. analysis before we can guess which approaches are good.)
  54. * Padding between ORs, and correct padding between OPs. The ORs currently
  55. send no padding cells between each other. Currently the OP seems to
  56. send padding at a steady rate, but data cells can come more quickly
  57. than that. This doesn't provide much protection at all. I'd like to
  58. investigate a synchronous mixing approach, where cells are sent at fixed
  59. intervals. We need to investigate the effects of this on DoS resistance
  60. -- what do we do when we have too many packets? One approach is to
  61. do traffic shaping rather than traffic padding -- we gain a bit more
  62. resistance to DoS at the expense of some anonymity. Can we compare this
  63. analysis to that of the Cottrell Mix, and learn something new? We'll
  64. need to decide on exactly how the traffic shaping algorithm works.
  65. * Make the connection buf's grow dynamically as needed. This won't
  66. really solve the fundamental problem above, though, that a buffer
  67. can be given an adversary-controlled number of cells.
  68. * I'd like to add a scheduler of some sort. Currently we only need one
  69. for sending out padding cells, and if these events are periodic and
  70. synchronized, we don't yet need a scheduler per se, but rather we just
  71. need to have poll return every so often and avoid sending cells onto
  72. the sockets except at the appointed time. We're nearly ready to do
  73. that as it is, with the separation of write_to_buf() and flush_buf().
  74. Edge case: what do we do with circuits that receive a destroy
  75. cell before all data has been sent out? Currently there's only one
  76. (outgoing) buffer per connection, so since it's crypted, a circuit
  77. can't recognize its own packet once it's been queued. We could mark
  78. the circuits for destruction, and go through and cull them once the
  79. buffer is entirely flushed; but with the synchronous approach above,
  80. the buffer may never become empty. Perhaps I should implement a callback
  81. system, so a function can get called when a particular cell gets sent
  82. out. That sounds very flexible, but might also be overkill.
  83. * Currently when a connection goes down, it generates a destroy cell
  84. (either in both directions or just the appropriate one). When a
  85. destroy cell arrives to an OR (and it gets read after all previous
  86. cells have arrived), it delivers a destroy cell for the "other side"
  87. of the circuit: if the other side is an OP or APP, it closes the entire
  88. connection as well.
  89. But by "a connection going down", I mean "I read eof from it". Yet
  90. reading an eof simply means that it promises not to send any more
  91. data. It may still be perfectly fine receiving data (read "man 2
  92. shutdown"). In fact, some webservers work that way -- the client sends
  93. his entire request, and when the webserver reads an eof it begins
  94. its response. We currently don't support that sort of protocol; we
  95. may want to switch to some sort of a two-way-destry-ripple technique
  96. (where a destroy makes its way all the way to the end of the circuit
  97. before being echoed back, and data stops flowing only when a destroy
  98. has been received from both sides of the circuit); this extends the
  99. one-hop-ack approach that Matej used.
  100. * Reply onions. Hrm.