pt: Reject a pluggable transport named Bridge
https://gitlab.torproject.org/tpo/core/torspec/-/merge_requests/91
This commit is contained in:
parent
102a663907
commit
278425321d
|
@ -136,6 +136,7 @@ fn is_well_formed_id(s: &str) -> bool {
|
|||
if let Some(first) = bytes.next() {
|
||||
(first.is_ascii_alphabetic() || first == b'_')
|
||||
&& bytes.all(|b| b.is_ascii_alphanumeric() || b == b'_')
|
||||
&& !s.eq_ignore_ascii_case("bridge")
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
@ -372,6 +373,10 @@ mod test {
|
|||
TransportId::from_str("12345"),
|
||||
Err(TransportIdError::BadId(_))
|
||||
));
|
||||
assert!(matches!(
|
||||
TransportId::from_str("bridge"),
|
||||
Err(TransportIdError::BadId(_))
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in New Issue