]> wimlib.net Git - wimlib/log
wimlib
12 months agolibFuzzer: add xml_windows fuzzer
Eric Biggers [Sun, 9 Apr 2023 19:39:48 +0000 (12:39 -0700)]
libFuzzer: add xml_windows fuzzer

12 months agolibFuzzer: increase max_len from 4K to 32K
Eric Biggers [Sun, 9 Apr 2023 19:39:48 +0000 (12:39 -0700)]
libFuzzer: increase max_len from 4K to 32K

12 months agoFix wlfuzz and enable in CI
Eric Biggers [Sun, 9 Apr 2023 18:39:36 +0000 (11:39 -0700)]
Fix wlfuzz and enable in CI

- Fix build failure on Linux by linking with the math library.

- Don't hard-code the temporary directory to E:\ on Windows.

- Relax some comparisons that don't work reliably on Windows:
   - Security descriptor
   - Last access time
   - Sparse file attribute (clear only)

- Relax the timestamp comparisons when running on an ext4 filesystem,
  since ext4 doesn't support the full timestamp range that Windows does.
  Also, generate more timestamps that are close to the present date.

- Make the command-line argument give the number of seconds to run,
  rather than the number of iterations.  This makes it possible to run
  wlfuzz for 2 minutes in GitHub Actions, like the libFuzzer jobs.

- Increase coverage by using a different random seed on each run.

- Make wlfuzz initialize wimlib with STRICT_{CAPTURE,APPLY}_PRIVILIGES
  on Windows.  I.e., don't allow running wlfuzz as non-Administrator.

- Print security descriptors and timestamps when they differ.

- Add GitHub Actions jobs that run wlfuzz on Linux and Windows.

12 months agowin32_apply: retry creating hard links
Eric Biggers [Sun, 9 Apr 2023 18:39:36 +0000 (11:39 -0700)]
win32_apply: retry creating hard links

13 months agowimoptimize.1: fix ESD => WIM example
Eric Biggers [Tue, 4 Apr 2023 05:40:41 +0000 (22:40 -0700)]
wimoptimize.1: fix ESD => WIM example

13 months agowimoptimize: better defaults for WIM <=> ESD
Eric Biggers [Mon, 3 Apr 2023 05:36:40 +0000 (22:36 -0700)]
wimoptimize: better defaults for WIM <=> ESD

Resolves https://wimlib.net/forums/viewtopic.php?t=508
Resolves https://wimlib.net/forums/viewtopic.php?t=654

13 months agowimupdate: add --ref option for updating delta WIMs
Eric Biggers [Sun, 2 Apr 2023 19:32:46 +0000 (12:32 -0700)]
wimupdate: add --ref option for updating delta WIMs

Resolves https://wimlib.net/forums/viewtopic.php?t=450

13 months agomount_image.c: call file_contents_changed() on extending truncates
Eric Biggers [Sun, 2 Apr 2023 19:32:46 +0000 (12:32 -0700)]
mount_image.c: call file_contents_changed() on extending truncates

13 months agov1.14.0-BETA3
Eric Biggers [Sun, 2 Apr 2023 06:46:11 +0000 (23:46 -0700)]
v1.14.0-BETA3

13 months agoREADME.md: 7-Zip supports solid WIMs now
Eric Biggers [Sun, 2 Apr 2023 06:29:14 +0000 (23:29 -0700)]
README.md: 7-Zip supports solid WIMs now

13 months agowimlib.h: remove outdated list of Windows architectures
Eric Biggers [Sun, 2 Apr 2023 06:29:14 +0000 (23:29 -0700)]
wimlib.h: remove outdated list of Windows architectures

13 months agoConvert README* and NEWS to Markdown
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Convert README* and NEWS to Markdown

This is the usual convention for new projects.

13 months agomount_image.c: avoid UBSAN warning in wimfs_listxattr()
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
mount_image.c: avoid UBSAN warning in wimfs_listxattr()

When 'list == NULL && size == 0', the statement 'end = list + size'
executes 'NULL + 0'.  clang's UndefinedBehaviorSanitizer complains that
this is undefined:

    src/mount_image.c:1518:19: runtime error: applying zero offset to null pointer

This is questionable, but let's avoid it...

