]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'isis/bug25185'
authorNick Mathewson <nickm@torproject.org>
Fri, 16 Feb 2018 01:35:30 +0000 (20:35 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 16 Feb 2018 01:35:30 +0000 (20:35 -0500)
1  2 
src/rust/protover/protover.rs

index e5dc69b9a0941ffaeaaab555538bb362414b824b,e9fcdddd9b673fbc97dff54a18da2ee5c2d103bf..03776411ca047416f48ba1218b1f5181b79dec75
@@@ -9,10 -10,7 +10,8 @@@ use std::fmt
  use std::collections::{HashMap, HashSet};
  use std::ops::Range;
  use std::string::String;
 +use std::u32;
  
- use tor_util::strings::NUL_BYTE;
  /// The first version of Tor that included "proto" entries in its descriptors.
  /// Authorities should use this to decide whether to guess proto lines.
  ///
@@@ -24,32 -22,8 +23,8 @@@ const FIRST_TOR_VERSION_TO_ADVERTISE_PR
  /// before concluding that someone is trying to DoS us
  ///
  /// C_RUST_COUPLED: src/or/protover.c `MAX_PROTOCOLS_TO_EXPAND`
 -const MAX_PROTOCOLS_TO_EXPAND: u32 = 500;
 +const MAX_PROTOCOLS_TO_EXPAND: usize = (1<<16);
  
- /// Currently supported protocols and their versions, as a byte-slice.
- ///
- /// # Warning
- ///
- /// This byte-slice ends in a NUL byte.  This is so that we can directly convert
- /// it to an `&'static CStr` in the FFI code, in order to hand the static string
- /// to C in a way that is compatible with C static strings.
- ///
- /// Rust code which wishes to accesses this string should use
- /// `protover::get_supported_protocols()` instead.
- ///
- /// C_RUST_COUPLED: src/or/protover.c `protover_get_supported_protocols`
- pub(crate) const SUPPORTED_PROTOCOLS: &'static [u8] =
-     b"Cons=1-2 \
-     Desc=1-2 \
-     DirCache=1-2 \
-     HSDir=1-2 \
-     HSIntro=3-4 \
-     HSRend=1-2 \
-     Link=1-5 \
-     LinkAuth=1,3 \
-     Microdesc=1-2 \
-     Relay=1-2\0";
  /// Known subprotocols in Tor. Indicates which subprotocol a relay supports.
  ///
  /// C_RUST_COUPLED: src/or/protover.h `protocol_type_t`