Age | Commit message (Collapse) | Author |
|
The base64 and base32 functions used to be in crypto.c;
crypto_format.h had no header; some general-purpose functions were in
crypto_curve25519.c.
This patch makes a {crypto,util}_format.[ch], and puts more functions
there. Small modules are beautiful!
|
|
is broke
|
|
|
|
|
|
Also, fix some whitespace mishaps.
|
|
|
|
|
|
CID 1268070
|
|
|
|
This could trigger where _SIZEOF_ADDR_IFREQ() might not return a
multiple of sizeof(void *). Fixes bug 14875; not in any released version
of Tor.
|
|
If we guessed a buffer size too small, we never increased the buffer and
tried again
Also simplify the interface of ifreq_to_smartlist a little
|
|
Conflicts:
src/test/include.am
src/test/test.c
|
|
Now the code has separate implementation and examination functions,
uses smartlists sanely, and has relatively decent test coverage.
|
|
Signed-off-by: Andrea Shepard <andrea@torproject.org>
|
|
|
|
|
|
Otherwise we risk a subsequent memdup or memcpy copying
uninitialized RAM into some other place that might eventually expose
it. Let's make sure that doesn't happen.
Closes ticket 14041
|
|
|
|
Also, improve comments on resolve_my_address to explain what it
actually does.
|
|
|
|
Conflicts:
src/test/test_addr.c
|
|
Because in 95 years, we or our successors will surely care about
enforcing the BSD license terms on this code. Right?
|
|
|
|
Apparently some compilers want extra switches.
|
|
Since address.c is the first file to get compiled, let's have it use
a little judicious c99 in order to catch broken compilers that
somehow make it past our autoconf tests.
|
|
"The NULL pointer warnings on the return value of
tor_addr_to_in6_addr32() are incorrect. But clang can't work this
out itself due to limited analysis depth. To teach the analyser that
the return value is safe to dereference, I applied tor_assert to the
return value."
Patch from teor. Part of 13157.
|
|
Most of these are in somewhat non-obvious code where it is probably
a good idea to initialize variables and add extra assertions anyway.
Closes 13036. Patches from "teor".
|
|
The old cache had problems:
* It needed to be manually preloaded. (It didn't remember any
address you didn't tell it to remember)
* It was AF_INET only.
* It looked at its cache even if the sandbox wasn't turned on.
* It couldn't remember errors.
* It had some memory management problems. (You can't use memcpy
to copy an addrinfo safely; it has pointers in.)
This patch fixes those issues, and moves to a hash table.
Fixes bug 11970; bugfix on 0.2.5.1-alpha.
|
|
As documented, getaddrinfo always sets its result when it returns
no error. But scan-build doesn't know that, and thinks we might
be def
|
|
Conflicts:
src/common/address.c
src/or/config.c
|
|
(Not a bugfix on any Tor release; before 10801_024, it didn't handle
portless addresses at all.)
|
|
Conflicts:
src/or/dirserv.c
|
|
|
|
Fixes bug 10801; bugfix on 07bf274d in 0.2.0.1-alpha.
|
|
Most of these are simple. The only nontrivial part is that our
pattern for using ENUM_BF was confusing doxygen by making declarations
that didn't look like declarations.
|
|
ubsan doesn't like us to do (1u<<32) when 32 is wider than
unsigned. Fortunately, we already special-case
addr_mask_get_bits(0), so we can just change the loop bounds.
|
|
Fixes bug 7484. We've had this bug back in a8eaa79e031ee04d44 in
0.0.2pre14, when we first started allowing address masks.
|
|
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.
|
|
|
|
|
|
Patch from "hantwister" on trac. Fixes bug #9904; bugfix on
0.2.3.11-alpha.
|
|
|
|
macro fails to compile..
|
|
|
|
|
|
Conflicts:
src/test/test_addr.c
|
|
Fixes bug 8377; bugfix on 0.2.1.3-alpha.
|
|
|
|
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;
|
|
|