Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-05-18 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  closed
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:  fixed
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+
Changes (by nickm):

 * status:  merge_ready => closed
 * resolution:   => fixed


Comment:

 Merged it; thanks!

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-05-17 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  merge_ready
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+
Changes (by catalyst):

 * status:  reopened => merge_ready


Comment:

 Oops, missed that you already had a branch with only the macro fixes in
 it.  Also I'm very amused at the bugs canceling each other out.

 Looks good to me; setting to merge_ready.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-05-16 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  reopened
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+

Comment (by catalyst):

 Thanks for finding that!  I'll probably cherry pick the macro fix
 individually and then put the rest of your #7869 patch in a separate
 commit, unless you want to split the commits yourself.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-05-16 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  reopened
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+

Comment (by arma):

 Good find!

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-05-16 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  reopened
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+
Changes (by Jigsaw52):

 * status:  closed => reopened
 * resolution:  implemented =>


Comment:

 I found a bug on these macro definitions while working on #7869:

 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.

 Here is my fix: https://github.com/Jigsaw52/tor/tree/baseXX-macro-
 fix-21872

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-07 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  closed
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:  implemented
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+
Changes (by nickm):

 * status:  needs_review => closed
 * resolution:   => implemented


Comment:

 Added tests for basexx size apis in
 30b13fd82e243713c6a0d7bfbfc97d5faf8ee9c8.

 Merged; tests were okay.

 Added an additional warning in the comments in
 1e54bdd48a5deec7c1c4a0a167fb5abe312c8458.

 Pushed to master.

 Thanks!

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-07 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  needs_review
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+

Comment (by dgoulet):

 This looks good to me!

 Quick question, do we have unit tests for those baseXX APIs? I'm asking
 because some `tor_assert()` are being added like `tor_assert(destlen >=
 BASE16_BUFSIZE(srclen));` which look safe but still useful to make sure
 tor code will not blow up there :).

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-07 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  needs_review
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+
Changes (by dgoulet):

 * status:  new => needs_review


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-06 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+

Comment (by catalyst):

 Proposed patches at https://gitlab.com/argonblue/tor/merge_requests/2

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-05 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+

Comment (by nickm):

 BUFSIZE sounds good

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-05 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+

Comment (by catalyst):

 That's a good point. I'd like to keep the macro names short, especially if
 they're going to end up in array declarations. Maybe something like
 `BASEXX_BUFSIZE()`?

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-05 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal| Resolution:
 Keywords:  util  |  Actual Points:
Parent ID:  #19531| Points:
 Reviewer:|Sponsor:
--+

Comment (by nickm):

 I like this idea, except that SIZE vs LEN seems a bit error-prone.  how
 about ALLOC_SIZE instead of SIZE()?

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

[tor-bugs] #21872 [Core Tor/Tor]: encoded length macros for baseXX encodings

2017-04-05 Thread Tor Bug Tracker & Wiki
#21872: encoded length macros for baseXX encodings
--+
 Reporter:  catalyst  |  Owner:  catalyst
 Type:  enhancement   | Status:  new
 Priority:  Medium|  Milestone:  Tor: 0.3.1.x-final
Component:  Core Tor/Tor  |Version:
 Severity:  Normal|   Keywords:  util
Actual Points:|  Parent ID:  #19531
   Points:|   Reviewer:
  Sponsor:|
--+
 It can be useful to have macros that give the lengths of byte strings
 encoded with baseXX, particularly for declaring fixed-size buffers. Some
 use cases will need to include a terminating NUL, others not. These macros
 won't check for overflow, so nothing should pass untrusted inputs to them.

 I propose macros named like `BASE64_LEN()` for the raw length and like
 `BASE64_SIZE()` for the length with NUL.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs