mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Use siphash on channel/circuit-id map too
Fixes ticket 11750.
This commit is contained in:
parent
388478561d
commit
8127f4db30
5
changes/bug11750
Normal file
5
changes/bug11750
Normal file
@ -0,0 +1,5 @@
|
||||
o Minor features (security):
|
||||
- Apply the secure SipHash-2-4 function to the hash table mapping
|
||||
circuit IDs and channels to circuits. We missed this one when we
|
||||
were converting all the other hash functions to use SipHash back
|
||||
in 0.2.5.3-alpha. Resolves ticket 11750.
|
@ -76,7 +76,14 @@ chan_circid_entries_eq_(chan_circid_circuit_map_t *a,
|
||||
static INLINE unsigned int
|
||||
chan_circid_entry_hash_(chan_circid_circuit_map_t *a)
|
||||
{
|
||||
return ((unsigned)a->circ_id) ^ (unsigned)(uintptr_t)(a->chan);
|
||||
struct {
|
||||
void *chan;
|
||||
circid_t circid;
|
||||
} s;
|
||||
memset(&s, 0, sizeof(s));
|
||||
s.chan = a->chan;
|
||||
s.circid = a->circ_id;
|
||||
return (unsigned) siphash24g(&s, sizeof(s));
|
||||
}
|
||||
|
||||
/** Map from [chan,circid] to circuit. */
|
||||
|
Loading…
Reference in New Issue
Block a user