[tor-bugs] #24658 [Core Tor/Tor]: Split/refactor crypto.h into smaller separate modules

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Jan 12 16:02:12 UTC 2018


#24658: Split/refactor crypto.h into smaller separate modules
-------------------------------------------------+-------------------------
 Reporter:  isis                                 |          Owner:  (none)
     Type:  enhancement                          |         Status:
                                                 |  needs_revision
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.3.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-crypto, refactor, review-        |  Actual Points:
  group-29                                       |
Parent ID:                                       |         Points:
 Reviewer:                                       |        Sponsor:
                                                 |  Sponsor8-can
-------------------------------------------------+-------------------------
Changes (by nickm):

 * status:  needs_review => needs_revision


Comment:

 Looks like a good start!  I have some suggestions.

  1) Let's rename the new file to crypto_openssl_mgt or
 crypto_openssl_setup or something?  We might someday want to have a
 crypto_openssl file that is not openssl management, but that contains
 openssl backends.

  2) `free_openssl()` is not our usual naming style; something more like
 `crypto_openssl_free_all()` would be more like what we usually do.

  3) n_openssl_mutexes and openssl_mutexes should not be globals declared
 in the header.  They should remain static variables. (Doing it like that
 doesn't work the way you expect in C, I think.)

  4) The functions that used to be static should not become nonstatic,
 except maybe for setup_openssl_threading().  The others can all be static
 in their new module, I think?

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


More information about the tor-bugs mailing list