Skip to content
Snippets Groups Projects
  1. Apr 13, 2018
  2. Apr 12, 2018
  3. Apr 11, 2018
  4. Apr 10, 2018
  5. Apr 09, 2018
  6. Apr 06, 2018
  7. Apr 05, 2018
  8. Apr 04, 2018
  9. Apr 03, 2018
  10. Apr 02, 2018
    • Isis Lovecruft's avatar
      rust: Fix ProtoSet and ProtoEntry to use the same DoS limits as C. · c65088cb
      Isis Lovecruft authored
      Previously, the limit for MAX_PROTOCOLS_TO_EXPAND was actually being applied
      in Rust to the maximum number of version (total, for all subprotocols).
      Whereas in C, it was being applied to the number of subprotocols that were
      allowed.  This changes the Rust to match C's behaviour.
      c65088cb
    • Isis Lovecruft's avatar
      rust: Port all C protover_all_supported tests to Rust. · 4b4e36a4
      Isis Lovecruft authored
      The behaviours still do not match, unsurprisingly, but now we know where a
      primary difference is: the Rust is validating version ranges more than the C,
      so in the C it's possible to call protover_all_supported on a ridiculous
      version range like "Sleen=0-4294967294" because the C uses
      MAX_PROTOCOLS_TO_EXPAND to count the number of *subprotocols* whereas the Rust
      uses it to count the total number of *versions* of all subprotocols.
      4b4e36a4
    • Isis Lovecruft's avatar
      tests: Run all existing protover tests in both languages. · 6739a69c
      Isis Lovecruft authored
      There's now no difference in these tests w.r.t. the C or Rust: both
      fail miserably (well, Rust fails with nice descriptive errors, and C
      gives you a traceback, because, well, C).
      6739a69c
    • Isis Lovecruft's avatar
      tests: Make inline comments in test_protover.c more accurate. · f769edd1
      Isis Lovecruft authored
      The DoS potential is slightly higher in C now due to some differences to the
      Rust code, see the C_RUST_DIFFERS tags in src/rust/protover/tests/protover.rs.
      
      Also, the comment about "failing at the splitting stage" in Rust wasn't true,
      since when we split, we ignore empty chunks (e.g. "1--1" parses into
      "(1,None),(None,1)" and "None" can't be parsed into an integer).
      
      Finally, the comment about "Rust seems to experience an internal error" is only
      true in debug mode, where u32s are bounds-checked at runtime.  In release mode,
      code expressing the equivalent of this test will error with
      `Err(ProtoverError::Unparseable)` because 4294967295 is too large.
      f769edd1
Loading