From: Andre Noll Date: Sun, 18 May 2025 18:12:24 +0000 (+0200) Subject: aft: Compare the full hash, not just the first 20 bytes. X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=d8b3632b22787757a4c2f4f4baee920f6d0eebd9;p=paraslash.git 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 --- diff --git a/aft.c b/aft.c index b10e7bd1..89739356 100644 --- a/aft.c +++ b/aft.c @@ -216,7 +216,7 @@ enum audio_file_table_columns { static int aft_hash_compare(const struct osl_object *obj1, const struct osl_object *obj2) { - return hash_compare((unsigned char *)obj1->data, + return hash2_compare((unsigned char *)obj1->data, (unsigned char *)obj2->data); }