]> git.tuebingen.mpg.de Git - paraslash.git/commit
aft: Compare the full hash, not just the first 20 bytes.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 18 May 2025 18:12:24 +0000 (20:12 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Thu, 22 May 2025 16:46:48 +0000 (18:46 +0200)
commitd8b3632b22787757a4c2f4f4baee920f6d0eebd9
treeb4ad90a6bbf2f522aeb6c33d8b6d0f98577f2d8f
parent7ac6213907f3767f2ea0bd726e166cbce80bfa45
aft: Compare the full hash, not just the first 20 bytes.

In 0.7.0 the hash algorithm for the hash column of the audio file table
changed from the 20 byte sha1 to the 32 byte sha256. However, the audio file
selector kept calling hash_compare() as the comparator, which looks only at
the first 20 bytes of the buffers passed.

This omission is clearly a bug, but given that we still accept old clients
which only know about sha1, it's benign because the truncated sha256 should
not be worse than sha1. Fix the bug anyway.

Fixes: 126b950f1bd70d1e5c200bc4157bbbb2798fc838
aft.c