Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
The internal memory allocation and history object counters of the
reputation code can be used to verify the correctness of (part of) the
code. Using these counters revealed an issue where the memory allocation
counter is not decreased when the bandwidth arrays are freed.
A new function ensures the memory allocation counter is decreased when a
bandwidth array is freed.
This commit also removes an unnecessary cast which was found while
working on the code.
|
|
|
|
* Use smartlist_foreach_begin/end instead of a plain for loop.
* constify the pointers.
|
|
* Since the variable is no longer modified, it should be called
'policy' instead of 'dest'. ("Dest" is short for
"destination".)
* Fixed the space issue that dgoulet found on the ticket.
* Fixed the comment a little. (We use the imperative for function
documentation.)
|
|
|
|
This prevents a possible crash when memory is copied from a pointer to
NULL.
|
|
Some functions that use digest maps did not mention that the digests are
expected to have DIGEST_LEN bytes. This lead to buffer over-reads in the
past.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
There was a dead check when we made sure that an array member of a
struct was non-NULL. Tor has been doing this check since at least
0.2.3, maybe earlier.
Fixes bug 17781.
|
|
This commit fixes a memory leak introduced by commit
8b4e5b7ee902fb7fa07767410a18433d752c7aef.
|
|
|
|
Previously we'd suppressed the mask-bits field in the output when
formatting a policy if it was >=32. But that should be a >=128 if
we're talking about IPv6.
Since we didn't put these in descriptors, this bug affects only log
messages and controller outputs.
Fix for bug 16056. The code in question was new in 0.2.0, but the
bug was introduced in 0.2.4 when we started supporting IPv6 exits.
|
|
|
|
connection_get_by_type_addr_port_purpose also ignores connections
that are marked for close.
|
|
port is in host order (addr is tor_addr_t, endianness is abstracted).
addr and port can be different to conn->addr and conn->port if
connecting via a proxy.
|
|
|
|
|
|
Consistently ignore multicast addresses when automatically
generating reject private exit policies.
Closes ticket 17763. Bug fix on 10a6390deb3c9,
not in any released version of Tor. Patch by "teor".
|
|
Also fixup code style.
|
|
Move logging of redundant policy entries in
policies_parse_exit_policy_internal into its own function.
Closes ticket 17608; patch from "juce".
|
|
|
|
This memory leak only occurs when the Tor instance is not an exit node.
Fixes code introduced in 10a6390deb3c9ff9fbd8078fc812abf6c77ad67f.
|
|
|
|
The tor_cert_get_checkable_sig function uses the signing key included in
the certificate (if available) when a separate public key is not given.
When the signature is valid, the tor_cert_checksig function copies the
public key from the checkable structure to the public key field of the
certificate signing key.
In situations where the separate public key is not given but the
certificate includes a signing key, the source and destination pointers
in the copy operation are equal and invoke undefined behavior.
Undefined behaviour is avoided by ensuring both pointers are different.
|
|
|
|
|
|
|
|
|
|
Change the function names & comments to make the copying explicit.
|
|
|
|
|
|
|
|
|
|
|
|
These functions must really never fail; so have crypto_rand() assert
that it's working okay, and have crypto_seed_rng() demand that
callers check its return value. Also have crypto_seed_rng() check
RAND_status() before returning.
|
|
Stop ignoring ExitPolicyRejectPrivate in getinfo
exit-policy/reject-private. Fix a memory leak.
Set ExitPolicyRejectPrivate in the unit tests, and make a mock
function declaration static.
|
|
|
|
|
|
(If we take the branch above this assertion, than we *didn't* have a
v1 handshake. So if we don't take the branch, we did. So if we
reach this assertion, we must be running as a server, since clients
no longer attempt v1 handshakes.)
Fix for bug 17654; bugfix on 9d019a7db725dca3dfdbf8d4dbc3b51835e0b49e.
Bug not in any released Tor.
|
|
|
|
|
|
|