aboutsummaryrefslogtreecommitdiff
path: root/src/rust/protover
AgeCommit message (Collapse)Author
2020-10-14Implement proposal 318: Limit protovers to 0..63Nick Mathewson
In brief: we go through a lot of gymnastics to handle huge protover numbers, but after years of development we're not even close to 10 for any of our current versions. We also have a convenient workaround available in case we ever run out of protocols: if (for example) we someday need Link=64, we can just add Link2=0 or something. This patch is a minimal patch to change tor's behavior; it doesn't take advantage of the new restrictions. Implements #40133 and proposal 318.
2020-02-10Fix a Rust compilation warning; resolve bug 33212.Nick Mathewson
2019-01-16Bump copyright date to 2019.Nick Mathewson
2018-11-15Merge branch 'bug27740_035_fix' into maint-0.3.5Nick Mathewson
2018-10-30Merge remote-tracking branch 'tor-github/pr/431' into maint-0.3.5Nick Mathewson
2018-10-30Merge remote-tracking branch 'tor-github/pr/431' into bug27740_035_fixNick Mathewson
2018-10-30remove now-unused "use" statement.Nick Mathewson
2018-10-30Merge remote-tracking branch 'tor-github/pr/381' into maint-0.3.5Nick Mathewson
2018-10-30Try to restore a proper fix for bug27740 in 0.3.5.Nick Mathewson
(I messed up the merge in 289a7dbac32a981897e12a3c250f0b6c67eec809.)
2018-10-23Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2018-10-23Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-10-19Merge remote-tracking branch 'onionk/rust-protocommas1' into maint-0.3.5Nick Mathewson
2018-10-01Remove rlib+staticlib configuration for Rust cratesAlex Crichton
Only the final crate needs to be a `staticlib`, no need for all the intermediate steps to produce staticlibs!
2018-09-24rust: run rustfmtcypherpunks
2018-09-24rust/protover: remove redundant ExceedsMax checkscypherpunks
This is already checked elsewhere.
2018-09-21rust/protover: return C-allocated string in protover_all_supported()cypherpunks
The result of CString::into_raw() is not safe to free with free() except under finicky and fragile circumstances that we definitely don't meet right now. This was missed in be583a34a3815c2c10e86094ab0610e4b7f9c869.
2018-09-21rust/protover: fix null deref in protover_all_supported()cypherpunks
Fortunately with the current callers it couldn't happen in practice. Fix on d1820c1516a31a149fc51a9e5126bf899e4c4e08.
2018-09-18Merge remote-tracking branch 'nickm/bug27741_033' into bug27741_035teor
Resolve conflicts due to rustfmt, and run rustfmt on the merged code.
2018-09-18Merge branch 'maint-0.3.4'Nick Mathewson
2018-09-18Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-17Remove extraneous argument from Rust protover_compute_vote()Nick Mathewson
This argument was added to match an older idea for the C api, but we decided not to do it that way in C. Fixes bug 27741; bugfix on 0.3.3.6 / TROVE-2018-005 fix.
2018-09-16Don't try to link C from rust doctests for nss detectionNick Mathewson
This is really annoying, since we can't use cfg(test) for doctests.
2018-09-16When Tor is compiled with NSS, don't claim support for LinkAuth=1Nick Mathewson
Closes ticket 27288
2018-09-15rust/protover: reject extra commascypherpunks
The C implementation had gotten this wrong too, in a slightly different way. Introduced in 5af03c1ef3c4718b79abb1638f5a8c275129530a. Fixes #27197; bugfix on 0.3.3.3-alpha.
2018-09-14rust/protover: delete ProtoSet::retaincypherpunks
As the comment noted, it was horribly inefficient.
2018-09-14rust/protover: use .and_not_in() instead of .retain() in all_supported()cypherpunks
.retain() would allocating a Vec of billions of integers and check them one at a time to separate the supported versions from the unsupported. This leads to a memory DoS. Closes ticket 27206. Bugfix on e6625113c98c281b0a649598d7daa347c28915e9.
2018-09-14rust/protover: add ProtoSet::and_not_in()cypherpunks
This is a way more efficient version of retain().
2018-09-14Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-14Merge branch 'rust-protokeyword1-034' into rust-protokeyword1-035cypherpunks
2018-09-14Merge branch 'rust-protokeyword1' into rust-protokeyword1-034cypherpunks
2018-09-13rust/protover: validate unknown protocol names use only allowed characterscypherpunks
2018-09-12Merge branch 'maint-0.3.4'Nick Mathewson
2018-09-12Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-09-12rust/protover: fix check for overlapping rangescypherpunks
Closes ticket 27649. Bugfix on e6625113c98c281b0a649598d7daa347c28915e9.
2018-09-12rust/protover: remove version zero from testscypherpunks
This isn't legal according to dir-spec.txt. We can write separate tests for it if the spec is changed to make it legal.
2018-08-17Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-08-17Merge branch 'maint-0.3.4'Nick Mathewson
2018-08-17Merge remote-tracking branch 'onionk/rust-protospace' into maint-0.3.3Nick Mathewson
2018-08-17rust/protover: don't accept whitespace in ProtoSet::from_str()cypherpunks
It's impossible for spaces to get here, since spaces are used as separators between individual protocol entries higher up. And it shouldn't ignore whitespace that isn't a literal space character, because that would differ from the C implementation. These were added in 9925d2e68709aa7346f4c5bc98ea1349df6741f3. Fixes #27177. Bugfix on 0.3.3.5-rc.
2018-08-17Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-08-17Merge branch 'maint-0.3.4'Nick Mathewson
2018-08-17rust/protover: fix hyphen parsing bug in ProtoSet::from_str()cypherpunks
It was parsing "1-2-3" as if it were 1-2, ignoring the 2nd hyphen and everything after. Introduced in d1820c1516a31a149fc51a9e5126bf899e4c4e08. Fixes #27164; bugfix on 0.3.3.1-alpha.
2018-08-17rust/protover: fix docs for UnvalidatedProtoEntry::from_strcypherpunks
This got shuffled around in b786b146edd33b025774819f54d7bba3d07bf832 and hasn't been accurate since 124caf28e6db1e7bf8cdfef25c55760c81fb91b5.
2018-08-17rust/protover: fix parsing docscypherpunks
The function takes an already validated utf-8 string, and it never checks if the version numbers are an empty string. That parse error happens later. Fix on 701c2b69f52cb4db46aa7455904e518b35fafc1a
2018-08-17rust/protover: fix ProtoEntry::from_str docscypherpunks
Texxt was copied from a function that returned a single tuple in 88b2f170e451567a3b0095a420544a675a5826b0.
2018-08-16rust: run rustfmtcypherpunks
2018-08-16rust/docs: fix critical typo for missing_docs lintcypherpunks
Fix typo from fe66d06a45a4714141eba992fe87ec3dd5fa1c22. The exclamation point is what lets an attribute apply to an entire crate, without the ! it's practically a placebo. Fix on commits af182d4ab51d6a1a70559bbdcd4ab842aa855684 and b6059297d7cb76f0e00e2098e38d6677d3033340, and note there are still missing docs in both crypto and protover, for now. https://doc.rust-lang.org/reference/attributes.html
2018-07-13Merge remote-tracking branch 'tor-github/pr/179'Nick Mathewson
2018-07-05Fix everything that previously referred to src/orNick Mathewson
2018-06-25Run rustfmt on 'src/rust/protover/ffi.rs'.Corey Farwell