13 months agoUpgrade WIM mounting support from fuse2 to fuse3
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Upgrade WIM mounting support from fuse2 to fuse3

fuse2 is no longer maintained, and the various Linux distros want all
packages to move to fuse3.  So, let's add fuse3 support.

Moreover, as it's been over 5 years since fuse3 was released, it doesn't
seem worth it to support both fuse2 and fuse3.  So, remove support for
fuse2, and just support fuse3.

Note: as before, WIM mounting support can still be disabled by
configuring --without-fuse.  That removes the dependency.

13 months agoconfigure.ac: explicitly call PKG_PROG_PKG_CONFIG
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
configure.ac: explicitly call PKG_PROG_PKG_CONFIG

Without this, pkg-config only worked if the first PKG_CHECK_MODULES that
appears *in the file* was executed, i.e. only if WITH_NTFS_3G=yes.

13 months agoci.yml: add shellcheck job
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
ci.yml: add shellcheck job

13 months agotools: address all shellcheck warnings
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
tools: address all shellcheck warnings

13 months agotools: make all shell scripts have the .sh extension
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
tools: make all shell scripts have the .sh extension

13 months agoUpdate hyperlinks
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Update hyperlinks

Use https whenever possible, and replace some outdated links.

13 months agoUpdate to latest ax_pthread.m4
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
Update to latest ax_pthread.m4

13 months agowindows-build.sh: misc cleanups
Eric Biggers [Sun, 2 Apr 2023 06:29:13 +0000 (23:29 -0700)]
windows-build.sh: misc cleanups

13 months agov1.14.0-BETA2
Eric Biggers [Fri, 31 Mar 2023 07:44:15 +0000 (00:44 -0700)]
v1.14.0-BETA2

13 months agoxmlproc: fix parsing empty elements
Eric Biggers [Fri, 31 Mar 2023 07:44:09 +0000 (00:44 -0700)]
xmlproc: fix parsing empty elements

13 months agov1.14.0-BETA1
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
v1.14.0-BETA1

13 months agowindows-build.sh: hint about installing prerequisites
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
windows-build.sh: hint about installing prerequisites

13 months agoAdd tools/repack-windows-release.sh
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Add tools/repack-windows-release.sh

13 months agoInclude windows-build.sh in the release tarballs
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Include windows-build.sh in the release tarballs

13 months agoRename make-windows-release to windows-build.sh
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Rename make-windows-release to windows-build.sh

This has turned into a much more generic build script than it was
originally, so rename it appropriately.

13 months agoAdd a gitattributes file
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
Add a gitattributes file

This is needed to avoid all files showing as "modified" on Windows.

13 months agoci.yml: upload Windows binaries when done
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
ci.yml: upload Windows binaries when done

13 months agoci.yml: add ARM64 Windows build
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
ci.yml: add ARM64 Windows build

13 months agomake-windows-release: support cross-compiling for ARM64 in MSYS2
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
make-windows-release: support cross-compiling for ARM64 in MSYS2

Cross-compiling for ARM64 is not possible with MSYS2 CLANGARM64 out of
the box, but it is possible to do by downloading and using a prebuilt
toolchain from https://github.com/mstorsjo/llvm-mingw.  Make the
'make-windows-release' script support doing this.

Suggested at https://wimlib.net/forums/viewtopic.php?p=1488#p1488

13 months agomake-windows-release: split into functions for readability
Eric Biggers [Fri, 31 Mar 2023 07:15:02 +0000 (00:15 -0700)]
make-windows-release: split into functions for readability

13 months agoxml_windows.c: update the language ID map
Eric Biggers [Thu, 30 Mar 2023 08:16:52 +0000 (01:16 -0700)]
xml_windows.c: update the language ID map

13 months agoxml: fix wimlib_set_image_property()
Eric Biggers [Thu, 30 Mar 2023 08:16:52 +0000 (01:16 -0700)]
xml: fix wimlib_set_image_property()

The recent XML changes introduced a bug where
wimlib_set_image_property() rejected values of property_name containing
'/', '[', or ']', which are part of the "path" syntax.

13 months agoRemove the outdated 'INSTALL' file
Eric Biggers [Thu, 30 Mar 2023 07:58:20 +0000 (00:58 -0700)]
Remove the outdated 'INSTALL' file

