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:
Lennart Poettering
2016-01-11 19:39:59 +01:00
parent 758dd67e8d
commit d51155663a
3 changed files with 6 additions and 2 deletions
+1
View File
@@ -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 */