[tor-bugs] #33919 [Core Tor/Tor]: Write unit tests for channel_matches_target_addr_for_extend()

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Apr 29 12:11:23 UTC 2020


#33919: Write unit tests for channel_matches_target_addr_for_extend()
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:  (none)
     Type:  task                                 |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.4.4.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  prop311, ipv6, technical-debt,       |  Actual Points:
  outreachy-ipv6, tests                          |
Parent ID:  #33048                               |         Points:  0.5
 Reviewer:  nickm                                |        Sponsor:
                                                 |  Sponsor55-can
-------------------------------------------------+-------------------------
Changes (by nickm):

 * status:  needs_review => needs_revision


Comment:

 I think this is mostly okay, except that this part makes me nervous.
 {{{
   channel_tls_t *tlschan = tor_malloc_zero(sizeof(*tlschan));
   or_connection_t *orcon = tor_malloc_zero(sizeof(*orcon));
 }}}

 It isn't creating a real channel or a real connection, but instead is
 creating a partially initialized version of each.  There's no actual
 guarantee in the rest of our code that this should work: it _happens_ to
 work, but that could change in the future.

 Maybe new_fake_channel() and free_fake_channel() would be a good choice
 for setting up  the channel-like object?

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


More information about the tor-bugs mailing list