[tor-bugs] #7869 [Core Tor/Tor]: ntor-onion-key is padded with an equal sign

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue May 16 23:05:33 UTC 2017


#7869: ntor-onion-key is padded with an equal sign
-------------------------------------------------+-------------------------
 Reporter:  rransom                              |          Owner:
                                                 |  Jigsaw52
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  Low                                  |      Milestone:  Tor:
                                                 |  0.3.2.x-final
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  tor-relay, easy, intro,              |  Actual Points:
  tor-03-unspecified-201612                      |
Parent ID:                                       |         Points:
 Reviewer:  catalyst                             |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by Jigsaw52):

 * status:  needs_revision => needs_review


Comment:

 I followed your suggestion to use base64_encode_nopad() and changed the
 names of the constants to match the pattern used in #21872.

 By the way, I found an interesting bug on #21872. If you look closely at
 the following macros:

 {{{
 #define BASE64_NOPAD_LEN(n) (CEIL_DIV((n) * 4, 3)
 #define BASE32_NOPAD_LEN(n) (CEIL_DIV((n) * 8, 5)

 #define BASE64_NOPAD_BUFSIZE(n) (BASE64_NOPAD_LEN(n) + 1))
 #define BASE32_NOPAD_BUFSIZE(n) (BASE32_NOPAD_LEN(n) + 1))
 }}}

 You will notice that BASE64_NOPAD_LEN and BASE32_NOPAD_LEN are missing the
 closing parentheses.
 Also, BASE64_NOPAD_BUFSIZE and BASE32_NOPAD_BUFSIZE have one extra closing
 parentheses.
 If you use only BASE64_NOPAD_BUFSIZE and BASE32_NOPAD_BUFSIZE everything
 will be fine as both errors cancel each other out.

 I fixed this on my branch too but it should probably be fixed in a
 separate commit.

 The branch with all my changes merged into the current master is here:
 https://github.com/Jigsaw52/tor/tree/remove-padding-fix-7869_squashed

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


More information about the tor-bugs mailing list