The INSTALL file was an old version of the generic GNU installation
instructions that was not customized to this package at all and was not
referenced by any other documentation.  It's unlikely to be useful.

13 months agowin32_*.c: avoid some format string warnings
Eric Biggers [Thu, 30 Mar 2023 07:34:14 +0000 (00:34 -0700)]
win32_*.c: avoid some format string warnings

These aren't real issues as all the types in question are 32-bit ints,
but fixing these will prevent warnings later if we're ever able to
enable __attribute__((format)) on Windows (hopefully due to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64862 being fixed).

13 months agocompiler.h: remove _cold_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _cold_attribute

This abstraction layer serves no purpose other than supporting gcc 4.3
and earlier, which is too old to bother supporting.  Just use
__attribute__((cold)) directly.

13 months agocompiler.h: remove _unused_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _unused_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((unused)) directly.

13 months agocompiler.h: remove _may_alias_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _may_alias_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((may_alias)) directly.

13 months agocompiler.h: remove _packed_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _packed_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((packed)) directly.

13 months agocompiler.h: remove _aligned_attribute
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove _aligned_attribute

This abstraction layer serves no purpose.  Just use
__attribute__((aligned(n))) directly.

13 months agocompiler.h: remove typeof
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: remove typeof

wimlib is compiled with -std=gnu99, so this is unnecessary.

13 months agoendianness.h: use builtins directly
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
endianness.h: use builtins directly

The compiler_bswap* macros serve no real purpose.  In endianness.h, just
use the builtins directly.

13 months agobitops: use builtins directly
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
bitops: use builtins directly

The compiler_bs{r,f}{32,64} macros serve no real purpose.  In bitops.h,
just use the builtins directly.

13 months agocompiler.h: define UNALIGNED_ACCESS_IS_FAST on powerpc64
Eric Biggers [Thu, 30 Mar 2023 07:00:56 +0000 (00:00 -0700)]
compiler.h: define UNALIGNED_ACCESS_IS_FAST on powerpc64

13 months agoerror.h: cleanup debris from removal of --disable-error-messages
Eric Biggers [Thu, 30 Mar 2023 07:00:55 +0000 (00:00 -0700)]
error.h: cleanup debris from removal of --disable-error-messages

13 months ago'extern' in function declarations is redundant
Eric Biggers [Thu, 30 Mar 2023 07:00:55 +0000 (00:00 -0700)]
'extern' in function declarations is redundant

13 months agoxml: miscellaneous cleanups
Eric Biggers [Thu, 30 Mar 2023 07:00:55 +0000 (00:00 -0700)]
xml: miscellaneous cleanups

13 months agoci.yml: install the ntfs-3g package
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
ci.yml: install the ntfs-3g package

Install ntfs-3g so that test-imagex-ntfs can run.  While we're here,
also install pkgconf (new name) instead of pkg-config (old name).

13 months agoci.yml: use -fno-sanitize-recover when using -fsanitize
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
ci.yml: use -fno-sanitize-recover when using -fsanitize

Unlike ASAN, by default UBSAN doesn't abort the program on error but
instead just prints an error message.  Use -fno-sanitize-recover to
explicitly request the abort-on-error behavior for testing purposes.

13 months agotest-imagex-ntfs: find mkntfs on Debian
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
test-imagex-ntfs: find mkntfs on Debian

Add /sbin to the PATH so that mkntfs is found on Debian.

13 months agoencoding.c: avoid UBSAN warning in convert_string()
Eric Biggers [Tue, 28 Mar 2023 06:14:42 +0000 (23:14 -0700)]
encoding.c: avoid UBSAN warning in convert_string()

When 'in == NULL && in_nbytes == 0', the statement 'in_end = in +
in_nbytes' executes 'NULL + 0'.  clang's UndefinedBehaviorSanitizer
complains that this is undefined:

    src/encoding.c:223:31: runtime error: applying zero offset to null pointer

This is questionable, but let's avoid it...

13 months agosha1.c: fix arm64 build with clang 12 and earlier
Eric Biggers [Tue, 28 Mar 2023 06:14:41 +0000 (23:14 -0700)]
sha1.c: fix arm64 build with clang 12 and earlier

