]> git.ipfire.org Git - thirdparty/libarchive.git/commit
libarchive: fix Windows compilation with ENABLE_CNG=OFF 2966/head
authorAlexander Lobakin <alobakin@mailbox.org>
Tue, 21 Apr 2026 20:50:18 +0000 (22:50 +0200)
committerAlexander Lobakin <alobakin@mailbox.org>
Tue, 21 Apr 2026 20:50:18 +0000 (22:50 +0200)
commit15b133b372c8e78ccdecd7db0d4fc458590f2330
tree77f6938f173a68cba59b32a42a764a21cf1c9bfa
parentcb779c5d2636c9594fb0244bbdf83defe5a56066
libarchive: fix Windows compilation with ENABLE_CNG=OFF

Currently, libarchive_{random,util}.c use a couple bcrypt functions
regardless of whether HAVE_BCRYPT_H is defined as there are no other
implementations for Windows, but the actual <bcrypt.h> header is
included only under this macro.

To be able to build libarchive with ENABLE_CNG=OFF (for example, to
prefer a different crypto/digest engine) on Windows, don't guard
the include in these two files. In that case, bcrypt will still be
used, but only as an RNG.
This won't break anything because, as mentioned above, bcrypt is
used unconditionally here and if it's not present in the system,
the library won't build either way, with or without the change.
At least until we implement an RNG for Windows based on something
else.

Signed-off-by: Alexander Lobakin <alobakin@mailbox.org>
libarchive/archive_random.c
libarchive/archive_util.c