]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Enable Zstandard's checksum feature in the zstd write filter 2678/head
authorMostyn Bramley-Moore <mostyn@antipode.se>
Fri, 20 Jun 2025 12:39:28 +0000 (14:39 +0200)
committerMostyn Bramley-Moore <mostyn@antipode.se>
Fri, 20 Jun 2025 12:42:40 +0000 (14:42 +0200)
Note that this is not enabled when writing .zip or .7z archive formats,
because they already use their own checksums.

Implements #2675.

libarchive/archive_write_add_filter_zstd.c

index c0a6e5a37a6626db3136f12c00aa41f65ad69c3e..d4752c24715713ce3a017f1679677d590ae98e45 100644 (file)
@@ -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