1. 06 May, 2020 1 commit
    • Nick Mathewson's avatar
      Use __attribute__((fallthrough)) rather than magic GCC comments. · 79ff2b6a
      Nick Mathewson authored
      GCC added an implicit-fallthrough warning a while back, where it
      would complain if you had a nontrivial "case:" block that didn't end
      with break, return, or something like that.  Clang recently added
      the same thing.
      GCC, however, would let you annotate a fall-through as intended by
      any of various magic "/* fall through */" comments.  Clang, however,
      only seems to like "__attribute__((fallthrough))".  Fortunately, GCC
      accepts that too.
      A previous commit in this branch defined a FALLTHROUGH macro to do
      the right thing if GNUC is defined; here we replace all of our "fall
      through" comments with uses of that macro.
      This is an automated commit, made with the following perl one-liner:
        #!/usr/bin/perl -i -p
        s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
      (In order to avoid conflicts, I'm applying this script separately to
      each maint branch. This is the 0.4.1 version.)
  2. 05 Sep, 2019 1 commit
  3. 22 May, 2019 1 commit
    • David Goulet's avatar
      sendme: Properly record SENDMEs on both edges · 3835a3ac
      David Goulet authored and Nick Mathewson's avatar Nick Mathewson committed
      Turns out that we were only recording the "b_digest" but to have
      bidirectionnal authenticated SENDMEs, we need to use the "f_digest" in the
      forward cell situation.
      Because of the cpath refactoring, this commit plays with the crypt_path_ and
      relay_crypto_t API a little bit in order to respect the abstractions.
      Previously, we would record the cell digest as the SENDME digest in the
      decrypt cell function but to avoid code duplication (both directions needs to
      record), we now do that right after iff the cell is recognized (at the edge).
      It is now done in circuit_receive_relay_cell() instead.
      We now also record the cell digest as the SENDME digest in both relay cell
      encryption functions since they are split depending on the direction.
      relay_encrypt_cell_outbound() and relay_encrypt_cell_inbound() need to
      consider recording the cell digest depending on their direction (f vs b
      Fixes #30428
      Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
  4. 03 May, 2019 15 commits