clang 12 and earlier only defined the SHA-1 intrinsics when
__ARM_FEATURE_CRYPTO is defined.

13 months agomake-windows-release: support MSYS2 clang environments
Eric Biggers [Mon, 27 Mar 2023 05:30:54 +0000 (22:30 -0700)]
make-windows-release: support MSYS2 clang environments

Update tools/make-windows-release to support the CLANG32 and CLANG64
MSYS2 environments, and update ci.yml to test them in GitHub Actions.

Also try to support CLANGARM64, though I have no way to test that yet.

Finally, make a couple more tweaks to make-windows-release:

- Run the configure script unless it's explicitly requested to be
  skipped, as the previous logic was too fragile.

- Default to no docs and no zip.

13 months agoFix clang warnings about inconsistent use of dllexport
Eric Biggers [Mon, 27 Mar 2023 05:30:54 +0000 (22:30 -0700)]
Fix clang warnings about inconsistent use of dllexport

In MSYS2, clang emits many warnings like the following:

    warning: redeclaration of 'wimlib_add_empty_image' should not add 'dllexport' attribute

The problem is that dllexport is used when defining the wimlib API
functions but not when declaring them.  Fix this by using dllexport in
both places.

13 months agoAdd tools/get-version-number to the distribution tarballs
Eric Biggers [Mon, 27 Mar 2023 05:30:54 +0000 (22:30 -0700)]
Add tools/get-version-number to the distribution tarballs

Without this, 'autoreconf' only works in the git repo, not in tarballs.

13 months agomake-windows-release: fix generation of the cmd files
Eric Biggers [Mon, 27 Mar 2023 00:46:45 +0000 (17:46 -0700)]
make-windows-release: fix generation of the cmd files

13 months agoImprove fuzz testing
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Improve fuzz testing

- Convert fuzzing scripts from afl-fuzz to libFuzzer
- Add xml and wim fuzzers, including malloc failure injection
- Fuzz for 2 minutes as part of the GitHub Actions CI

13 months agoPrevent huge memory allocations from fuzzed header fields
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Prevent huge memory allocations from fuzzed header fields

13 months agosecurity.c: avoid NULL + 0 UBSAN error
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
security.c: avoid NULL + 0 UBSAN error

UBSAN complains about adding 0 to NULL.  Avoid this.

13 months agoREADME.WINDOWS: simplify the build procedure
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
README.WINDOWS: simplify the build procedure

Rework the build directions to use MSYS2 instead of Cygwin and to take
advantage of the improved make-windows-release script.

13 months agoREADME: remove an unnecessary notice
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
README: remove an unnecessary notice

The "copyright years may be listed using range notation" notice is
recommended by the GNU project, but most other people don't consider it
to be necessary or meaningful.

13 months agoci.yml: use make-windows-release script on Windows
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
ci.yml: use make-windows-release script on Windows

13 months agoImprove the make-windows-release script
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Improve the make-windows-release script

- Automatically bootstrap the repository if needed
- Add --no-zip and --no-docs options
- Add --install-msys2-packages to install the needed MSYS2 packages
- Autodetect the architecture when using MSYS2
- Use 'strip' instead of ${ARCH}-w64-mingw32-strip, for compatibility
  with MSYS2
- Make it pass 'shellcheck'
- Other cleanups

13 months agoEliminate the dependency on libxml2
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Eliminate the dependency on libxml2

libxml2 is the only remaining third-party library that Windows builds of
wimlib need.  It's a bit of a pain to have to download it, build it, and
trick libtool into linking it into the resulting DLL.  It then
constitutes a significant part of the size of the resulting DLL, even
with the minimal libxml2 configuration options being used.

In reality, WIM files only use a small subset of XML containing the most
commonly used XML features.  Using a full-featured XML library (that
supports "features" like External Entities that we have to remember to
disable) is a bit dangerous and not actually necessary.  7-Zip's WIM
support, for example, just uses a very minimal home-brew XML processor.

Another issue is that the libxml2 API always uses UTF-8, which causes
the conversion UTF-16LE => UTF-8 => UTF-16LE to be needed on Windows.
This isn't really an "issue", per se, but it shouldn't be necessary.

