summaryrefslogtreecommitdiff
path: root/src/rust
AgeCommit message (Collapse)Author
2018-10-30Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-10-30Merge remote-tracking branch 'tor-github/pr/346' into maint-0.3.3Nick Mathewson
2018-10-23Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
2018-10-23Remove a now-unused rust "use".Nick Mathewson
2018-10-23Merge branch 'maint-0.3.3' into maint-0.3.4Nick Mathewson
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 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-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-13rust/protover: validate unknown protocol names use only allowed characterscypherpunks
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-21Merge remote-tracking branch 'teor/travis-osx-034' into maint-0.3.4Nick Mathewson
2018-08-21Merge remote-tracking branch 'teor/travis-osx-033' into maint-0.3.3Nick Mathewson
2018-08-17Merge branch 'maint-0.3.3' into maint-0.3.4Nick 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-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-10Merge branch 'travis-osx-033' into travis-osx-034teor
Replace 034 .travis.yml with 033 .travis.yml. Subsequent commits will restore 034 functionality. Replace 034 src/test/test_rust.sh with 033 src/test/test_rust.sh, which was backported from master.
2018-08-10Stop setting $CARGO_HOME in src/rust/tor_rust/include.amteor
cargo will use the user's $CARGO_HOME, or $HOME/.cargo by default. Fixes bug 26497; bugfix on 0.3.1.5-alpha.
2018-06-27Fix Rust cross compilation.Alex Xu (Hello71)
2018-06-20add build.rs to EXTRA_DISTNick Mathewson
2018-06-20Fix memory leak in CryptoDigest typeNick Mathewson
If you're owning a C pointer, you need to implement Drop.
2018-06-20Disable doctests in src/rust/crypto module.Nick Mathewson
These all need C linking to work, and so far, rustdoc does not seem to respect cargo setting about build scripts or RUSTOPTIONS.
2018-06-20Fix bugs in rust digest testsNick Mathewson
2018-06-20Merge branch 'rust_build_script_v3' into additional_rust_test_fixesNick Mathewson
2018-06-20rust: Remove redundant "testing" feature from tor_log crate.Isis Lovecruft
It was synonymous with the builtin "test" feature. * FIXES #26399: https://bugs.torproject.org/26399
2018-06-19Fix compilation of Rust crypto doctestsTaylor Yu
The doctests for src/rust/crypto don't compile for multiple reasons, including some missing exports and incorrect identifier paths. Fixes bug 26415; bugfix on 0.3.4.1-alpha.
2018-06-19Use a rust build script to set linker options correctly for tests.Nick Mathewson
We need this trick because some of our Rust tests depend on our C code, which in turn depend on other native libraries, which thereby pulls a whole mess of our build system into "cargo test". To solve this, we add a build script (build.rs) to set most of the options that we want based on the contents of config.rust. Some options can't be set, and need to go to the linker directly: we use a linker replacement (link_rust.sh) for these. Both config.rust and link_rust.sh are generated by autoconf for us. This patch on its own should enough to make the crypto test build, but not necessarily enough to make it pass.
2018-06-18Revert "Remove duplicate MODULE_DIRAUTH_SOURCES from libtor_testing.a"Nick Mathewson
This reverts commit 70d91bd059869a0ecf24ceb66942ada4f66f03c9.
2018-06-18Remove duplicate MODULE_DIRAUTH_SOURCES from libtor_testing.aNick Mathewson
This was already added to LIBTOR_A_SOURCES; it doesn't need to get added again. Fixes bug 26402. Bugfix on 0.3.4.1-alpha.
2018-06-16Changes to make the rust crypto::mod tests compileNick Mathewson
The digest tests don't link yet, though.
2018-06-16Merge remote-tracking branch 'isis/bug26267' into maint-0.3.4Nick Mathewson
2018-06-16Merge remote-tracking branch 'isis/bug26245' into maint-0.3.4Nick Mathewson
2018-06-15rust: Remove unused N_DIGEST_ALGORITHMS constant from crypto_digest.rs.Isis Lovecruft
In the C code, this constant is only ever used in src/test/bench.c. * FIXES part of #26245: https://bugs.torproject.org/26245
2018-06-15rust: Add comment and pragma on "unused" smartlist_t type.Isis Lovecruft
* FIXES part of #26245: https://bugs.torproject.org/26245
2018-06-15Make Rust warnings conditionally fatalTaylor Yu
Set rustc flags to treat warnings as fatal if configured with --enable-warnings.
2018-06-15rust: Expose rand module from crypto crate.Isis Lovecruft
2018-06-15Set default-features = false for rand_coreTaylor Yu
Apparently rand and rand_core need to be built with the "std" feature set consistently, or there will be a compile error in rngs/jitter.rs.
2018-05-22Merge branch 'maint-0.3.3'Nick Mathewson
2018-05-22Make the TROVE-2018-005 fix work with rust.Nick Mathewson
2018-05-22rust: Mirror TROVE-2018-005 fix in Rust protover implementation.Isis Lovecruft
* REFACTORS `UnvalidatedProtoEntry::from_str` to place the bulk of the splitting/parsing logic in to a new `UnvalidatedProtoEntry::parse_protocol_and_version_str()` method (so that both `from_str()` and `from_str_any_len()` can call it.) * ADD a new `UnvalidatedProtoEntry::from_str_any_len()` method in order to maintain compatibility with consensus methods older than 29. * ADD a limit on the number of characters in a protocol name. * FIXES part of #25517: https://bugs.torproject.org/25517
2018-05-22rust: Mirror TROVE-2018-005 fix in Rust protover implementation.Isis Lovecruft
* REFACTORS `UnvalidatedProtoEntry::from_str` to place the bulk of the splitting/parsing logic in to a new `UnvalidatedProtoEntry::parse_protocol_and_version_str()` method (so that both `from_str()` and `from_str_any_len()` can call it.) * ADD a new `UnvalidatedProtoEntry::from_str_any_len()` method in order to maintain compatibility with consensus methods older than 29. * ADD a limit on the number of characters in a protocol name. * FIXES part of #25517: https://bugs.torproject.org/25517
2018-05-16Merge remote-tracking branch 'isis-github/bug26106'Nick Mathewson