diff options
author | Cameron Katri <me@cameronkatri.com> | 2022-06-16 10:17:00 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2022-06-16 10:21:50 -0400 |
commit | 9ef2c4a87d6fa816639b610313b67b98e983388a (patch) | |
tree | f3c5d259a3e0b87c5301ddf23b3185b4de9fbe9f /remove.c | |
parent | 6a5be2524f0d31a601687e8b5d09b9af92848dac (diff) | |
download | trustcache-main.tar.gz trustcache-main.tar.zst trustcache-main.zip |
Thanks to Linus Henze for reversing the new format
https://gist.github.com/LinusHenze/4cd5d7ef057a144cda7234e2c247c056
Diffstat (limited to 'remove.c')
-rw-r--r-- | remove.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -89,6 +89,13 @@ tcremove(int argc, char **argv) numremoved++; continue; } + } else if (cache.version == 2) { + if (memcmp(cache.entries2[j].cdhash, hash, CS_CDHASH_LEN) == 0) { + memmove(&cache.entries2[j], &cache.entries2[j + 1], (cache.num_entries - j - 1) * sizeof(struct trust_cache_entry2)); + cache.num_entries--; + numremoved++; + continue; + } } j++; } |