]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Update RAR5 code to report encryption (#2096)
authorDuncan Horn <40036384+dunhor@users.noreply.github.com>
Fri, 11 Oct 2024 06:25:47 +0000 (23:25 -0700)
committerMartin Matuska <martin@matuska.de>
Sat, 12 Oct 2024 11:56:05 +0000 (13:56 +0200)
commitadee36b00b06a61f85fdc317fbfeab0db1d1d37c
tree068ee08ece20c2cda58d56c9e5ad43b451ec5e33
parentea0c0af085dc441174dcbf4ad9390494a93391cd
Update RAR5 code to report encryption (#2096)

Currently, the RAR5 code always reports
`ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED` for
`archive_read_has_encrypted_entries`, nor does it set any of the
entry-specific properties, even though it has enough information to
properly report this information. Accurate reporting of encryption is
super useful for applications because reporting an error message such as
"the archive is encrypted, but we don't currently support encryption" is
a lot better than a not generally useful `errno` value and a
non-localizable error string with a confusing and unpredictable error
message.

Fixes #1661

(cherry picked from commit 6177e4d0c0886010538bf91eea9bff2d0677baa7)
13 files changed:
Makefile.am
libarchive/archive_read_support_format_rar5.c
libarchive/test/CMakeLists.txt
libarchive/test/test_read_format_rar4_encrypted.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar4_encrypted_filenames.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar4_solid_encrypted.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar4_solid_encrypted_filenames.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar5_encrypted.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar5_encrypted_filenames.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar5_solid_encrypted.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar5_solid_encrypted_filenames.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar_encryption.c [new file with mode: 0644]
libarchive/test/test_write_format_zip_stream.c