Browse Source

Rename USE_ARC4 to BUILD_DECRYPTION

master
Daniel Scharrer 1 year ago
parent
commit
d32cd56880
  1. 1
      CHANGELOG
  2. 18
      CMakeLists.txt
  3. 2
      README.md
  4. 2
      doc/Doxyfile.in
  5. 4
      src/cli/extract.cpp
  6. 4
      src/crypto/arc4.hpp
  7. 8
      src/stream/chunk.cpp

1
CHANGELOG

@ -3,6 +3,7 @@ innoextract 1.10 (TBD)
- Added support for Inno Setup 6.3.x installers
- Added support for a modified Inno Setup 5.3.10 variant
- Added unit tests
- Replaced USE_ARC4 build option with BUILD_DECRYPTION
innoextract 1.9 (2020-08-09)
- Added preliminary support for Inno Setup 6.1.0

18
CMakeLists.txt

@ -32,7 +32,7 @@ if(CONTINUOUS_INTEGRATION OR DEVELOPER)
set(default_BUILD_TESTS ON)
endif()
suboption(BUILD_TESTS "Build tests" BOOL ${default_BUILD_TESTS})
option(USE_ARC4 "Build ARC4 decryption support" ON)
option(BUILD_DECRYPTION "Build decryption support" ON)
# Optional dependencies
option(USE_LZMA "Build LZMA decompression support" ON)
@ -149,8 +149,8 @@ endif()
unset(LIBRARIES)
if(USE_ARC4)
set(INNOEXTRACT_HAVE_ARC4 1)
if(BUILD_DECRYPTION)
set(INNOEXTRACT_HAVE_DECRYPTION 1)
endif()
if(USE_LZMA)
@ -357,8 +357,8 @@ set(INNOEXTRACT_SOURCES
src/crypto/adler32.hpp
src/crypto/adler32.cpp
src/crypto/arc4.hpp if INNOEXTRACT_HAVE_ARC4
src/crypto/arc4.cpp if INNOEXTRACT_HAVE_ARC4
src/crypto/arc4.hpp if INNOEXTRACT_HAVE_DECRYPTION
src/crypto/arc4.cpp if INNOEXTRACT_HAVE_DECRYPTION
src/crypto/checksum.hpp
src/crypto/checksum.cpp
src/crypto/crc32.hpp
@ -468,7 +468,7 @@ set(INNOEXTRACT_SOURCES
set(UNITTEST_SOURCES
src/crypto/adler32.cpp
src/crypto/arc4.cpp if INNOEXTRACT_HAVE_ARC4
src/crypto/arc4.cpp if INNOEXTRACT_HAVE_DECRYPTION
src/crypto/crc32.cpp
src/crypto/md5.cpp
src/crypto/sha1.cpp
@ -569,9 +569,9 @@ elseif(NOT DEBUG AND NOT CMAKE_BUILD_TYPE STREQUAL "Release")
set(BUILD_TYPE_SUFFIX "${BUILD_TYPE_SUFFIX} without debug output")
endif()
message(" - Build type: ${CMAKE_BUILD_TYPE}${BUILD_TYPE_SUFFIX}")
print_configuration("ARC4 decryption" FIRST
INNOEXTRACT_HAVE_ARC4 "enabled"
1 "disabled"
print_configuration("Decryption support" FIRST
INNOEXTRACT_HAVE_DECRYPTION "enabled"
1 "disabled"
)
print_configuration("LZMA decompression" FIRST
INNOEXTRACT_HAVE_LZMA "enabled"

2
README.md

@ -47,7 +47,7 @@ The default build settings are tuned for users - if you plan to make changes to
| Option | Default | Description |
|:------------------------- |:---------:|:----------- |
| `USE_ARC4` | `ON` | Build ARC4 decryption support.
| `BUILD_DECRYPTION` | `ON` | Build decryption support.
| `USE_LZMA` | `ON` | Use `liblzma`.
| `WITH_CONV` | *not set* | The charset conversion library to use. Valid values are `iconv`, `win32` and `builtin`¹. If not set, a library appropriate for the target platform will be chosen.
| `CMAKE_BUILD_TYPE` | `Release` | Set to `Debug` to enable debug output.

2
doc/Doxyfile.in

@ -1512,7 +1512,7 @@ INCLUDE_FILE_PATTERNS =
# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
PREDEFINED = INNOEXTRACT_HAVE_ARC4 INNOEXTRACT_HAVE_LZMA
PREDEFINED = INNOEXTRACT_HAVE_DECRYPTION INNOEXTRACT_HAVE_LZMA
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.

4
src/cli/extract.cpp

@ -1017,9 +1017,9 @@ void process_file(const fs::path & installer, const extract_options & o) {
password.clear();
}
}
#if !INNOEXTRACT_HAVE_ARC4
#if !INNOEXTRACT_HAVE_DECRYPTION
if((o.extract || o.test) && (info.header.options & setup::header::EncryptionUsed)) {
log_warning << "ARC4 decryption not supported in this build, skipping compressed chunks";
log_warning << "Decryption not supported in this build, skipping compressed chunks";
}
password.clear();
#endif

4
src/crypto/arc4.hpp

@ -32,7 +32,7 @@
#include "configure.hpp"
#if INNOEXTRACT_HAVE_ARC4
#if INNOEXTRACT_HAVE_DECRYPTION
namespace crypto {
@ -56,6 +56,6 @@ private:
} // namespace crypto
#endif // INNOEXTRACT_HAVE_ARC4
#endif // INNOEXTRACT_HAVE_DECRYPTION
#endif // INNOEXTRACT_CRYPTO_ARC4_HPP

8
src/stream/chunk.cpp

@ -48,7 +48,7 @@ namespace {
const char chunk_id[4] = { 'z', 'l', 'b', 0x1a };
#if INNOEXTRACT_HAVE_ARC4
#if INNOEXTRACT_HAVE_DECRYPTION
/*!
* Filter to en-/decrypt files files stored by Inno Setup.
@ -88,7 +88,7 @@ private:
};
#endif // INNOEXTRACT_HAVE_ARC4
#endif // INNOEXTRACT_HAVE_DECRYPTION
} // anonymous namespace
@ -146,7 +146,7 @@ chunk_reader::pointer chunk_reader::get(slice_reader & base, const chunk & chunk
}
if(chunk.encryption != Plaintext) {
#if INNOEXTRACT_HAVE_ARC4
#if INNOEXTRACT_HAVE_DECRYPTION
char salt[8];
if(base.read(salt, 8) != 8) {
throw chunk_error("could not read chunk salt");
@ -160,7 +160,7 @@ chunk_reader::pointer chunk_reader::get(slice_reader & base, const chunk & chunk
result->push(inno_arc4_crypter(salted_key, key_length), 8192);
#else
(void)key;
throw chunk_error("ARC4 decryption not supported");
throw chunk_error("Decryption not supported in this build");
#endif
}

Loading…
Cancel
Save