mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
Mention the expected length of the digests
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.
This commit is contained in:
parent
3dcb7320cf
commit
fbdd32ebe9
2 changed files with 6 additions and 6 deletions
|
@ -321,9 +321,9 @@ rend_cache_failure_purge(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Lookup the rend failure cache using a relay identity digest in
|
/** Lookup the rend failure cache using a relay identity digest in
|
||||||
* <b>identity</b> and service ID <b>service_id</b>. If found, the intro
|
* <b>identity</b> which has DIGEST_LEN bytes and service ID <b>service_id</b>
|
||||||
* failure is set in <b>intro_entry</b> else it stays untouched. Return 1
|
* which is a null-terminated string. If found, the intro failure is set in
|
||||||
* iff found else 0. */
|
* <b>intro_entry</b> else it stays untouched. Return 1 iff found else 0. */
|
||||||
STATIC int
|
STATIC int
|
||||||
cache_failure_intro_lookup(const uint8_t *identity, const char *service_id,
|
cache_failure_intro_lookup(const uint8_t *identity, const char *service_id,
|
||||||
rend_cache_failure_intro_t **intro_entry)
|
rend_cache_failure_intro_t **intro_entry)
|
||||||
|
|
|
@ -4034,9 +4034,9 @@ router_exit_policy_rejects_all(const routerinfo_t *router)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Create an directory server at <b>address</b>:<b>port</b>, with OR identity
|
/** Create an directory server at <b>address</b>:<b>port</b>, with OR identity
|
||||||
* key <b>digest</b>. If <b>address</b> is NULL, add ourself. If
|
* key <b>digest</b> which has DIGEST_LEN bytes. If <b>address</b> is NULL,
|
||||||
* <b>is_authority</b>, this is a directory authority. Return the new
|
* add ourself. If <b>is_authority</b>, this is a directory authority. Return
|
||||||
* directory server entry on success or NULL on failure. */
|
* the new directory server entry on success or NULL on failure. */
|
||||||
static dir_server_t *
|
static dir_server_t *
|
||||||
dir_server_new(int is_authority,
|
dir_server_new(int is_authority,
|
||||||
const char *nickname,
|
const char *nickname,
|
||||||
|
|
Loading…
Add table
Reference in a new issue