shared: make sure foo.bar and foobar result in different domain name hashes
This also introduces a new macro siphash24_compress_byte() which is useful to add a single byte into the hash stream, and ports one user over to it.
This commit is contained in:
@@ -504,6 +504,7 @@ void dns_name_hash_func(const void *s, struct siphash *state) {
|
||||
|
||||
ascii_strlower_n(label, r);
|
||||
siphash24_compress(label, r, state);
|
||||
siphash24_compress_byte(0, state); /* make sure foobar and foo.bar result in different hashes */
|
||||
}
|
||||
|
||||
/* enforce that all names are terminated by the empty label */
|
||||
|
||||
Reference in New Issue
Block a user