| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
scan-build didn't like the unlimited version since we might need to
overflow size_t to hexify a string that took up half our address
space. (!)
|
|
|
|
|
|
|
|
|
|
|
|
| |
scan-build recognizes that in theory there could be a numeric overflow
here.
This can't numeric overflow can't trigger IRL, since in order to fill a
hash table with more than P=402653189 buckets with a reasonable load
factor of 0.5, we'd first have P/2 malloced objects to put in it--- and
each of those would have to take take at least sizeof(void*) worth of
malloc overhead plus sizeof(void*) content, which would run you out of
address space anyway on a 32-bit system.
|
|\ |
|
| |
| |
| |
| |
| | |
fixes bug 11426; bugfix on 0.2.5.3-alpha, where csiphash was
introduced.
|
|\ \
| |/
|/| |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
In digestmap_set/get benchmarks, doing unaligned access on x86
doesn't save more than a percent or so in the fast case. In the
slow case (where we cross a cache line), it could be pretty
expensive. It also makes ubsan unhappy.
|
| |
| |
| |
| | |
(This pulls in some fixes to tinytest_demo.c, which Tor doesn't build.)
|
| |
| |
| |
| |
| |
| |
| | |
This brings us to tinytest commit 709a36ba63ff16d8.
The only big change tor-side is that we don't need our own test_mem_op
operation any longer.
|
| |
| |
| |
| |
| |
| | |
Now a NULL argument to either makes it fail, not crash.
Fies bug 9004; bugfix on 0.2.2.4-alpha.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If you had a resolv.conf file with a nameserver line containing no
nameserver IP, we would crash. That's not terrible, but it's not
desirable.
Fixes bug 8788; bugfix on 0.1.1.23. Libevent already has this fix.
|
| | |
| | |
| | |
| | | |
This corrects a linker error on OpenBSD, where the function is called letoh64. See also http://git.kernel.org/cgit/docs/man-pages/man-pages.git/tree/man3/endian.3#n84.
|
|\ \ \ |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
This completes our conversion to using siphash for our hash functions.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I've made an exception for cases where I'm sure that users can't
influence the inputs. This is likely to cause a slowdown somewhere,
but it's safer to siphash everything and *then* look for cases to
optimize.
This patch doesn't actually get us any _benefit_ from siphash yet,
since we don't really randomize the key at any point.
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
siphash is a hash function designed for producing hard-to-predict
64-bit outputs from short inputs and a 128-bit key. It's chosen for
security and speed.
See https://131002.net/siphash/ for more information on siphash.
Source: https://github.com/majek/csiphash/
|
|\ \ \
| |/ /
|/| | |
|
| |/
| |
| |
| |
| |
| |
| | |
clang 3.4 introduced a new by-default warning about unused static
functions, which we triggered heavily for the hashtable and map function
generating macros. We can use __attribute__ ((unused)) (thanks nickm for
the suggestion :-) ) to silence these warnings.
|
|/
|
|
|
|
| |
- Preserve old eventdns code.
- Add function to close sockets cross-platform, without accounting.
- Add changes/ file.
|
| |
|
|
|
|
| |
(Based on a patch from flupzor; bug #8206)
|
|
|
|
| |
This will get it building on systems that lack stdint.h
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is meant to avoid conflict with the built-in log() function in
math.h. It resolves ticket 7599. First reported by dhill.
This was generated with the following perl script:
#!/usr/bin/perl -w -i -p
s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g;
s/\blog\(/tor_log\(/g;
|
| |
|
| |
|
|
|
|
| |
Fixes bug 7935. Reported by 'oftc_must_be_destroyed'.
|
|
|
|
|
| |
This now matches upstream at version 59a896970a1ad0a6cd7d0.
(Adam took my patches.)
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
There was one place in curve25519-donna-c64 that was relying on
unaligned access and relying on little-endian values. This patch
fixes that.
I've sent Adam a pull request.
|
| |
|
|
|
|
|
| |
This is copied from Adam Langley's curve25519-donna package, as
of commit 09427c9cab32075c06c3487aa01628030e1c5ae7.
|
|
|
|
|
|
| |
Otherwise we break openbsd headers.
Fixes bug 7293; bug not on any released Tor.
|
|
|
|
|
|
| |
Apparently winnt.h defines a different SLIST_ENTRY of its own.
Bug not in any version of Tor.
|
|
|
|
| |
See 7105
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There are as many divergent implementations of sys/queue.h as there
are operating systems shipping it, it would seem. They have some code
in common, but have drifted apart, and have added other stuff named
differently. So I'm taking a relatively sane one, and hoping for the
best.
I'm taking OpenBSD's in particular because of the lack of external
dependencies, the presence of a CIRCLEQ (we could use one of those in
places), and the liberal licensing terms.
I'm naming the file tor_queue.h, since historically we've run into
trouble having headers with the same names as system headers (log.h,
for example.)
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
My scripts missed it because it was in eventdns.c, which was in ext,
but it _was_ using one of our identifiers. That's probably because
eventdns.c has drifted a bit since we forked it.
I'm not going to fix the other reserved identifiers in eventdns.c,
since that would make it drift even more.
|
|\ \ |
|
| | | |
|
| |/
|/| |
|
| | |
|
| | |
|