[tor-bugs] #22840 [Core Tor/Tor]: Implement protover in Rust

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Oct 26 22:26:17 UTC 2017


#22840: Implement protover in Rust
-------------------------------------------------+-------------------------
 Reporter:  chelseakomlo                         |          Owner:
                                                 |  chelseakomlo
     Type:  enhancement                          |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.3.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  rust, protover, rust-pilot, review-  |  Actual Points:
  group-24                                       |
Parent ID:                                       |         Points:  3
 Reviewer:                                       |        Sponsor:
                                                 |  SponsorV
-------------------------------------------------+-------------------------

Comment (by chelseakomlo):

 Hey Nick- either way. I'm happy to fix up small things immediately as
 well, especially for C fixes.

 I pushed up commit `31a2dce30762fb12a00745af56a93784f8907a78` this morning
 to `git at github.com:chelseakomlo/tor_patches.git` branch `protover-rust-
 impl`. This has some `cargo fmt` fixes, if you wouldn't mind merging this
 as well. Sorry for pushing that so late!

 The reorganization of protover.c is because some of the unit tests in
 test_protover.c use static methods defined in protover.c.

 See line 34 and and 251 in protover.c in the patch. For example,
 `test_protover_parse` in test_protover.c uses `parse_protocol_list`.

 I also thought about copying private functions used by protover tests into
 test_protover.c, but then we have duplicated code. That might be a better
 solution in the short term instead of rearranging protover.c- I'm curious
 to hear your thoughts.

 Another thing I wanted to call out is that `src/rust/tor_allocate`
 borrowed heavily from Manish's earlier proof of concept. See
 `https://github.com/Manishearth/freestring`, `from_bytes_unchecked`.

 See you on IRC tomorrow!

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22840#comment:17>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list