From: Mostyn Bramley-Moore Date: Fri, 20 Jun 2025 12:39:28 +0000 (+0200) Subject: Enable Zstandard's checksum feature in the zstd write filter X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2678%2Fhead;p=thirdparty%2Flibarchive.git Enable Zstandard's checksum feature in the zstd write filter Note that this is not enabled when writing .zip or .7z archive formats, because they already use their own checksums. Implements #2675. --- diff --git a/libarchive/archive_write_add_filter_zstd.c b/libarchive/archive_write_add_filter_zstd.c index c0a6e5a37..d4752c247 100644 --- a/libarchive/archive_write_add_filter_zstd.c +++ b/libarchive/archive_write_add_filter_zstd.c @@ -391,6 +391,8 @@ archive_compressor_zstd_open(struct archive_write_filter *f) ZSTD_CCtx_setParameter(data->cstream, ZSTD_c_nbWorkers, data->threads); + ZSTD_CCtx_setParameter(data->cstream, ZSTD_c_checksumFlag, 1); + #if ZSTD_VERSION_NUMBER >= MINVER_LONG ZSTD_CCtx_setParameter(data->cstream, ZSTD_c_windowLog, data->long_distance); #endif