Finally, wimlib was integrating with libxml2 at a low level via the tree
API, and it overlooked some things.  For example, libxml2 trees have
separate CDATA and TEXT nodes, but wimlib was only looking at TEXT, so
CDATA was ignored.  It was also possible for wimlib to create a document
containing control characters, which is not valid XML so it could not be
read.  These weren't very important issues, but the point is, just using
an XML library doesn't solve quite as many problems as one would hope...

Therefore, just add a simple XML 1.0 processor directly in the source
code.  It handles all XML features that are used in WIM files, plus a
bit more for futureproofing.  It's also faster than libxml2.

13 months agotest_support.c: add some missing endianness conversions
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
test_support.c: add some missing endianness conversions

13 months agoAdd configure~ to gitignore
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Add configure~ to gitignore

13 months agoRemove some outdated scripts
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Remove some outdated scripts

13 months agoSimplify check for __NR_getrandom
Eric Biggers [Mon, 27 Mar 2023 00:25:46 +0000 (17:25 -0700)]
Simplify check for __NR_getrandom

There is no need for the configure script to check whether
__NR_getrandom is defined, as the source code can just use #ifdef.

13 months agosha1.c: fix arm64 build with clang 16
Eric Biggers [Thu, 23 Mar 2023 08:07:16 +0000 (01:07 -0700)]
sha1.c: fix arm64 build with clang 16

Reported at https://wimlib.net/forums/viewtopic.php?p=1480#p1480

13 months agoDon't touch config.rpath in bootstrap script
Eric Biggers [Mon, 20 Mar 2023 03:59:17 +0000 (20:59 -0700)]
Don't touch config.rpath in bootstrap script

This has no purpose.

13 months agoUpdate some copyright years
Eric Biggers [Mon, 20 Mar 2023 03:59:17 +0000 (20:59 -0700)]
Update some copyright years

13 months agoConsistently use _WIN32 instead of __WIN32__
Eric Biggers [Mon, 20 Mar 2023 03:59:17 +0000 (20:59 -0700)]
Consistently use _WIN32 instead of __WIN32__

_WIN32 works with all compilers, while __WIN32__ is MinGW-specific.
This project used __WIN32__ in files that only support MinGW, and _WIN32
in other files such as the library header and example programs.  One
place even used WIN32.  Avoid this unnecessary complication by just
always using _WIN32.

13 months agoUse native Windows threads on Windows
Eric Biggers [Mon, 20 Mar 2023 03:59:16 +0000 (20:59 -0700)]
Use native Windows threads on Windows

This makes building wimlib for Windows easier, as it no longer depends
on winpthreads.

13 months agoExplicitly define _WIN32_WINNT
Eric Biggers [Mon, 20 Mar 2023 03:59:16 +0000 (20:59 -0700)]
Explicitly define _WIN32_WINNT

Explicitly define _WIN32_WINNT to correspond to the minimum Windows
version we are supporting (currently Windows Vista).

13 months agoRemove support for Windows XP
Eric Biggers [Mon, 20 Mar 2023 03:59:16 +0000 (20:59 -0700)]
Remove support for Windows XP

13 months agoUpdate NEWS
Eric Biggers [Sat, 18 Mar 2023 07:31:39 +0000 (00:31 -0700)]
Update NEWS

13 months agoAdd a configuration file for GitHub Actions
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Add a configuration file for GitHub Actions

13 months agoFix build with very latest MinGW
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Fix build with very latest MinGW

MinGW's winioctl.h has added the FSCTL_*_OVERLAY constants but not the
structs they use, so make sure to define the structs ourselves.

13 months agoSkip a test case on macOS
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Skip a test case on macOS

13 months agoMake the 'tree-cmp' program build on macOS
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Make the 'tree-cmp' program build on macOS

13 months agoFix 'MAX' redefined warning on macOS
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Fix 'MAX' redefined warning on macOS

13 months agoUpdate winpthreads in Windows binaries to 10.0.0
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Update winpthreads in Windows binaries to 10.0.0

13 months agoUpdate libxml in Windows binaries to 2.10.3
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Update libxml in Windows binaries to 2.10.3

