[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #16980 [Tor]: Implicit time range assumption breaks Tor in Shadow
#16980: Implicit time range assumption breaks Tor in Shadow
----------------------------+--------------------------------
Reporter: robgjansen | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Tor | Version: Tor: 0.2.7.2-alpha
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
----------------------------+--------------------------------
Comment (by robgjansen):
If we can assume that `time_t` will always be signed, then we do something
like this:
{{{
/** As crypto_rand_int_range, but supports time_t. */
time_t
crypto_rand_time_range(time_t min, time_t max)
{
if(min < 0) min = 0;
if(max < 0) max = 0;
return (time_t) crypto_rand_uint64_range(min, max);
}
}}}
which works in Shadow. If we cannot assume time_t is always signed, then
we should change the three callers of `crypto_rand_time_range`.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16980#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs