Skip to content
Snippets Groups Projects
  1. Jan 15, 2011
  2. Jan 12, 2011
  3. Jan 10, 2011
    • Nick Mathewson's avatar
      Pull up more data when parsing socks messages · aa45e825
      Nick Mathewson authored
      Previously, we only looked at up to 128 bytes.  This is a bad idea
      since socks messages can be at least 256+x bytes long.  Now we look at
      up to 512 bytes; this should be enough for 0.2.2.x to handle all valid
      SOCKS messages.  For 0.2.3.x, we can think about handling trickier
      cases.
      
      Fixes 2330.  Bugfix on 0.2.0.16-alpha.
      aa45e825
    • Nick Mathewson's avatar
    • Nick Mathewson's avatar
      Always nul-terminate the result passed to evdns_server_add_ptr_reply · bd67b23f
      Nick Mathewson authored
      In dnsserv_resolved(), we carefully made a nul-terminated copy of the
      answer in a PTR RESOLVED cell... then never used that nul-terminated
      copy.  Ouch.
      
      Surprisingly this one isn't as huge a security problem as it could be.
      The only place where the input to dnsserv_resolved wasn't necessarily
      nul-terminated was when it was called indirectly from relay.c with the
      contents of a relay cell's payload.  If the end of the payload was
      filled with junk, eventdns.c would take the strdup() of the name [This
      part is bad; we might crash there if the cell is in a bad part of the
      stack or the heap] and get a name of at least length
      495[*]. eventdns.c then rejects any name of length over 255, so the
      bogus data would be neither transmitted nor altered.
      
        [*] If the name was less than 495 bytes long, the client wouldn't
           actually be reading off the end of the cell.
      
      Nonetheless this is a reasonably annoying bug.  Better fix it.
      
      Found while looking at bug 2332, reported by doorss.  Bugfix on
      0.2.0.1-alpha.
      bd67b23f
    • Nick Mathewson's avatar
      Impose maximum sizes on parsed objects · 373a1bc4
      Nick Mathewson authored
      An object, you'll recall, is something between -----BEGIN----- and
      -----END----- tags in a directory document.  Some of our code, as
      doorss has noted in bug 2352, could assert if one of these ever
      overflowed SIZE_T_CEILING but not INT_MAX.  As a solution, I'm setting
      a maximum size on a single object such that neither of these limits
      will ever be hit.  I'm also fixing the INT_MAX checks, just to be sure.
      373a1bc4
    • Karsten Loesing's avatar
    • Nick Mathewson's avatar
      Fix check for failed evdns request creation · 68d5b6bc
      Nick Mathewson authored
      When using libevent 2, we use evdns_base_resolve_*().  When not, we
      fake evdns_base_resolve_*() using evdns_resolve_*().
      
      Our old check was looking for negative values (like libevent 2
      returns), but our eventdns.c code returns 1.  This code makes the
      check just test for nonzero.
      
      Note that this broken check was not for _resolve_ failures or even for
      failures to _launch_ a resolve: it was for failures to _create_ or
      _encode_ a resolve request.
      
      Bug introduced in 81eee0ec; found by
      lodger; uploaded to trac by rransom.  Bug 2363.  Fix on 0.2.2.6-alpha.
      68d5b6bc
  4. Jan 09, 2011
  5. Jan 07, 2011
  6. Jan 05, 2011
  7. Jan 03, 2011
  8. Dec 27, 2010
  9. Dec 17, 2010
  10. Dec 16, 2010
  11. Dec 08, 2010
  12. Dec 07, 2010
  13. Dec 06, 2010
    • Nick Mathewson's avatar
      Fix a bug in calculating wakeup time on 64-bit machines. · dc2f10bd
      Nick Mathewson authored
      If you had TIME_MAX > INT_MAX, and your "time_to_exhaust_bw =
      accountingmax/expected_bandwidth_usage * 60" calculation managed to
      overflow INT_MAX, then your time_to_consider value could underflow and
      wind up being rediculously low or high.  "Low" was no problem;
      negative values got caught by the (time_to_consider <= 0) check.
      "High", however, would get you a wakeup time somewhere in the distant
      future.
      
      The fix is to check for time_to_exhaust_bw overflowing INT_MAX, not
      TIME_MAX: We don't allow any accounting interval longer than a month,
      so if time_to_exhaust_bw is significantly larger than 31*24*60*60, we
      can just clip it.
      
      This is a bugfix on 0.0.9pre6, when accounting was first introduced.
      It fixes bug 2146, unless there are other causes there too.  The fix
      is from boboper.  (I tweaked it slightly by removing an assignment
      that boboper marked as dead, and lowering a variable that no longer
      needed to be function-scoped.)
      dc2f10bd
    • Nick Mathewson's avatar
      Add a missing ! to directory_fetches_from_authorities · feffbce8
      Nick Mathewson authored
      The old logic would have us fetch from authorities if we were refusing
      unknown exits and our exit policy was reject*.  Instead, we want to
      fetch from authorities if we're refusing unknown exits and our exit
      policy is _NOT_ reject*.
      
      Fixed by boboper.  Fixes more of 2097.  Bugfix on 0.2.2.16-alpha.
      feffbce8
  14. Dec 03, 2010
    • Nick Mathewson's avatar
      Don't crash when accountingmax is set in non-server Tors · c0f1517d
      Nick Mathewson authored
      We use a hash of the identity key to seed a prng to tell when an
      accounting period should end.  But thanks to the bug998 changes,
      clients no longer have server-identity keys to use as a long-term seed
      in accounting calculations.  In any case, their identity keys (as used
      in TLS) were never never fixed.  So we can just set the wakeup time
      from a random seed instead there.  Still open is whether everybody
      should be random.
      
      This patch fixes bug 2235, which was introduced in 0.2.2.18-alpha.
      
      Diagnosed with help from boboper on irc.
      c0f1517d
  15. Dec 02, 2010
  16. Dec 01, 2010
  17. Nov 29, 2010
  18. Nov 24, 2010
Loading