13 months agoAdd a basic test for wimverify and the SHA-1 code
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Add a basic test for wimverify and the SHA-1 code

13 months agoSHA-1 rework
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
SHA-1 rework

First, add new SHA-1 implementations that use the x86 and ARM SHA-1
intrinsics, so that these can be taken advantage of in Windows builds.

Second, replace sha1-ssse3.asm with an easier-to-maintain implementation
using intrinsics, and build a copy of it with AVX+BMI2 enabled.

Finally, now that better SHA-1 implementations are included, support for
OpenSSL's SHA-1 is no longer very useful, so remove it.

I considered going in the other direction: removing all SHA-1 code and
relying completely on external libraries.  Some issues with that are:

- Statically linking OpenSSL into libwim.dll on Windows increases the
  binary size by over 4x, even when using "no-autoalginit".

- OpenSSL has deprecated its easy-to-use SHA-1 API in favor of the EVP
  API, which is harder to use (everything can fail) and slower.

- Windows CryptoAPI is Windows-only (duh) and also has a complex, slow
  API where every function can fail, so that's not great either.

- SHA-1 is considered insecure these days, so it may be unwise to count
  on its continued support in crypto libraries into the future.

So, let's just do it ourselves...

13 months agoAdd and use SHA1_HASH_STRING_LEN constant
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Add and use SHA1_HASH_STRING_LEN constant

13 months agoAdd unaligned access helpers for be32
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Add unaligned access helpers for be32

13 months agoRename sha1_buffer() to simply sha1()
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Rename sha1_buffer() to simply sha1()

13 months agoImprove runtime CPU feature detection
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Improve runtime CPU feature detection

- Make wimlib_global_init() do the CPU feature detection, so that it
  doesn't have to be done on-demand later.

- Add support for detecting the x86 SHA extensions.

- Add support for detecting ARMv8 SHA1 instructions on Linux, Windows,
  and macOS.  (64-bit only for now.)

- Allow disabling features via an environment variable for testing.

- Remove some unused functionality.

13 months agoCall wimlib_global_init() when creating compressors and decompressors
Eric Biggers [Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)]
Call wimlib_global_init() when creating compressors and decompressors

All nontrivial API functions are supposed to call wimlib_global_init().
wimlib_create_compressor() and wimlib_create_decompressor() did not.
Make them do so, so that CPU feature detection can be moved to
wimlib_global_init().

15 months agowimsplit: use uint64_t for part_size
Eric Biggers [Wed, 11 Jan 2023 06:56:14 +0000 (22:56 -0800)]
wimsplit: use uint64_t for part_size

Reported at https://wimlib.net/forums/viewtopic.php?t=640

15 months agoSuppress deprecation warnings for OpenSSL's SHA1_* functions
Eric Biggers [Wed, 11 Jan 2023 06:56:14 +0000 (22:56 -0800)]
Suppress deprecation warnings for OpenSSL's SHA1_* functions

19 months agov1.13.6 v1.13.6
Eric Biggers [Sun, 11 Sep 2022 17:34:12 +0000 (12:34 -0500)]
v1.13.6

19 months agotools/make-releases: use libdeflate-gzip instead of 7z
Eric Biggers [Sun, 11 Sep 2022 17:34:12 +0000 (12:34 -0500)]
tools/make-releases: use libdeflate-gzip instead of 7z

19 months agotools/afl-fuzz: add gitignore file
Eric Biggers [Sun, 11 Sep 2022 17:34:12 +0000 (12:34 -0500)]
tools/afl-fuzz: add gitignore file

19 months agotools/afl-fuzz: fix ctype calculation
Eric Biggers [Sun, 11 Sep 2022 17:34:12 +0000 (12:34 -0500)]
tools/afl-fuzz: fix ctype calculation

19 months agoMakefile.am: don't explicitly link to msvcrt
Eric Biggers [Sun, 11 Sep 2022 17:34:12 +0000 (12:34 -0500)]
Makefile.am: don't explicitly link to msvcrt

The latest MinGW versions don't want this, and it causes an error about
the lib not being found.

21 months agotools: add afl-fuzz files
Eric Biggers [Fri, 5 Aug 2022 05:23:23 +0000 (22:23 -0700)]
tools: add afl-fuzz files