]> git.ipfire.org Git - thirdparty/libarchive.git/commit
xar: Add support for SHA256 and SHA512 3328/head
authorDag-Erling Smørgrav <des@des.dev>
Mon, 27 Jul 2026 17:20:07 +0000 (19:20 +0200)
committerDag-Erling Smørgrav <des@des.dev>
Mon, 27 Jul 2026 17:28:21 +0000 (19:28 +0200)
commit6f10adcd5931af4533602e07fb8042414abe3e58
tree8d0a3b9d19c24aa8a4f11718359241a4fdc557fa
parent4d3bfca239b2e5a2b6370c22fec020b970bdb07e
xar: Add support for SHA256 and SHA512

Extend the xar reader and writer to understand the SHA256 (header
cksum_alg 3, 32 bytes, style "sha256") and SHA512 (cksum_alg 4, 64
bytes, style "sha512") checksum algorithms in addition to the existing
SHA1 and MD5.  These are the algorithm codes defined by the canonical
xar format, so archives written with them interoperate with Apple's xar,
pkgutil, and PackageKit.

Both the TOC ("toc-checksum") and per-file ("checksum") algorithms are
supported for writing.  New algorithm handling is guarded by
ARCHIVE_HAS_SHA256 / ARCHIVE_HAS_SHA512 so builds without those digests
are unaffected.  MAX_SUM_SIZE grows from 20 to 64 to hold a SHA512
digest.
libarchive/archive_read_support_format_xar.c
libarchive/archive_write_set_format_xar.c
libarchive/archive_write_set_options.3
libarchive/test/test_write_format_xar.c