diff options
Diffstat (limited to 'src')
591 files changed, 4279 insertions, 1880 deletions
diff --git a/src/Boot/Windows/Bios.h b/src/Boot/Windows/Bios.h index 0282fad7..a8a3c731 100644 --- a/src/Boot/Windows/Bios.h +++ b/src/Boot/Windows/Bios.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootCommon.h b/src/Boot/Windows/BootCommon.h index 45a1a650..38cd4361 100644 --- a/src/Boot/Windows/BootCommon.h +++ b/src/Boot/Windows/BootCommon.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootConfig.cpp b/src/Boot/Windows/BootConfig.cpp index 948dfd93..77286f92 100644 --- a/src/Boot/Windows/BootConfig.cpp +++ b/src/Boot/Windows/BootConfig.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootConfig.h b/src/Boot/Windows/BootConfig.h index 5338109f..27270c56 100644 --- a/src/Boot/Windows/BootConfig.h +++ b/src/Boot/Windows/BootConfig.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootConsoleIo.cpp b/src/Boot/Windows/BootConsoleIo.cpp index 046f580b..e1dea4ed 100644 --- a/src/Boot/Windows/BootConsoleIo.cpp +++ b/src/Boot/Windows/BootConsoleIo.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootConsoleIo.h b/src/Boot/Windows/BootConsoleIo.h index cf10d2c6..99ae860d 100644 --- a/src/Boot/Windows/BootConsoleIo.h +++ b/src/Boot/Windows/BootConsoleIo.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootDebug.cpp b/src/Boot/Windows/BootDebug.cpp index b490f5e8..9295cd31 100644 --- a/src/Boot/Windows/BootDebug.cpp +++ b/src/Boot/Windows/BootDebug.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootDebug.h b/src/Boot/Windows/BootDebug.h index 35fce41f..febb12af 100644 --- a/src/Boot/Windows/BootDebug.h +++ b/src/Boot/Windows/BootDebug.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootDefs.h b/src/Boot/Windows/BootDefs.h index 3d65f0a0..8191fb71 100644 --- a/src/Boot/Windows/BootDefs.h +++ b/src/Boot/Windows/BootDefs.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootDiskIo.cpp b/src/Boot/Windows/BootDiskIo.cpp index ddd00e1c..f9ac359a 100644 --- a/src/Boot/Windows/BootDiskIo.cpp +++ b/src/Boot/Windows/BootDiskIo.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootDiskIo.h b/src/Boot/Windows/BootDiskIo.h index 0b92aa29..7936430c 100644 --- a/src/Boot/Windows/BootDiskIo.h +++ b/src/Boot/Windows/BootDiskIo.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootEncryptedIo.cpp b/src/Boot/Windows/BootEncryptedIo.cpp index 24fbbbd0..731fae44 100644 --- a/src/Boot/Windows/BootEncryptedIo.cpp +++ b/src/Boot/Windows/BootEncryptedIo.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootEncryptedIo.h b/src/Boot/Windows/BootEncryptedIo.h index d2fa6d96..1ada93ec 100644 --- a/src/Boot/Windows/BootEncryptedIo.h +++ b/src/Boot/Windows/BootEncryptedIo.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootMain.cpp b/src/Boot/Windows/BootMain.cpp index f6024d34..9f4b8613 100644 --- a/src/Boot/Windows/BootMain.cpp +++ b/src/Boot/Windows/BootMain.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootMain.h b/src/Boot/Windows/BootMain.h index af445024..77a662b4 100644 --- a/src/Boot/Windows/BootMain.h +++ b/src/Boot/Windows/BootMain.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootMemory.cpp b/src/Boot/Windows/BootMemory.cpp index 9eed757f..2fedb308 100644 --- a/src/Boot/Windows/BootMemory.cpp +++ b/src/Boot/Windows/BootMemory.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootMemory.h b/src/Boot/Windows/BootMemory.h index 183c4469..96f56374 100644 --- a/src/Boot/Windows/BootMemory.h +++ b/src/Boot/Windows/BootMemory.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/BootStrings.h b/src/Boot/Windows/BootStrings.h index b7cfe703..4d0dd3b4 100644 --- a/src/Boot/Windows/BootStrings.h +++ b/src/Boot/Windows/BootStrings.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/IntFilter.cpp b/src/Boot/Windows/IntFilter.cpp index 36837d58..5ec07622 100644 --- a/src/Boot/Windows/IntFilter.cpp +++ b/src/Boot/Windows/IntFilter.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/IntFilter.h b/src/Boot/Windows/IntFilter.h index 65b0c7ce..e9625b64 100644 --- a/src/Boot/Windows/IntFilter.h +++ b/src/Boot/Windows/IntFilter.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/Platform.cpp b/src/Boot/Windows/Platform.cpp index 3b94d22c..f592e26d 100644 --- a/src/Boot/Windows/Platform.cpp +++ b/src/Boot/Windows/Platform.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/Platform.h b/src/Boot/Windows/Platform.h index 1c41ec03..cec9d0c7 100644 --- a/src/Boot/Windows/Platform.h +++ b/src/Boot/Windows/Platform.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Boot/Windows/Release/BootLoader.com.gz b/src/Boot/Windows/Release/BootLoader.com.gz Binary files differindex 248f7833..23c921f8 100644 --- a/src/Boot/Windows/Release/BootLoader.com.gz +++ b/src/Boot/Windows/Release/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_AES/BootLoader.com.gz b/src/Boot/Windows/Release_AES/BootLoader.com.gz Binary files differindex a674bb0b..ab262fed 100644 --- a/src/Boot/Windows/Release_AES/BootLoader.com.gz +++ b/src/Boot/Windows/Release_AES/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_AES_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_AES_SHA2/BootLoader.com.gz Binary files differindex 298b3ac2..25a89b3e 100644 --- a/src/Boot/Windows/Release_AES_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Release_AES_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Camellia/BootLoader.com.gz b/src/Boot/Windows/Release_Camellia/BootLoader.com.gz Binary files differindex b8cbc0a9..5cf49d63 100644 --- a/src/Boot/Windows/Release_Camellia/BootLoader.com.gz +++ b/src/Boot/Windows/Release_Camellia/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Camellia_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_Camellia_SHA2/BootLoader.com.gz Binary files differindex 62b2b111..2a231431 100644 --- a/src/Boot/Windows/Release_Camellia_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Release_Camellia_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_SHA2/BootLoader.com.gz Binary files differindex f660e397..33413df5 100644 --- a/src/Boot/Windows/Release_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Release_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Serpent/BootLoader.com.gz b/src/Boot/Windows/Release_Serpent/BootLoader.com.gz Binary files differindex 2526d68b..7f330347 100644 --- a/src/Boot/Windows/Release_Serpent/BootLoader.com.gz +++ b/src/Boot/Windows/Release_Serpent/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Serpent_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_Serpent_SHA2/BootLoader.com.gz Binary files differindex 1446855b..50592bba 100644 --- a/src/Boot/Windows/Release_Serpent_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Release_Serpent_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Twofish/BootLoader.com.gz b/src/Boot/Windows/Release_Twofish/BootLoader.com.gz Binary files differindex f9463c1c..64d147af 100644 --- a/src/Boot/Windows/Release_Twofish/BootLoader.com.gz +++ b/src/Boot/Windows/Release_Twofish/BootLoader.com.gz diff --git a/src/Boot/Windows/Release_Twofish_SHA2/BootLoader.com.gz b/src/Boot/Windows/Release_Twofish_SHA2/BootLoader.com.gz Binary files differindex e736e85e..8b4664fe 100644 --- a/src/Boot/Windows/Release_Twofish_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Release_Twofish_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue/BootLoader.com.gz b/src/Boot/Windows/Rescue/BootLoader.com.gz Binary files differindex 2e852d6c..a12b1cab 100644 --- a/src/Boot/Windows/Rescue/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_AES/BootLoader.com.gz b/src/Boot/Windows/Rescue_AES/BootLoader.com.gz Binary files differindex ff0f10a8..edbe080b 100644 --- a/src/Boot/Windows/Rescue_AES/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_AES/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_AES_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_AES_SHA2/BootLoader.com.gz Binary files differindex 2218aced..c10db1c7 100644 --- a/src/Boot/Windows/Rescue_AES_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_AES_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Camellia/BootLoader.com.gz b/src/Boot/Windows/Rescue_Camellia/BootLoader.com.gz Binary files differindex 88db9603..c260583a 100644 --- a/src/Boot/Windows/Rescue_Camellia/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_Camellia/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Camellia_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_Camellia_SHA2/BootLoader.com.gz Binary files differindex 57ff5be5..04c98ddb 100644 --- a/src/Boot/Windows/Rescue_Camellia_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_Camellia_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_SHA2/BootLoader.com.gz Binary files differindex a95efbfb..fdddea41 100644 --- a/src/Boot/Windows/Rescue_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Serpent/BootLoader.com.gz b/src/Boot/Windows/Rescue_Serpent/BootLoader.com.gz Binary files differindex 944f5d81..27b9418a 100644 --- a/src/Boot/Windows/Rescue_Serpent/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_Serpent/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Serpent_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_Serpent_SHA2/BootLoader.com.gz Binary files differindex fff9856b..5fbde6fc 100644 --- a/src/Boot/Windows/Rescue_Serpent_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_Serpent_SHA2/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Twofish/BootLoader.com.gz b/src/Boot/Windows/Rescue_Twofish/BootLoader.com.gz Binary files differindex 79281133..06df2b66 100644 --- a/src/Boot/Windows/Rescue_Twofish/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_Twofish/BootLoader.com.gz diff --git a/src/Boot/Windows/Rescue_Twofish_SHA2/BootLoader.com.gz b/src/Boot/Windows/Rescue_Twofish_SHA2/BootLoader.com.gz Binary files differindex 40960c8a..375de162 100644 --- a/src/Boot/Windows/Rescue_Twofish_SHA2/BootLoader.com.gz +++ b/src/Boot/Windows/Rescue_Twofish_SHA2/BootLoader.com.gz diff --git a/src/Build/CMakeLists.txt b/src/Build/CMakeLists.txt index b8a7c8ad..e3426495 100644 --- a/src/Build/CMakeLists.txt +++ b/src/Build/CMakeLists.txt @@ -13,4 +13,4 @@ endif() # - Set version of the package -set( FULL_VERSION "1.26.17" ) -set( VERSION "1.26.17" ) +set( FULL_VERSION "1.26.20" ) +set( VERSION "1.26.20" ) set( RELEASE "1" ) @@ -254,3 +254,15 @@ if ( ( PLATFORM STREQUAL "Debian" ) OR ( PLATFORM STREQUAL "Ubuntu" ) ) set( CPACK_DEBIAN_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}.deb ) # mandatory - set( CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION} ) # mandatory + # -- Use a distro-specific version string to avoid repository conflicts -- + # e.g. 1.26.17-1~deb11, 1.26.17-1~deb12, 1.26.17-1~ubuntu20.04, etc. + if (PLATFORM STREQUAL "Ubuntu") + # For something like "24.04", it becomes 1.26.17-1~ubuntu24.04 + set(CPACK_DEBIAN_PACKAGE_VERSION + "${VERSION}-${RELEASE}~ubuntu${PLATFORM_VERSION}") + else() # Debian + # Usually just take the major number from e.g. "11.7" => "11" + string(REGEX MATCH "^[0-9]+" PLATFORM_VERSION_MAJOR "${PLATFORM_VERSION}") + set(CPACK_DEBIAN_PACKAGE_VERSION + "${VERSION}-${RELEASE}~deb${PLATFORM_VERSION_MAJOR}") + endif() + set( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_PACKAGE_RELEASE} ) diff --git a/src/Build/Include/Makefile.inc b/src/Build/Include/Makefile.inc index 11ab12c2..281d206a 100644 --- a/src/Build/Include/Makefile.inc +++ b/src/Build/Include/Makefile.inc @@ -16,3 +16,3 @@ clean: @echo Cleaning $(NAME) - rm -f $(APPNAME) $(NAME).a $(OBJS) $(OBJSEX) $(OBJSNOOPT) $(OBJSHANI) $(OBJSSSE41) $(OBJSSSSE3) $(OBJS:.o=.d) $(OBJSEX:.oo=.d) $(OBJSNOOPT:.o0=.d) $(OBJSHANI:.oshani=.d) $(OBJSSSE41:.osse41=.d) $(OBJSSSSE3:.ossse3=.d) *.gch + rm -f $(APPNAME) $(NAME).a $(OBJS) $(OBJSEX) $(OBJSNOOPT) $(OBJSHANI) $(OBJSSSE41) $(OBJSSSSE3) $(OBJARMV8CRYPTO) $(OBJS:.o=.d) $(OBJSEX:.oo=.d) $(OBJSNOOPT:.o0=.d) $(OBJSHANI:.oshani=.d) $(OBJSSSE41:.osse41=.d) $(OBJSSSSE3:.ossse3=.d) $(OBJARMV8CRYPTO:.oarmv8crypto=.d) *.gch @@ -38,2 +38,6 @@ clean: +%.oarmv8crypto: %.c + @echo Compiling $(<F) + $(CC) $(CFLAGS) -march=armv8-a+crypto -c $< -o $@ + %.o: %.cpp @@ -98,8 +102,8 @@ TR_SED_BIN := tr '\n' ' ' | tr -s ' ' ',' | sed -e 's/^,//g' -e 's/,$$/n/' | tr # Dependencies --include $(OBJS:.o=.d) $(OBJSEX:.oo=.d) $(OBJSNOOPT:.o0=.d) $(OBJSHANI:.oshani=.d) $(OBJSSSE41:.osse41=.d) $(OBJSSSSE3:.ossse3=.d) +-include $(OBJS:.o=.d) $(OBJSEX:.oo=.d) $(OBJSNOOPT:.o0=.d) $(OBJSHANI:.oshani=.d) $(OBJSSSE41:.osse41=.d) $(OBJSSSSE3:.ossse3=.d) $(OBJARMV8CRYPTO:.oarmv8crypto=.d) -$(NAME).a: $(OBJS) $(OBJSEX) $(OBJSNOOPT) $(OBJSHANI) $(OBJSSSE41) $(OBJSSSSE3) +$(NAME).a: $(OBJS) $(OBJSEX) $(OBJSNOOPT) $(OBJSHANI) $(OBJSSSE41) $(OBJSSSSE3) $(OBJARMV8CRYPTO) @echo Updating library $@ - $(AR) $(AFLAGS) -rcu $@ $(OBJS) $(OBJSEX) $(OBJSNOOPT) $(OBJSHANI) $(OBJSSSE41) $(OBJSSSSE3) + $(AR) $(AFLAGS) -rc $@ $(OBJS) $(OBJSEX) $(OBJSNOOPT) $(OBJSHANI) $(OBJSSSE41) $(OBJSSSSE3) $(OBJARMV8CRYPTO) $(RANLIB) $@ diff --git a/src/COMReg/COMReg.rc b/src/COMReg/COMReg.rc index 4723bde9..d0fd5284 100644 --- a/src/COMReg/COMReg.rc +++ b/src/COMReg/COMReg.rc @@ -29,4 +29,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,20,0 + PRODUCTVERSION 1,26,20,0 FILEFLAGSMASK 0x17L @@ -47,3 +47,3 @@ BEGIN VALUE "FileDescription", "VeraCrypt COMReg" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -51,3 +51,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END diff --git a/src/Common/Apidrvr.h b/src/Common/Apidrvr.h index 955286da..84a3de91 100644 --- a/src/Common/Apidrvr.h +++ b/src/Common/Apidrvr.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -44,3 +44,3 @@ // IN OUT - UNMOUNT_STRUCT -#define TC_IOCTL_DISMOUNT_VOLUME TC_IOCTL (4) +#define TC_IOCTL_UNMOUNT_VOLUME TC_IOCTL (4) @@ -48,3 +48,3 @@ // IN OUT - UNMOUNT_STRUCT -#define TC_IOCTL_DISMOUNT_ALL_VOLUMES TC_IOCTL (5) +#define TC_IOCTL_UNMOUNT_ALL_VOLUMES TC_IOCTL (5) diff --git a/src/Common/BaseCom.cpp b/src/Common/BaseCom.cpp index 25c70963..3b502ef0 100644 --- a/src/Common/BaseCom.cpp +++ b/src/Common/BaseCom.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/BaseCom.h b/src/Common/BaseCom.h index 431b0257..1a7b68d2 100644 --- a/src/Common/BaseCom.h +++ b/src/Common/BaseCom.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/BootEncryption.cpp b/src/Common/BootEncryption.cpp index e6e36f12..833a67fd 100644 --- a/src/Common/BootEncryption.cpp +++ b/src/Common/BootEncryption.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -3204,3 +3204,3 @@ namespace VeraCrypt // starting from Windows 10 1607 (Build 14393), ReflectDrivers in Setupconfig.ini is supported - if (IsOSVersionAtLeast (WIN_10, 0) && CurrentOSBuildNumber >= 14393) + if (IsWin10BuildAtLeast(WIN_10_1607_BUILD)) { diff --git a/src/Common/BootEncryption.h b/src/Common/BootEncryption.h index 2ec92503..432d10a9 100644 --- a/src/Common/BootEncryption.h +++ b/src/Common/BootEncryption.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Cache.c b/src/Common/Cache.c index 60b2f04a..4826673e 100644 --- a/src/Common/Cache.c +++ b/src/Common/Cache.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Cache.h b/src/Common/Cache.h index cfab6f4f..f629d8b8 100644 --- a/src/Common/Cache.h +++ b/src/Common/Cache.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Cmdline.c b/src/Common/Cmdline.c index f34b3bfb..ff19b76a 100644 --- a/src/Common/Cmdline.c +++ b/src/Common/Cmdline.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -68,3 +68,3 @@ BOOL CALLBACK CommandHelpDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM #if defined(TCMOUNT) && !defined(VCEXPANDER) - StringCchCatW (tmp, 8192, L"\nExamples:\n\nMount a volume as X:\tveracrypt.exe /q /v volume.hc /l X\nDismount a volume X:\tveracrypt.exe /q /d X"); + StringCchCatW (tmp, 8192, L"\nExamples:\n\nMount a volume as X:\tveracrypt.exe /q /v volume.hc /l X\nUnmount a volume X:\tveracrypt.exe /q /u X"); #endif diff --git a/src/Common/Cmdline.h b/src/Common/Cmdline.h index 5e0f3509..f1e1fd59 100644 --- a/src/Common/Cmdline.h +++ b/src/Common/Cmdline.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Combo.c b/src/Common/Combo.c index 880f0b7a..fec4c0df 100644 --- a/src/Common/Combo.c +++ b/src/Common/Combo.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Combo.h b/src/Common/Combo.h index 604395b5..73072b96 100644 --- a/src/Common/Combo.h +++ b/src/Common/Combo.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Common.h b/src/Common/Common.h index 62ee3d65..88e034e2 100644 --- a/src/Common/Common.h +++ b/src/Common/Common.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Crc.c b/src/Common/Crc.c index 7e18cb4f..2cda3794 100644 --- a/src/Common/Crc.c +++ b/src/Common/Crc.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Crc.h b/src/Common/Crc.h index 53960a79..c59fc823 100644 --- a/src/Common/Crc.h +++ b/src/Common/Crc.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c index 9ae841eb..2f4e447f 100644 --- a/src/Common/Crypto.c +++ b/src/Common/Crypto.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -1166,4 +1166,2 @@ BOOL IsAesHwCpuSupported () return state && !HwEncryptionDisabled; -#elif defined (_M_ARM64) || defined(__arm__) || defined (__arm64__) || defined (__aarch64__) - return 0; #else @@ -1485,27 +1483 @@ void VcUnprotectKeys (PCRYPTO_INFO pCryptoInfo, uint64 encID) -#if defined(_M_ARM64) || defined(__arm__) || defined (__arm64__) || defined (__aarch64__) -/* dummy implementation that should never be called */ -void aes_hw_cpu_decrypt(const uint8* ks, uint8* data) -{ - ks = ks; - data = data; -} - -void aes_hw_cpu_decrypt_32_blocks(const uint8* ks, uint8* data) -{ - ks = ks; - data = data; -} - -void aes_hw_cpu_encrypt(const uint8* ks, uint8* data) -{ - ks = ks; - data = data; -} - -void aes_hw_cpu_encrypt_32_blocks(const uint8* ks, uint8* data) -{ - ks = ks; - data = data; -} -#endif diff --git a/src/Common/Crypto.h b/src/Common/Crypto.h index 03921da3..81ec791e 100644 --- a/src/Common/Crypto.h +++ b/src/Common/Crypto.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Dictionary.c b/src/Common/Dictionary.c index 47dcb0a4..5915760c 100644 --- a/src/Common/Dictionary.c +++ b/src/Common/Dictionary.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Dictionary.h b/src/Common/Dictionary.h index f0be2183..972ec832 100644 --- a/src/Common/Dictionary.h +++ b/src/Common/Dictionary.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index ee3630c0..6a068529 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -313,8 +313,8 @@ static unsigned char gpbSha512CodeSignCertFingerprint[64] = { static unsigned char gpbSha512MSCodeSignCertFingerprint[64] = { - 0xEB, 0x76, 0x2E, 0xD3, 0x5B, 0x4A, 0xB1, 0x0E, 0xF5, 0x3B, 0x99, 0x4E, - 0xC1, 0xF7, 0x48, 0x88, 0xF6, 0xA0, 0xE9, 0xAC, 0x32, 0x69, 0xCF, 0x20, - 0xE1, 0x60, 0xC4, 0x0C, 0xEF, 0x01, 0x1F, 0xCB, 0x41, 0x95, 0x72, 0xB9, - 0xED, 0x63, 0x0C, 0x6B, 0xB9, 0xE9, 0xA2, 0x72, 0xA6, 0x78, 0x96, 0x4C, - 0x69, 0x9F, 0x90, 0x3F, 0xB1, 0x3C, 0x64, 0xF2, 0xAB, 0xCF, 0x14, 0x1D, - 0xEC, 0x7C, 0xB0, 0xC7 + 0x17, 0x8C, 0x1B, 0x37, 0x70, 0xBF, 0x8B, 0xDF, 0x84, 0x55, 0xC5, 0x18, + 0x13, 0x64, 0xE9, 0x65, 0x6D, 0x67, 0xCA, 0x0C, 0xD6, 0x3B, 0x9E, 0x7B, + 0x9B, 0x6A, 0x63, 0xD6, 0x19, 0xAE, 0xD7, 0xBA, 0xBE, 0x5C, 0xCB, 0xD1, + 0x07, 0x89, 0x07, 0xFB, 0x12, 0xC0, 0x2C, 0x94, 0x86, 0xEB, 0x67, 0x0B, + 0x9C, 0x97, 0xEB, 0x20, 0x38, 0x13, 0x9C, 0x0F, 0x56, 0x93, 0x1B, 0x19, + 0x6F, 0x8F, 0x6A, 0x39 }; @@ -1048,2 +1048,16 @@ BOOL IsOSVersionAtLeast (OSVersionEnum reqMinOS, int reqMinServicePack) +BOOL IsWin10BuildAtLeast(int minBuild) +{ + // Must first be recognized as Windows 10 or higher + if (nCurrentOS < WIN_10) + return FALSE; + + // If we’re on Windows 10, check build number + if (nCurrentOS == WIN_10 && CurrentOSBuildNumber < minBuild) + return FALSE; + + // If we are on a higher version of Windows, we are good to go + return TRUE; +} + #ifdef SETUP_DLL @@ -2166,3 +2180,3 @@ BOOL CALLBACK AboutDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam L"Portions of this software:\r\n" - L"Copyright \xA9 2013-2024 IDRIX. All rights reserved.\r\n" + L"Copyright \xA9 2013-2025 IDRIX. All rights reserved.\r\n" L"Copyright \xA9 2003-2012 TrueCrypt Developers Association. All Rights Reserved.\r\n" @@ -2179,3 +2193,3 @@ BOOL CALLBACK AboutDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam L"This software as a whole:\r\n" - L"Copyright \xA9 2013-2024 IDRIX. All rights reserved.\r\n\r\n" + L"Copyright \xA9 2013-2025 IDRIX. All rights reserved.\r\n\r\n" @@ -3613,6 +3627,6 @@ void InitApp (HINSTANCE hInstance, wchar_t *lpszCommandLine) - if (!IsOSAtLeast (WIN_10)) + if (!IsWin10BuildAtLeast(WIN_10_1809_BUILD)) { - // abort using a message that says that VeraCrypt can run only on Windows 10 and later - AbortProcessDirect(L"VeraCrypt requires at least Windows 10 to run."); + // abort using a message that says that VeraCrypt can run only on Windows 10 version 1809 or later + AbortProcessDirect(L"VeraCrypt requires at least Windows 10 version 1809 (October 2018 Update) to run."); } @@ -8208,3 +8222,3 @@ int DriverUnmountVolume (HWND hwndDlg, int nDosDriveNo, BOOL forced) - bResult = DeviceIoControl (hDriver, TC_IOCTL_DISMOUNT_VOLUME, &unmount, + bResult = DeviceIoControl (hDriver, TC_IOCTL_UNMOUNT_VOLUME, &unmount, sizeof (unmount), &unmount, sizeof (unmount), &dwResult, NULL); @@ -14871,2 +14885,3 @@ void GetAppRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed) +#ifndef _M_ARM64 // use RDSEED or RDRAND from CPU as source of entropy if enabled @@ -14879,2 +14894,3 @@ void GetAppRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed) } +#endif WHIRLPOOL_finalize (&tctx, digest); @@ -15970,2 +15986,2 @@ cleanup: } -#endif
\ No newline at end of file +#endif diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h index 4dfae20f..aaaad97e 100644 --- a/src/Common/Dlgcode.h +++ b/src/Common/Dlgcode.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -288,2 +288,5 @@ typedef NTSTATUS (WINAPI *NtQuerySystemInformationFn)( +#define WIN_10_1607_BUILD 14393 // Windows 10 version 1607 corresponds to build 14393 +#define WIN_10_1809_BUILD 17763 // Windows 10 version 1809 corresponds to build 17763 + void InitGlobalLocks (); @@ -502,2 +505,3 @@ BOOL IsOSAtLeast (OSVersionEnum reqMinOS); BOOL IsOSVersionAtLeast (OSVersionEnum reqMinOS, int reqMinServicePack); +BOOL IsWin10BuildAtLeast(int minBuild); BOOL IsSupportedOS (); diff --git a/src/Common/EncryptionThreadPool.c b/src/Common/EncryptionThreadPool.c index 8a0c6e78..5a31bb5b 100644 --- a/src/Common/EncryptionThreadPool.c +++ b/src/Common/EncryptionThreadPool.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/EncryptionThreadPool.h b/src/Common/EncryptionThreadPool.h index 2e727a74..95583165 100644 --- a/src/Common/EncryptionThreadPool.h +++ b/src/Common/EncryptionThreadPool.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Endian.c b/src/Common/Endian.c index cea24d09..7cdda679 100644 --- a/src/Common/Endian.c +++ b/src/Common/Endian.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Endian.h b/src/Common/Endian.h index 000395f4..a0cf03b2 100644 --- a/src/Common/Endian.h +++ b/src/Common/Endian.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Exception.h b/src/Common/Exception.h index cb4fefc5..f52484c7 100644 --- a/src/Common/Exception.h +++ b/src/Common/Exception.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Fat.c b/src/Common/Fat.c index dec2ccee..c40084a0 100644 --- a/src/Common/Fat.c +++ b/src/Common/Fat.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Fat.h b/src/Common/Fat.h index 19b5cebb..d6757aaa 100644 --- a/src/Common/Fat.h +++ b/src/Common/Fat.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Format.c b/src/Common/Format.c index f1550e6b..ee766d33 100644 --- a/src/Common/Format.c +++ b/src/Common/Format.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -196,3 +196,3 @@ begin_format: { - Error ("FORMAT_CANT_DISMOUNT_FILESYS", hwndDlg); + Error ("FORMAT_CANT_UNMOUNT_FILESYS", hwndDlg); nStatus = ERR_DONT_REPORT; @@ -334,3 +334,3 @@ begin_format: { - Error ("FORMAT_CANT_DISMOUNT_FILESYS", hwndDlg); + Error ("FORMAT_CANT_UNMOUNT_FILESYS", hwndDlg); nStatus = ERR_DONT_REPORT; @@ -852,3 +852,3 @@ error: if (!UnmountVolumeAfterFormatExCall (volParams->hwndDlg, driveNo) && !Silent) - MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND); + MessageBoxW (volParams->hwndDlg, GetString ("CANT_UNMOUNT_VOLUME"), lpszTitle, ICON_HAND); @@ -874,3 +874,3 @@ error: if (!UnmountVolumeAfterFormatExCall (volParams->hwndDlg, driveNo) && !Silent) - MessageBoxW (volParams->hwndDlg, GetString ("CANT_DISMOUNT_VOLUME"), lpszTitle, ICON_HAND); + MessageBoxW (volParams->hwndDlg, GetString ("CANT_UNMOUNT_VOLUME"), lpszTitle, ICON_HAND); } diff --git a/src/Common/Format.h b/src/Common/Format.h index 0a42e5c8..8f1166ba 100644 --- a/src/Common/Format.h +++ b/src/Common/Format.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Keyfiles.c b/src/Common/Keyfiles.c index b21e371d..b31e335b 100644 --- a/src/Common/Keyfiles.c +++ b/src/Common/Keyfiles.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Keyfiles.h b/src/Common/Keyfiles.h index a13666fb..e01f6bc9 100644 --- a/src/Common/Keyfiles.h +++ b/src/Common/Keyfiles.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Language.c b/src/Common/Language.c index 11c791d8..3537d747 100644 --- a/src/Common/Language.c +++ b/src/Common/Language.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Language.h b/src/Common/Language.h index 4a87ceda..f4c57dae 100644 --- a/src/Common/Language.h +++ b/src/Common/Language.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Language.xml b/src/Common/Language.xml index 9821bbe9..eac69303 100644 --- a/src/Common/Language.xml +++ b/src/Common/Language.xml @@ -137,4 +137,4 @@ <entry lang="en" key="IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX">Global Settings</entry> - <entry lang="en" key="IDC_HK_DISMOUNT_BALLOON_TOOLTIP">Display balloon tooltip after successful hot-key dismount</entry> - <entry lang="en" key="IDC_HK_DISMOUNT_PLAY_SOUND">Play system notification sound after successful hot-key dismount</entry> + <entry lang="en" key="IDC_HK_UNMOUNT_BALLOON_TOOLTIP">Display balloon tooltip after successful hot-key unmount</entry> + <entry lang="en" key="IDC_HK_UNMOUNT_PLAY_SOUND">Play system notification sound after successful hot-key unmount</entry> <entry lang="en" key="IDC_HK_MOD_ALT">Alt</entry> @@ -158,8 +158,8 @@ <entry lang="en" key="IDC_PREF_CACHE_PASSWORDS">Cache passwords in driver memory</entry> - <entry lang="en" key="IDC_PREF_DISMOUNT_INACTIVE">Auto-dismount volume after no data has been read/written to it for</entry> - <entry lang="en" key="IDC_PREF_DISMOUNT_LOGOFF">User logs off</entry> - <entry lang="en" key="IDC_PREF_DISMOUNT_SESSION_LOCKED">User session locked</entry> - <entry lang="en" key="IDC_PREF_DISMOUNT_POWERSAVING">Entering power saving mode</entry> - <entry lang="en" key="IDC_PREF_DISMOUNT_SCREENSAVER">Screen saver is launched</entry> - <entry lang="en" key="IDC_PREF_FORCE_AUTO_DISMOUNT">Force auto-dismount even if volume contains open files or directories</entry> + <entry lang="en" key="IDC_PREF_UNMOUNT_INACTIVE">Auto-unmount volume after no data has been read/written to it for</entry> + <entry lang="en" key="IDC_PREF_UNMOUNT_LOGOFF">User logs off</entry> + <entry lang="en" key="IDC_PREF_UNMOUNT_SESSION_LOCKED">User session locked</entry> + <entry lang="en" key="IDC_PREF_UNMOUNT_POWERSAVING">Entering power saving mode</entry> + <entry lang="en" key="IDC_PREF_UNMOUNT_SCREENSAVER">Screen saver is launched</entry> + <entry lang="en" key="IDC_PREF_FORCE_AUTO_UNMOUNT">Force auto-unmount even if volume contains open files or directories</entry> <entry lang="en" key="IDC_PREF_LOGON_MOUNT_DEVICES">Mount all device-hosted VeraCrypt volumes</entry> @@ -171,3 +171,3 @@ <entry lang="en" key="IDC_PREF_USE_DIFF_TRAY_ICON_IF_VOL_MOUNTED">Use a different taskbar icon when there are mounted volumes</entry> - <entry lang="en" key="IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT">Wipe cached passwords on auto-dismount</entry> + <entry lang="en" key="IDC_PREF_WIPE_CACHE_ON_AUTOUNMOUNT">Wipe cached passwords on auto-unmount</entry> <entry lang="en" key="IDC_PREF_WIPE_CACHE_ON_EXIT">Wipe cached passwords on exit</entry> @@ -183,3 +183,3 @@ <entry lang="en" key="IDC_TRUECRYPT_MODE">&TrueCrypt Mode</entry> - <entry lang="en" key="IDC_UNMOUNTALL">Di&smount All</entry> + <entry lang="en" key="IDC_UNMOUNTALL">&Unmount All</entry> <entry lang="en" key="IDC_VOLUME_PROPERTIES">&Volume Properties...</entry> @@ -257,4 +257,4 @@ <entry lang="en" key="IDM_TRAVELER">Traveler Disk Setup...</entry> - <entry lang="en" key="IDM_UNMOUNTALL">Dismount All Mounted Volumes</entry> - <entry lang="en" key="IDM_UNMOUNT_VOLUME">Dismount Volume</entry> + <entry lang="en" key="IDM_UNMOUNTALL">Unmount All Mounted Volumes</entry> + <entry lang="en" key="IDM_UNMOUNT_VOLUME">Unmount Volume</entry> <entry lang="en" key="IDM_VERIFY_RESCUE_DISK">Verify Rescue Disk</entry> @@ -271,4 +271,4 @@ <entry lang="en" key="IDT_AUTORUN">AutoRun Configuration (autorun.inf)</entry> - <entry lang="en" key="IDT_AUTO_DISMOUNT">Auto-Dismount</entry> - <entry lang="en" key="IDT_AUTO_DISMOUNT_ON">Dismount all when:</entry> + <entry lang="en" key="IDT_AUTO_UNMOUNT">Auto-Unmount</entry> + <entry lang="en" key="IDT_AUTO_UNMOUNT_ON">Unmount all when:</entry> <entry lang="en" key="IDT_BOOT_LOADER_SCREEN_OPTIONS">Boot Loader Screen Options</entry> @@ -278,3 +278,3 @@ <entry lang="en" key="IDT_DEFAULT_MOUNT_OPTIONS">Default Mount Options</entry> - <entry lang="en" key="IDT_DISMOUNT_ACTION">Hot Key Options</entry> + <entry lang="en" key="IDT_UNMOUNT_ACTION">Hot Key Options</entry> <entry lang="en" key="IDT_DRIVER_OPTIONS">Driver Configuration</entry> @@ -425,4 +425,4 @@ <entry lang="en" key="DEVICE_IN_USE_INPLACE_ENC">Warning: The partition is in use by the operating system or applications. You should close any applications that might be using the partition (including antivirus software).\n\nContinue?</entry> - <entry lang="en" key="FORMAT_CANT_DISMOUNT_FILESYS">Error: The device/partition contains a file system that could not be dismounted. The file system may be in use by the operating system. Formatting the device/partition would very likely cause data corruption and system instability.\n\nTo solve this issue, we recommend that you first delete the partition and then recreate it without formatting. To do so, follow these steps:\n1) Right-click the 'Computer' (or 'My Computer') icon in the 'Start Menu' and select 'Manage'. The 'Computer Management' window should appear.\n2) In the 'Computer Management' window, select 'Storage' > 'Disk Management'.\n3) Right-click the partition you want to encrypt and select either 'Delete Partition', or 'Delete Volume', or 'Delete Logical Drive'.\n4) Click 'Yes'. If Windows asks you to restart the computer, do so. Then repeat the steps 1 and 2 and continue from the step 5.\n5) Right-click the unallocated/free space area and select either 'New Partition', or 'New Simple Volume', or 'New Logical Drive'.\n6) The 'New Partition Wizard' or 'New Simple Volume Wizard' window should appear now; follow its instructions. On the wizard page entitled 'Format Partition', select either 'Do not format this partition' or 'Do not format this volume'. In the same wizard, click 'Next' and then 'Finish'.\n7) Note that the device path you have selected in VeraCrypt may be wrong now. Therefore, exit the VeraCrypt Volume Creation Wizard (if it is still running) and then start it again.\n8) Try encrypting the device/partition again.\n\nIf VeraCrypt repeatedly fails to encrypt the device/partition, you may want to consider creating a file container instead.</entry> - <entry lang="en" key="INPLACE_ENC_CANT_LOCK_OR_DISMOUNT_FILESYS">Error: The filesystem could not be locked and/or dismounted. It may be in use by the operating system or applications (for example, antivirus software). Encrypting the partition might cause data corruption and system instability.\n\nPlease close any applications that might be using the filesystem (including antivirus software) and try again. If it does not help, please follow the below steps.</entry> + <entry lang="en" key="FORMAT_CANT_UNMOUNT_FILESYS">Error: The device/partition contains a file system that could not be unmounted. The file system may be in use by the operating system. Formatting the device/partition would very likely cause data corruption and system instability.\n\nTo solve this issue, we recommend that you first delete the partition and then recreate it without formatting. To do so, follow these steps:\n1) Right-click the 'Computer' (or 'My Computer') icon in the 'Start Menu' and select 'Manage'. The 'Computer Management' window should appear.\n2) In the 'Computer Management' window, select 'Storage' > 'Disk Management'.\n3) Right-click the partition you want to encrypt and select either 'Delete Partition', or 'Delete Volume', or 'Delete Logical Drive'.\n4) Click 'Yes'. If Windows asks you to restart the computer, do so. Then repeat the steps 1 and 2 and continue from the step 5.\n5) Right-click the unallocated/free space area and select either 'New Partition', or 'New Simple Volume', or 'New Logical Drive'.\n6) The 'New Partition Wizard' or 'New Simple Volume Wizard' window should appear now; follow its instructions. On the wizard page entitled 'Format Partition', select either 'Do not format this partition' or 'Do not format this volume'. In the same wizard, click 'Next' and then 'Finish'.\n7) Note that the device path you have selected in VeraCrypt may be wrong now. Therefore, exit the VeraCrypt Volume Creation Wizard (if it is still running) and then start it again.\n8) Try encrypting the device/partition again.\n\nIf VeraCrypt repeatedly fails to encrypt the device/partition, you may want to consider creating a file container instead.</entry> + <entry lang="en" key="INPLACE_ENC_CANT_LOCK_OR_UNMOUNT_FILESYS">Error: The filesystem could not be locked and/or unmounted. It may be in use by the operating system or applications (for example, antivirus software). Encrypting the partition might cause data corruption and system instability.\n\nPlease close any applications that might be using the filesystem (including antivirus software) and try again. If it does not help, please follow the below steps.</entry> <entry lang="en" key="DEVICE_IN_USE_INFO">WARNING: Some of the mounted devices/partitions were already in use!\n\nIgnoring this can cause undesired results including system instability.\n\nWe strongly recommend that you close any application that might be using the devices/partitions.</entry> @@ -527,4 +527,4 @@ <entry lang="en" key="FIRST_HIDDEN_OS_BOOT_INFO">You have started the hidden operating system. As you may have noticed, the hidden operating system appears to be installed on the same partition as the original operating system. However, in reality, it is installed within the partition behind it (in the hidden volume). All read and write operations are being transparently redirected from the original system partition to the hidden volume.\n\nNeither the operating system nor applications will know that data written to and read from the system partition are actually written to and read from the partition behind it (from/to a hidden volume). Any such data is encrypted and decrypted on the fly as usual (with an encryption key different from the one that will be used for the decoy operating system).\n\n\nPlease click Next to continue.</entry> - <entry lang="en" key="HIDVOL_HOST_FILLING_HELP_SYSENC">The outer volume has been created and mounted as drive %hc:. To this outer volume you should now copy some sensitive-looking files that you actually do NOT want to hide. They will be there for anyone forcing you to disclose the password for the first partition behind the system partition, where both the outer volume and the hidden volume (containing the hidden operating system) will reside. You will be able to reveal the password for this outer volume, and the existence of the hidden volume (and of the hidden operating system) will remain secret.\n\nIMPORTANT: The files you copy to the outer volume should not occupy more than %s. Otherwise, there may not be enough free space on the outer volume for the hidden volume (and you will not be able to continue). After you finish copying, click Next (do not dismount the volume).</entry> - <entry lang="en" key="HIDVOL_HOST_FILLING_HELP">Outer volume has been successfully created and mounted as drive %hc:. To this volume you should now copy some sensitive-looking files that you actually do NOT want to hide. The files will be there for anyone forcing you to disclose your password. You will reveal only the password for this outer volume, not for the hidden one. The files that you really care about will be stored in the hidden volume, which will be created later on. When you finish copying, click Next. Do not dismount the volume.\n\nNote: After you click Next, cluster bitmap of the outer volume will be scanned to determine the size of uninterrupted area of free space whose end is aligned with the end of the volume. This area will accommodate the hidden volume, so it will limit its maximum possible size. Cluster bitmap scanning ensures that no data on the outer volume are overwritten by the hidden volume.</entry> + <entry lang="en" key="HIDVOL_HOST_FILLING_HELP_SYSENC">The outer volume has been created and mounted as drive %hc:. To this outer volume you should now copy some sensitive-looking files that you actually do NOT want to hide. They will be there for anyone forcing you to disclose the password for the first partition behind the system partition, where both the outer volume and the hidden volume (containing the hidden operating system) will reside. You will be able to reveal the password for this outer volume, and the existence of the hidden volume (and of the hidden operating system) will remain secret.\n\nIMPORTANT: The files you copy to the outer volume should not occupy more than %s. Otherwise, there may not be enough free space on the outer volume for the hidden volume (and you will not be able to continue). After you finish copying, click Next (do not unmount the volume).</entry> + <entry lang="en" key="HIDVOL_HOST_FILLING_HELP">Outer volume has been successfully created and mounted as drive %hc:. To this volume you should now copy some sensitive-looking files that you actually do NOT want to hide. The files will be there for anyone forcing you to disclose your password. You will reveal only the password for this outer volume, not for the hidden one. The files that you really care about will be stored in the hidden volume, which will be created later on. When you finish copying, click Next. Do not unmount the volume.\n\nNote: After you click Next, cluster bitmap of the outer volume will be scanned to determine the size of uninterrupted area of free space whose end is aligned with the end of the volume. This area will accommodate the hidden volume, so it will limit its maximum possible size. Cluster bitmap scanning ensures that no data on the outer volume are overwritten by the hidden volume.</entry> <entry lang="en" key="HIDVOL_HOST_FILLING_TITLE">Outer Volume Contents</entry> @@ -537,5 +537,5 @@ <entry lang="en" key="HIDVOL_PRE_CIPHER_TITLE">Hidden Volume</entry> - <entry lang="en" key="HIDVOL_PROT_WARN_AFTER_MOUNT">The hidden volume is now protected against damage until the outer volume is dismounted.\n\nWARNING: If any data is attempted to be saved to the hidden volume area, VeraCrypt will start write-protecting the entire volume (both the outer and the hidden part) until it is dismounted. This may cause filesystem corruption on the outer volume, which (if repeated) might adversely affect plausible deniability of the hidden volume. Therefore, you should make every effort to avoid writing to the hidden volume area. Any data being saved to the hidden volume area will not be saved and will be lost. Windows may report this as a write error ("Delayed Write Failed" or "The parameter is incorrect").</entry> - <entry lang="en" key="HIDVOL_PROT_WARN_AFTER_MOUNT_PLURAL">Each of the hidden volumes within the newly mounted volumes is now protected against damage until dismounted.\n\nWARNING: If any data is attempted to be saved to protected hidden volume area of any of these volumes, VeraCrypt will start write-protecting the entire volume (both the outer and the hidden part) until it is dismounted. This may cause filesystem corruption on the outer volume, which (if repeated) might adversely affect plausible deniability of the hidden volume. Therefore, you should make every effort to avoid writing to the hidden volume area. Any data being saved to protected hidden volume areas will not be saved and will be lost. Windows may report this as a write error ("Delayed Write Failed" or "The parameter is incorrect").</entry> - <entry lang="en" key="DAMAGE_TO_HIDDEN_VOLUME_PREVENTED">WARNING: Data were attempted to be saved to the hidden volume area of the volume mounted as %c:! VeraCrypt prevented these data from being saved in order to protect the hidden volume. This may have caused filesystem corruption on the outer volume and Windows may have reported a write error ("Delayed Write Failed" or "The parameter is incorrect"). The entire volume (both the outer and the hidden part) will be write-protected until it is dismounted. If this is not the first time VeraCrypt has prevented data from being saved to the hidden volume area of this volume, plausible deniability of this hidden volume might be adversely affected (due to possible unusual correlated inconsistencies within the outer volume file system). Therefore, you should consider creating a new VeraCrypt volume (with Quick Format disabled) and moving files from this volume to the new volume; this volume should be securely erased (both the outer and the hidden part). We strongly recommend that you restart the operating system now.</entry> + <entry lang="en" key="HIDVOL_PROT_WARN_AFTER_MOUNT">The hidden volume is now protected against damage until the outer volume is unmounted.\n\nWARNING: If any data is attempted to be saved to the hidden volume area, VeraCrypt will start write-protecting the entire volume (both the outer and the hidden part) until it is unmounted. This may cause filesystem corruption on the outer volume, which (if repeated) might adversely affect plausible deniability of the hidden volume. Therefore, you should make every effort to avoid writing to the hidden volume area. Any data being saved to the hidden volume area will not be saved and will be lost. Windows may report this as a write error ("Delayed Write Failed" or "The parameter is incorrect").</entry> + <entry lang="en" key="HIDVOL_PROT_WARN_AFTER_MOUNT_PLURAL">Each of the hidden volumes within the newly mounted volumes is now protected against damage until unmounted.\n\nWARNING: If any data is attempted to be saved to protected hidden volume area of any of these volumes, VeraCrypt will start write-protecting the entire volume (both the outer and the hidden part) until it is unmounted. This may cause filesystem corruption on the outer volume, which (if repeated) might adversely affect plausible deniability of the hidden volume. Therefore, you should make every effort to avoid writing to the hidden volume area. Any data being saved to protected hidden volume areas will not be saved and will be lost. Windows may report this as a write error ("Delayed Write Failed" or "The parameter is incorrect").</entry> + <entry lang="en" key="DAMAGE_TO_HIDDEN_VOLUME_PREVENTED">WARNING: Data were attempted to be saved to the hidden volume area of the volume mounted as %c:! VeraCrypt prevented these data from being saved in order to protect the hidden volume. This may have caused filesystem corruption on the outer volume and Windows may have reported a write error ("Delayed Write Failed" or "The parameter is incorrect"). The entire volume (both the outer and the hidden part) will be write-protected until it is unmounted. If this is not the first time VeraCrypt has prevented data from being saved to the hidden volume area of this volume, plausible deniability of this hidden volume might be adversely affected (due to possible unusual correlated inconsistencies within the outer volume file system). Therefore, you should consider creating a new VeraCrypt volume (with Quick Format disabled) and moving files from this volume to the new volume; this volume should be securely erased (both the outer and the hidden part). We strongly recommend that you restart the operating system now.</entry> <entry lang="en" key="CANNOT_SATISFY_OVER_4G_FILE_SIZE_REQ">You have indicated intent to store files larger than 4 GiB on the volume. This requires the volume to be formatted as NTFS/exFAT/ReFS, which, however, will not be possible.</entry> @@ -568,4 +568,4 @@ <entry lang="en" key="MAX_HIDVOL_SIZE_TB">Maximum possible hidden volume size for this volume is %.2f TiB.</entry> - <entry lang="en" key="MOUNTED_NOPWCHANGE">Volume password/keyfiles cannot be changed while the volume is mounted. Please dismount the volume first.</entry> - <entry lang="en" key="MOUNTED_NO_PKCS5_PRF_CHANGE">The header key derivation algorithm cannot be changed while the volume is mounted. Please dismount the volume first.</entry> + <entry lang="en" key="MOUNTED_NOPWCHANGE">Volume password/keyfiles cannot be changed while the volume is mounted. Please unmount the volume first.</entry> + <entry lang="en" key="MOUNTED_NO_PKCS5_PRF_CHANGE">The header key derivation algorithm cannot be changed while the volume is mounted. Please unmount the volume first.</entry> <entry lang="en" key="MOUNT_BUTTON">&Mount</entry> @@ -590,5 +590,5 @@ <entry lang="en" key="HIDDEN_VOLUME_TOO_SMALL_FOR_OS_CLONE">Error: The files you copied to the outer volume occupy too much space. Therefore, there is not enough free space on the outer volume for the hidden volume.\n\nNote that the hidden volume must be as large as the system partition (the partition where the currently running operating system is installed). The reason is that the hidden operating system needs to be created by copying the content of the system partition to the hidden volume.\n\n\nThe process of creation of the hidden operating system cannot continue.</entry> - <entry lang="en" key="OPENFILES_DRIVER">The driver is unable to dismount the volume. Some files located on the volume are probably still open.</entry> - <entry lang="en" key="OPENFILES_LOCK">Unable to lock the volume. There are still open files on the volume. Therefore, it cannot be dismounted.</entry> - <entry lang="en" key="VOL_LOCK_FAILED_OFFER_FORCED_DISMOUNT">VeraCrypt cannot lock the volume because it is in use by the system or applications (there may be open files on the volume).\n\nDo you want to force dismount on the volume?</entry> + <entry lang="en" key="OPENFILES_DRIVER">The driver is unable to unmount the volume. Some files located on the volume are probably still open.</entry> + <entry lang="en" key="OPENFILES_LOCK">Unable to lock the volume. There are still open files on the volume. Therefore, it cannot be unmounted.</entry> + <entry lang="en" key="VOL_LOCK_FAILED_OFFER_FORCED_UNMOUNT">VeraCrypt cannot lock the volume because it is in use by the system or applications (there may be open files on the volume).\n\nDo you want to force unmount on the volume?</entry> <entry lang="en" key="OPEN_VOL_TITLE">Select a VeraCrypt Volume</entry> @@ -696,6 +696,6 @@ <entry lang="en" key="ERR_UNKNOWN">An unspecified or unknown error occurred (%d).</entry> - <entry lang="en" key="UNMOUNTALL_LOCK_FAILED">Some volumes contain files or folders being used by applications or system.\n\nForce dismount?</entry> - <entry lang="en" key="UNMOUNT_BUTTON">&Dismount</entry> - <entry lang="en" key="UNMOUNT_FAILED">Dismount failed!</entry> - <entry lang="en" key="UNMOUNT_LOCK_FAILED">Volume contains files or folders being used by applications or system.\n\nForce dismount?</entry> + <entry lang="en" key="UNMOUNTALL_LOCK_FAILED">Some volumes contain files or folders being used by applications or system.\n\nForce unmount?</entry> + <entry lang="en" key="UNMOUNT_BUTTON">&Unmount</entry> + <entry lang="en" key="UNMOUNT_FAILED">Unmount failed!</entry> + <entry lang="en" key="UNMOUNT_LOCK_FAILED">Volume contains files or folders being used by applications or system.\n\nForce unmount?</entry> <entry lang="en" key="NO_VOLUME_MOUNTED_TO_DRIVE">No volume is mounted to the specified drive letter.</entry> @@ -731,3 +731,3 @@ <entry lang="en" key="CANT_MOUNT_VOLUME">Cannot mount volume.</entry> - <entry lang="en" key="CANT_DISMOUNT_VOLUME">Cannot dismount volume.</entry> + <entry lang="en" key="CANT_UNMOUNT_VOLUME">Cannot unmount volume.</entry> <entry lang="en" key="FORMAT_NTFS_FAILED">Windows failed to format the volume as NTFS/exFAT/ReFS.\n\nPlease select a different type of file system (if possible) and try again. Alternatively, you could leave the volume unformatted (select 'None' as the filesystem), exit this wizard, mount the volume, and then use either a system or a third-party tool to format the mounted volume (the volume will remain encrypted).</entry> @@ -773,3 +773,3 @@ <entry lang="en" key="INPLACE_DEC_GENERIC_ERR">An error prevented VeraCrypt from decrypting the volume. Please try fixing any previously reported problems and then try again if possible.</entry> - <entry lang="en" key="CANT_DISMOUNT_OUTER_VOL">Error: Cannot dismount the outer volume!\n\nVolume cannot be dismounted if it contains files or folders being used by a program or the system.\n\nPlease close any program that might be using files or directories on the volume and click Retry.</entry> + <entry lang="en" key="CANT_UNMOUNT_OUTER_VOL">Error: Cannot unmount the outer volume!\n\nVolume cannot be unmounted if it contains files or folders being used by a program or the system.\n\nPlease close any program that might be using files or directories on the volume and click Retry.</entry> <entry lang="en" key="CANT_GET_OUTER_VOL_INFO">Error: Cannot obtain information about the outer volume!\nVolume creation cannot continue.</entry> @@ -884,3 +884,3 @@ <entry lang="en" key="CLOSE_TC_FIRST">The VeraCrypt device driver cannot be unloaded.\n\nPlease close all open VeraCrypt windows first. If it does not help, please restart Windows and then try again.</entry> - <entry lang="en" key="DISMOUNT_ALL_FIRST">All VeraCrypt volumes must be dismounted before installing or uninstalling VeraCrypt.</entry> + <entry lang="en" key="UNMOUNT_ALL_FIRST">All VeraCrypt volumes must be unmounted before installing or uninstalling VeraCrypt.</entry> <entry lang="en" key="UNINSTALL_OLD_VERSION_FIRST">An obsolete version of VeraCrypt is currently installed on this system. It needs to be uninstalled before you can install this new version of VeraCrypt.\n\nAs soon as you close this message box, the uninstaller of the old version will be launched. Note that no volume will be decrypted when you uninstall VeraCrypt. After you uninstall the old version of VeraCrypt, run the installer of the new version of VeraCrypt again.</entry> @@ -905,3 +905,3 @@ <entry lang="en" key="OPEN">Open</entry> - <entry lang="en" key="DISMOUNT">Dismount</entry> + <entry lang="en" key="UNMOUNT">Unmount</entry> <entry lang="en" key="SHOW_TC">Show VeraCrypt</entry> @@ -977,3 +977,3 @@ <entry lang="en" key="SYS_FAVORITES_REQUIRE_PBA">The system partition/drive does not appear to be encrypted.\n\nSystem favorite volumes can be mounted using only a pre-boot authentication password. Therefore, to enable use of system favorite volumes, you need to encrypt the system partition/drive first.</entry> - <entry lang="en" key="DISMOUNT_FIRST">Please dismount the volume before proceeding.</entry> + <entry lang="en" key="UNMOUNT_FIRST">Please unmount the volume before proceeding.</entry> <entry lang="en" key="CANNOT_SET_TIMER">Error: Cannot set timer.</entry> @@ -999,3 +999,3 @@ <entry lang="en" key="EXE_FILE_EXTENSION_CONFIRM">WARNING: We strongly recommend that you avoid file extensions that are used for executable files (such as .exe, .sys, or .dll) and other similarly problematic file extensions. Using such file extensions causes Windows and antivirus software to interfere with the container, which adversely affects the performance of the volume and may also cause other serious problems.\n\nWe strongly recommend that you remove the file extension or change it (e.g., to '.hc').\n\nAre you sure you want to use the problematic file extension?</entry> - <entry lang="en" key="EXE_FILE_EXTENSION_MOUNT_WARNING">WARNING: This container has a file extension that is used for executable files (such as .exe, .sys, or .dll) or some other file extension that is similarly problematic. It will very likely cause Windows and antivirus software to interfere with the container, which will adversely affect the performance of the volume and may also cause other serious problems.\n\nWe strongly recommend that you remove the file extension of the container or change it (e.g., to '.hc') after you dismount the volume.</entry> + <entry lang="en" key="EXE_FILE_EXTENSION_MOUNT_WARNING">WARNING: This container has a file extension that is used for executable files (such as .exe, .sys, or .dll) or some other file extension that is similarly problematic. It will very likely cause Windows and antivirus software to interfere with the container, which will adversely affect the performance of the volume and may also cause other serious problems.\n\nWe strongly recommend that you remove the file extension of the container or change it (e.g., to '.hc') after you unmount the volume.</entry> <entry lang="en" key="HOMEPAGE">Homepage</entry> @@ -1008,10 +1008,10 @@ <entry lang="en" key="NO_VOLUME_SELECTED">No volume selected.\n\nClick 'Select Device' or 'Select File' to select a VeraCrypt volume.</entry> - <entry lang="en" key="NO_SYSENC_PARTITION_SELECTED">No partition selected.\n\nClick 'Select Device' to select a dismounted partition that normally requires pre-boot authentication (for example, a partition located on the encrypted system drive of another operating system, which is not running, or the encrypted system partition of another operating system).\n\nNote: The selected partition will be mounted as a regular VeraCrypt volume without pre-boot authentication. This is useful e.g. for backup or repair operations.</entry> + <entry lang="en" key="NO_SYSENC_PARTITION_SELECTED">No partition selected.\n\nClick 'Select Device' to select a unmounted partition that normally requires pre-boot authentication (for example, a partition located on the encrypted system drive of another operating system, which is not running, or the encrypted system partition of another operating system).\n\nNote: The selected partition will be mounted as a regular VeraCrypt volume without pre-boot authentication. This is useful e.g. for backup or repair operations.</entry> <entry lang="en" key="CONFIRM_SAVE_DEFAULT_KEYFILES">WARNING: If default keyfiles are set and enabled, volumes that are not using these keyfiles will be impossible to mount. Therefore, after you enable default keyfiles, keep in mind to uncheck the 'Use keyfiles' checkbox (below a password input field) whenever mounting such volumes.\n\nAre you sure you want to save the selected keyfiles/paths as default?</entry> <entry lang="en" key="HK_AUTOMOUNT_DEVICES">Auto-Mount Devices</entry> - <entry lang="en" key="HK_DISMOUNT_ALL">Dismount All</entry> + <entry lang="en" key="HK_UNMOUNT_ALL">Unmount All</entry> <entry lang="en" key="HK_WIPE_CACHE">Wipe Cache</entry> - <entry lang="en" key="HK_DISMOUNT_ALL_AND_WIPE">Dismount All & Wipe Cache</entry> - <entry lang="en" key="HK_FORCE_DISMOUNT_ALL_AND_WIPE">Force Dismount All & Wipe Cache</entry> - <entry lang="en" key="HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT">Force Dismount All, Wipe Cache & Exit</entry> + <entry lang="en" key="HK_UNMOUNT_ALL_AND_WIPE">Unmount All & Wipe Cache</entry> + <entry lang="en" key="HK_FORCE_UNMOUNT_ALL_AND_WIPE">Force Unmount All & Wipe Cache</entry> + <entry lang="en" key="HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT">Force Unmount All, Wipe Cache & Exit</entry> <entry lang="en" key="HK_MOUNT_FAVORITE_VOLUMES">Mount Favorite Volumes</entry> @@ -1027,10 +1027,10 @@ <entry lang="en" key="HIDDEN_OS_HIBERNATION_PREVENTED">Hibernation has been prevented.\n\nVeraCrypt does not support hibernation on hidden operating systems that use an extra boot partition. Please note that the boot partition is shared by both the decoy and the hidden system. Therefore, in order to prevent data leaks and problems while resuming from hibernation, VeraCrypt has to prevent the hidden system from writing to the shared boot partition and from hibernating.</entry> - <entry lang="en" key="VOLUME_MOUNTED_AS_DRIVE_LETTER_X_DISMOUNTED">VeraCrypt volume mounted as %c: has been dismounted.</entry> - <entry lang="en" key="MOUNTED_VOLUMES_DISMOUNTED">VeraCrypt volumes have been dismounted.</entry> - <entry lang="en" key="VOLUMES_DISMOUNTED_CACHE_WIPED">VeraCrypt volumes have been dismounted and password cache has been wiped.</entry> - <entry lang="en" key="SUCCESSFULLY_DISMOUNTED">Successfully dismounted</entry> - <entry lang="en" key="CONFIRM_BACKGROUND_TASK_DISABLED">WARNING: If the VeraCrypt Background Task is disabled, the following functions will be disabled:\n\n1) Hot keys\n2) Auto-dismount (e.g., upon logoff, inadvertent host device removal, time-out, etc.)\n3) Auto-mount of favorite volumes\n4) Notifications (e.g., when damage to hidden volume is prevented)\n5) Tray icon\n\nNote: You can shut down the Background Task anytime by right-clicking the VeraCrypt tray icon and selecting 'Exit'.\n\nAre you sure you want to permanently disable the VeraCrypt Background Task?</entry> - <entry lang="en" key="CONFIRM_NO_FORCED_AUTODISMOUNT">WARNING: If this option is disabled, volumes containing open files/directories will not be possible to auto-dismount.\n\nAre you sure you want to disable this option?</entry> - <entry lang="en" key="WARN_PREF_AUTO_DISMOUNT">WARNING: Volumes containing open files/directories will NOT be auto-dismounted.\n\nTo prevent this, enable the following option in this dialog window: 'Force auto-dismount even if volume contains open files or directories'</entry> - <entry lang="en" key="WARN_PREF_AUTO_DISMOUNT_ON_POWER">WARNING: When the notebook battery power is low, Windows may omit sending the appropriate messages to running applications when the computer is entering power saving mode. Therefore, VeraCrypt may fail to auto-dismount volumes in such cases.</entry> + <entry lang="en" key="VOLUME_MOUNTED_AS_DRIVE_LETTER_X_UNMOUNTED">VeraCrypt volume mounted as %c: has been unmounted.</entry> + <entry lang="en" key="MOUNTED_VOLUMES_UNMOUNTED">VeraCrypt volumes have been unmounted.</entry> + <entry lang="en" key="VOLUMES_UNMOUNTED_CACHE_WIPED">VeraCrypt volumes have been unmounted and password cache has been wiped.</entry> + <entry lang="en" key="SUCCESSFULLY_UNMOUNTED">Successfully unmounted</entry> + <entry lang="en" key="CONFIRM_BACKGROUND_TASK_DISABLED">WARNING: If the VeraCrypt Background Task is disabled, the following functions will be disabled:\n\n1) Hot keys\n2) Auto-unmount (e.g., upon logoff, inadvertent host device removal, time-out, etc.)\n3) Auto-mount of favorite volumes\n4) Notifications (e.g., when damage to hidden volume is prevented)\n5) Tray icon\n\nNote: You can shut down the Background Task anytime by right-clicking the VeraCrypt tray icon and selecting 'Exit'.\n\nAre you sure you want to permanently disable the VeraCrypt Background Task?</entry> + <entry lang="en" key="CONFIRM_NO_FORCED_AUTOUNMOUNT">WARNING: If this option is disabled, volumes containing open files/directories will not be possible to auto-unmount.\n\nAre you sure you want to disable this option?</entry> + <entry lang="en" key="WARN_PREF_AUTO_UNMOUNT">WARNING: Volumes containing open files/directories will NOT be auto-unmounted.\n\nTo prevent this, enable the following option in this dialog window: 'Force auto-unmount even if volume contains open files or directories'</entry> + <entry lang="en" key="WARN_PREF_AUTO_UNMOUNT_ON_POWER">WARNING: When the notebook battery power is low, Windows may omit sending the appropriate messages to running applications when the computer is entering power saving mode. Therefore, VeraCrypt may fail to auto-unmount volumes in such cases.</entry> <entry lang="en" key="NONSYS_INPLACE_ENC_RESUME_PROMPT">You have scheduled the process of encryption/decryption of a partition/volume. The process has not been completed yet.\n\nDo you want to resume the process now?</entry> @@ -1042,3 +1042,3 @@ <entry lang="en" key="SYSTEM_ENCRYPTION_SCHEDULED_BUT_PBA_FAILED">You have scheduled the process of encryption or decryption of the system partition/drive. However, pre-boot authentication failed (or was bypassed).\n\nNote: If you decrypted the system partition/drive in the pre-boot environment, you may need to finalize the process by selecting 'System' > 'Permanently Decrypt System Partition/Drive' from the menu bar of the main VeraCrypt window.</entry> - <entry lang="en" key="CONFIRM_EXIT">WARNING: If VeraCrypt exits now, the following functions will be disabled:\n\n1) Hot keys\n2) Auto-dismount (e.g., upon logoff, inadvertent host device removal, time-out, etc.)\n3) Auto-mount of favorite volumes\n4) Notifications (e.g., when damage to hidden volume is prevented)\n\nNote: If you do not wish VeraCrypt to run in the background, disable the VeraCrypt Background Task in the Preferences (and, if necessary, disable the automatic start of VeraCrypt in the Preferences).\n\nAre you sure you want VeraCrypt to exit?</entry> + <entry lang="en" key="CONFIRM_EXIT">WARNING: If VeraCrypt exits now, the following functions will be disabled:\n\n1) Hot keys\n2) Auto-unmount (e.g., upon logoff, inadvertent host device removal, time-out, etc.)\n3) Auto-mount of favorite volumes\n4) Notifications (e.g., when damage to hidden volume is prevented)\n\nNote: If you do not wish VeraCrypt to run in the background, disable the VeraCrypt Background Task in the Preferences (and, if necessary, disable the automatic start of VeraCrypt in the Preferences).\n\nAre you sure you want VeraCrypt to exit?</entry> <entry lang="en" key="CONFIRM_EXIT_UNIVERSAL">Exit?</entry> @@ -1065,3 +1065,3 @@ <entry lang="en" key="MOUNT_TC_VOLUME">Mount VeraCrypt volume</entry> - <entry lang="en" key="DISMOUNT_ALL_TC_VOLUMES">Dismount all VeraCrypt volumes</entry> + <entry lang="en" key="UNMOUNT_ALL_TC_VOLUMES">Unmount all VeraCrypt volumes</entry> <entry lang="en" key="UAC_INIT_ERROR">VeraCrypt failed to obtain Administrator privileges.</entry> @@ -1287,4 +1287,4 @@ <entry lang="en" key="SYS_FAVORITES_KEYBOARD_WARNING">System favorite volumes will be mounted using the pre-boot authentication password. If any system favorite volume uses a different password, it will not be mounted.</entry> - <entry lang="en" key="SYS_FAVORITES_ADMIN_ONLY_INFO">Please note that if you need to prevent normal VeraCrypt volume actions (such as 'Dismount All', auto-dismount, etc.) from affecting system favorite volumes, you should enable the option 'Allow only administrators to view and dismount system favorite volumes in VeraCrypt'. In addition, when VeraCrypt is run without administrator privileges (the default on Windows Vista and later), system favorite volumes will not be displayed in the drive letter list in the main VeraCrypt application window.</entry> - <entry lang="en" key="SYS_FAVORITES_ADMIN_ONLY_WARNING">IMPORTANT: Please keep in mind that if this option is enabled and VeraCrypt does not have administrator privileges, mounted system favorite volumes are NOT displayed in the VeraCrypt application window and they cannot be dismounted. Therefore, if you need e.g. to dismount a system favorite volume, please right-click the VeraCrypt icon (in the Start menu) and select 'Run as administrator' first. The same limitation applies to the 'Dismount All' function, 'Auto-Dismount' functions, 'Dismount All' hot keys, etc.</entry> + <entry lang="en" key="SYS_FAVORITES_ADMIN_ONLY_INFO">Please note that if you need to prevent normal VeraCrypt volume actions (such as 'Unmount All', auto-unmount, etc.) from affecting system favorite volumes, you should enable the option 'Allow only administrators to view and unmount system favorite volumes in VeraCrypt'. In addition, when VeraCrypt is run without administrator privileges (the default on Windows Vista and later), system favorite volumes will not be displayed in the drive letter list in the main VeraCrypt application window.</entry> + <entry lang="en" key="SYS_FAVORITES_ADMIN_ONLY_WARNING">IMPORTANT: Please keep in mind that if this option is enabled and VeraCrypt does not have administrator privileges, mounted system favorite volumes are NOT displayed in the VeraCrypt application window and they cannot be unmounted. Therefore, if you need e.g. to unmount a system favorite volume, please right-click the VeraCrypt icon (in the Start menu) and select 'Run as administrator' first. The same limitation applies to the 'Unmount All' function, 'Auto-Unmount' functions, 'Unmount All' hot keys, etc.</entry> <entry lang="en" key="SETTING_REQUIRES_REBOOT">Note that this setting takes effect only after the operating system is restarted.</entry> @@ -1294,6 +1294,6 @@ <entry lang="en" key="SELECT_DEVICE_AND_MOUNT">Select &Device and Mount...</entry> - <entry lang="en" key="DISABLE_NONADMIN_SYS_FAVORITES_ACCESS">Allow only administrators to view and dismount system favorite volumes in VeraCrypt</entry> + <entry lang="en" key="DISABLE_NONADMIN_SYS_FAVORITES_ACCESS">Allow only administrators to view and unmount system favorite volumes in VeraCrypt</entry> <entry lang="en" key="MOUNT_SYSTEM_FAVORITES_ON_BOOT">Mount system favorite volumes when Windows starts (in the initial phase of the startup procedure)</entry> - <entry lang="en" key="MOUNTED_VOLUME_DIRTY">Warning: The filesystem on the volume mounted as '%s' was not cleanly dismounted and thus may contain errors. Using a corrupted filesystem can cause data loss or data corruption.\n\nNote: Before you physically remove or switch off a device (such as a USB flash drive or an external hard drive) where a mounted VeraCrypt volume resides, you should always dismount the VeraCrypt volume in VeraCrypt first.\n\n\nDo you want Windows to attempt to detect and fix errors (if any) on the filesystem?</entry> - <entry lang="en" key="SYS_FAVORITE_VOLUME_DIRTY">Warning: One or more system favorite volumes were not cleanly dismounted and thus may contain filesystem errors. Please see the system event log for further details.\n\nUsing a corrupted filesystem can cause data loss or data corruption. You should check the affected system favorite volume(s) for errors (right-click each of them in VeraCrypt and select 'Repair Filesystem').</entry> + <entry lang="en" key="MOUNTED_VOLUME_DIRTY">Warning: The filesystem on the volume mounted as '%s' was not cleanly unmounted and thus may contain errors. Using a corrupted filesystem can cause data loss or data corruption.\n\nNote: Before you physically remove or switch off a device (such as a USB flash drive or an external hard drive) where a mounted VeraCrypt volume resides, you should always unmount the VeraCrypt volume in VeraCrypt first.\n\n\nDo you want Windows to attempt to detect and fix errors (if any) on the filesystem?</entry> + <entry lang="en" key="SYS_FAVORITE_VOLUME_DIRTY">Warning: One or more system favorite volumes were not cleanly unmounted and thus may contain filesystem errors. Please see the system event log for further details.\n\nUsing a corrupted filesystem can cause data loss or data corruption. You should check the affected system favorite volume(s) for errors (right-click each of them in VeraCrypt and select 'Repair Filesystem').</entry> <entry lang="en" key="FILESYS_REPAIR_CONFIRM_BACKUP">Warning: Repairing a damaged filesystem using the Microsoft 'chkdsk' tool might cause loss of files in damaged areas. Therefore, it is recommended that you first back up the files stored on the VeraCrypt volume to another, healthy, VeraCrypt volume.\n\nDo you want to repair the filesystem now?</entry> @@ -1308,4 +1308,4 @@ <entry lang="en" key="CONFIRM_SETTING_DEGRADES_PERFORMANCE">WARNING: This setting may degrade performance.\n\nAre you sure you want to use this setting?</entry> - <entry lang="en" key="HOST_DEVICE_REMOVAL_DISMOUNT_WARN_TITLE">Warning: VeraCrypt volume auto-dismounted</entry> - <entry lang="en" key="HOST_DEVICE_REMOVAL_DISMOUNT_WARN">Before you physically remove or turn off a device containing a mounted volume, you should always dismount the volume in VeraCrypt first.\n\nUnexpected spontaneous dismount is usually caused by an intermittently failing cable, drive (enclosure), etc.</entry> + <entry lang="en" key="HOST_DEVICE_REMOVAL_UNMOUNT_WARN_TITLE">Warning: VeraCrypt volume auto-unmounted</entry> + <entry lang="en" key="HOST_DEVICE_REMOVAL_UNMOUNT_WARN">Before you physically remove or turn off a device containing a mounted volume, you should always unmount the volume in VeraCrypt first.\n\nUnexpected spontaneous unmount is usually caused by an intermittently failing cable, drive (enclosure), etc.</entry> <entry lang="en" key="UNSUPPORTED_TRUECRYPT_FORMAT">This volume was created with TrueCrypt %x.%x but VeraCrypt supports only TrueCrypt volumes created with TrueCrypt 6.x/7.x series</entry> @@ -1455,3 +1455,3 @@ <entry lang="en" key="TASKICON_PREF_OPEN_VOL">Open Mounted Volumes</entry> - <entry lang="en" key="TASKICON_PREF_DISMOUNT_VOL">Dismount Mounted Volumes</entry> + <entry lang="en" key="TASKICON_PREF_UNMOUNT_VOL">Unmount Mounted Volumes</entry> <entry lang="en" key="DISK_FREE">Free space available: {0}</entry> @@ -1485,10 +1485,10 @@ <entry lang="en" key="LINUX_SELECT">Se&lect...</entry> - <entry lang="en" key="LINUX_DISMOUNT_ALL_WHEN">Dismount All Volumes When</entry> + <entry lang="en" key="LINUX_UNMOUNT_ALL_WHEN">Unmount All Volumes When</entry> <entry lang="en" key="LINUX_ENTERING_POWERSAVING">System is entering power saving mode</entry> <entry lang="en" key="LINUX_LOGIN_ACTION">Actions to Perform when User Logs On</entry> - <entry lang="en" key="LINUX_CLOSE_EXPL_ON_DISMOUNT">Close all Explorer windows of volume being dismounted</entry> + <entry lang="en" key="LINUX_CLOSE_EXPL_ON_UNMOUNT">Close all Explorer windows of volume being unmounted</entry> <entry lang="en" key="LINUX_HOTKEYS">Hotkeys</entry> <entry lang="en" key="LINUX_SYSTEM_HOTKEYS">System-Wide Hotkeys</entry> - <entry lang="en" key="LINUX_SOUND_NOTIFICATION">Play system notification sound after mount/dismount</entry> - <entry lang="en" key="LINUX_CONFIRM_AFTER_DISMOUNT">Display confirmation message box after dismount</entry> + <entry lang="en" key="LINUX_SOUND_NOTIFICATION">Play system notification sound after mount/unmount</entry> + <entry lang="en" key="LINUX_CONFIRM_AFTER_UNMOUNT">Display confirmation message box after unmount</entry> <entry lang="en" key="LINUX_VC_QUITS">VeraCrypt quits</entry> @@ -1512,3 +1512,3 @@ <entry lang="en" key="LINUX_OPEN_OUTER_VOL">Open Outer Volume</entry> - <entry lang="en" key="LINUX_OUTER_VOL_IS_MOUNTED">Outer volume has been successfully created and mounted as '{0}'. To this volume you should now copy some sensitive-looking files that you actually do NOT want to hide. The files will be there for anyone forcing you to disclose your password. You will reveal only the password for this outer volume, not for the hidden one. The files that you really care about will be stored in the hidden volume, which will be created later on. When you finish copying, click Next. Do not dismount the volume.\n\nNote: After you click Next, the outer volume will be analyzed to determine the size of uninterrupted area of free space whose end is aligned with the end of the volume. This area will accommodate the hidden volume, so it will limit its maximum possible size. The procedure ensures no data on the outer volume are overwritten by the hidden volume.</entry> + <entry lang="en" key="LINUX_OUTER_VOL_IS_MOUNTED">Outer volume has been successfully created and mounted as '{0}'. To this volume you should now copy some sensitive-looking files that you actually do NOT want to hide. The files will be there for anyone forcing you to disclose your password. You will reveal only the password for this outer volume, not for the hidden one. The files that you really care about will be stored in the hidden volume, which will be created later on. When you finish copying, click Next. Do not unmount the volume.\n\nNote: After you click Next, the outer volume will be analyzed to determine the size of uninterrupted area of free space whose end is aligned with the end of the volume. This area will accommodate the hidden volume, so it will limit its maximum possible size. The procedure ensures no data on the outer volume are overwritten by the hidden volume.</entry> <entry lang="en" key="LINUX_ERROR_TRY_ENCRYPT_SYSTEM_DRIVE">Error: You are trying to encrypt a system drive.\n\nVeraCrypt can encrypt a system drive only under Windows.</entry> @@ -1516,3 +1516,3 @@ <entry lang="en" key="LINUX_WARNING_FORMAT_DESTROY_FS">WARNING: Formatting of the device will destroy all data on filesystem '{0}'.\n\nDo you want to continue?</entry> - <entry lang="en" key="LINUX_MOUNTET_HINT">The filesystem of the selected device is currently mounted. Please dismount '{0}' before proceeding.</entry> + <entry lang="en" key="LINUX_MOUNTET_HINT">The filesystem of the selected device is currently mounted. Please unmount '{0}' before proceeding.</entry> <entry lang="en" key="LINUX_HIDDEN_PASS_NO_DIFF">The Hidden volume can't have the same password, PIM and keyfiles as the Outer volume</entry> @@ -1524,3 +1524,3 @@ <entry lang="en" key="LINUX_KERNEL_OLD">Your system uses an old version of the Linux kernel.\n\nDue to a bug in the Linux kernel, your system may stop responding when writing data to a VeraCrypt volume. This problem can be solved by upgrading the kernel to version 2.6.24 or later.</entry> - <entry lang="en" key="LINUX_VOL_DISMOUNTED">Volume {0} has been dismounted.</entry> + <entry lang="en" key="LINUX_VOL_UNMOUNTED">Volume {0} has been unmounted.</entry> <entry lang="en" key="LINUX_VOL_MOUNTED">Volume {0} has been mounted.</entry> @@ -1643,2 +1643,5 @@ <entry lang="en" key="ERR_XTS_MASTERKEY_VULNERABLE_SHORT">WARNING: The volume's master key has a security vulnerability.</entry> + <entry lang="en" key="MOUNTPOINT_BLOCKED">ERROR: The volume mount point is blocked because it overrides a protected system directory.\n\nPlease choose a different mount point.</entry> + <entry lang="en" key="MOUNTPOINT_NOTALLOWED">ERROR: The volume mount point is not allowed because it overrides a directory that is part of the PATH environment variable.\n\nPlease choose a different mount point.</entry> + <entry lang="en" key="INSECURE_MODE">[INSECURE MODE]</entry> </localization> diff --git a/src/Common/Password.c b/src/Common/Password.c index aed7cfb9..ed662a88 100644 --- a/src/Common/Password.c +++ b/src/Common/Password.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Password.h b/src/Common/Password.h index dd3fbed6..9f2f0145 100644 --- a/src/Common/Password.h +++ b/src/Common/Password.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Pkcs5.c b/src/Common/Pkcs5.c index 6d8ce08a..fbe22275 100644 --- a/src/Common/Pkcs5.c +++ b/src/Common/Pkcs5.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Pkcs5.h b/src/Common/Pkcs5.h index 65fad038..41679fe7 100644 --- a/src/Common/Pkcs5.h +++ b/src/Common/Pkcs5.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Progress.c b/src/Common/Progress.c index 24efcad5..2abf782c 100644 --- a/src/Common/Progress.c +++ b/src/Common/Progress.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Progress.h b/src/Common/Progress.h index d86e51ac..6642bb35 100644 --- a/src/Common/Progress.h +++ b/src/Common/Progress.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Random.c b/src/Common/Random.c index 0cd6bfa0..4c6382b4 100644 --- a/src/Common/Random.c +++ b/src/Common/Random.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -804,2 +804,3 @@ BOOL SlowPoll (void) +#ifndef _M_ARM64 // use RDSEED or RDRAND from CPU as source of entropy if present @@ -812,2 +813,3 @@ BOOL SlowPoll (void) } +#endif @@ -935,2 +937,3 @@ BOOL FastPoll (void) +#ifndef _M_ARM64 // use RDSEED or RDRAND from CPU as source of entropy if enabled @@ -943,2 +946,3 @@ BOOL FastPoll (void) } +#endif diff --git a/src/Common/Random.h b/src/Common/Random.h index 68758782..9d7e345a 100644 --- a/src/Common/Random.h +++ b/src/Common/Random.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Registry.c b/src/Common/Registry.c index b04bbf60..f5aa4053 100644 --- a/src/Common/Registry.c +++ b/src/Common/Registry.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Registry.h b/src/Common/Registry.h index ea449d3e..0e869281 100644 --- a/src/Common/Registry.h +++ b/src/Common/Registry.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/SecurityToken.cpp b/src/Common/SecurityToken.cpp index cd4926a0..85219395 100644 --- a/src/Common/SecurityToken.cpp +++ b/src/Common/SecurityToken.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/SecurityToken.h b/src/Common/SecurityToken.h index 6c454def..9f024b36 100644 --- a/src/Common/SecurityToken.h +++ b/src/Common/SecurityToken.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Tcdefs.h b/src/Common/Tcdefs.h index 0051dba2..ee5751b7 100644 --- a/src/Common/Tcdefs.h +++ b/src/Common/Tcdefs.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -61,3 +61,3 @@ extern unsigned short _rotl16(unsigned short value, unsigned char shift); // Version displayed to user -#define VERSION_STRING "1.26.17" +#define VERSION_STRING "1.26.20" @@ -75,5 +75,5 @@ extern unsigned short _rotl16(unsigned short value, unsigned char shift); // Release date -#define TC_STR_RELEASE_DATE L"November 24, 2024" -#define TC_RELEASE_DATE_YEAR 2024 -#define TC_RELEASE_DATE_MONTH 11 +#define TC_STR_RELEASE_DATE L"February 3, 2025" +#define TC_RELEASE_DATE_YEAR 2025 +#define TC_RELEASE_DATE_MONTH 2 @@ -263,3 +263,3 @@ extern ULONG AllocTag; -#define TCalloc(size) ((void *) ExAllocatePool2( POOL_FLAG_NON_PAGED, size, AllocTag )) +#define TCalloc(size) ((void *) ExAllocatePoolUninitialized( NonPagedPoolNx , size, AllocTag )) #define TCfree(memblock) ExFreePoolWithTag( memblock, AllocTag ) diff --git a/src/Common/Tests.c b/src/Common/Tests.c index 1f4178c6..89af24f1 100644 --- a/src/Common/Tests.c +++ b/src/Common/Tests.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -1492,3 +1492,5 @@ BOOL AutoTestAlgorithms (void) EnableHwEncryption (hwEncryptionEnabled); +#ifndef _M_ARM64 DisableCPUExtendedFeatures (); +#endif __try diff --git a/src/Common/Tests.h b/src/Common/Tests.h index bfdf7c40..9b9d09e4 100644 --- a/src/Common/Tests.h +++ b/src/Common/Tests.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Volumes.c b/src/Common/Volumes.c index 60d1b417..10f03636 100644 --- a/src/Common/Volumes.c +++ b/src/Common/Volumes.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Volumes.h b/src/Common/Volumes.h index 07ed0fe8..98b2f8d6 100644 --- a/src/Common/Volumes.h +++ b/src/Common/Volumes.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Wipe.c b/src/Common/Wipe.c index af3d15db..66d633b8 100644 --- a/src/Common/Wipe.c +++ b/src/Common/Wipe.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Wipe.h b/src/Common/Wipe.h index 09b9d71e..b8bd0fac 100644 --- a/src/Common/Wipe.h +++ b/src/Common/Wipe.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Xml.c b/src/Common/Xml.c index 9f77b3ba..d48940ed 100644 --- a/src/Common/Xml.c +++ b/src/Common/Xml.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Xml.h b/src/Common/Xml.h index 09b8543a..d442f187 100644 --- a/src/Common/Xml.h +++ b/src/Common/Xml.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Xts.c b/src/Common/Xts.c index 4a62aaf3..99999f11 100644 --- a/src/Common/Xts.c +++ b/src/Common/Xts.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Xts.h b/src/Common/Xts.h index b4b4058e..0cc3a99f 100644 --- a/src/Common/Xts.h +++ b/src/Common/Xts.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Common/Zip.vcxproj b/src/Common/Zip.vcxproj index 6674ef34..a8fbf1eb 100644 --- a/src/Common/Zip.vcxproj +++ b/src/Common/Zip.vcxproj @@ -116,2 +116,3 @@ <ClCompile Include="libzip\zip_source_function.c" /> + <ClCompile Include="libzip\zip_source_get_dostime.c" /> <ClCompile Include="libzip\zip_source_get_file_attributes.c" /> diff --git a/src/Common/Zip.vcxproj.filters b/src/Common/Zip.vcxproj.filters index 92bcf493..eb88a358 100644 --- a/src/Common/Zip.vcxproj.filters +++ b/src/Common/Zip.vcxproj.filters @@ -401,2 +401,5 @@ </ClCompile> + <ClCompile Include="libzip\zip_source_get_dostime.c"> + <Filter>libzip</Filter> + </ClCompile> </ItemGroup> diff --git a/src/Common/libzip/NEWS.md b/src/Common/libzip/NEWS.md index e117422d..d2b1e73d 100644 --- a/src/Common/libzip/NEWS.md +++ b/src/Common/libzip/NEWS.md @@ -1 +1,18 @@ +# 1.11.2 [2024-10-31] + +* Fix performance regression in `zip_stat` introduced in 1.11. + +# 1.11.1 [2024-09-19] + +* Fix zipconf.h for version number with missing third component. + +# 1.11 [2024-09-19] + +* Stop searching after finding acceptable central directory, even if it contains inconsistencies. +* Only write Zip64 EOCD if fields don't fit in normal EOCD. Previously libzip also wrote it when any directory entry required Zip64. +* Allow bytes from 0x00-0x1F as UTF-8. +* Add new error code `ZIP_ER_TRUNCATED_ZIP` for files that start with a valid local header signature. +* `zipcmp`: add `-T` option for comparing timestamps. +* `zip_file_replace` now removes the target's extra field information. + # 1.10.1 [2023-08-23] diff --git a/src/Common/libzip/compat.h b/src/Common/libzip/compat.h index 296ee59e..2cbc19f8 100644 --- a/src/Common/libzip/compat.h +++ b/src/Common/libzip/compat.h @@ -5,3 +5,3 @@ compat.h -- compatibility defines. - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner @@ -128,4 +128,54 @@ typedef char bool; -#ifndef HAVE_FSEEKO -#define fseeko(s, o, w) (fseek((s), (long int)(o), (w))) + +#if defined(HAVE__FSEEKI64) && defined(HAVE__FSTAT64) && defined(HAVE__FTELLI64) +/* Windows API using int64 */ +typedef zip_int64_t zip_off_t; +typedef struct _stat64 zip_os_stat_t; +#define zip_os_stat _stat64 +#define zip_os_fstat _fstat64 +#define zip_os_fseek _fseeki64 +#define zip_os_ftell _ftelli64 +#define ZIP_FSEEK_MAX ZIP_INT64_MAX +#define ZIP_FSEEK_MIN ZIP_INT64_MIN +#else + +/* Normal API */ +#include <sys/stat.h> +typedef struct stat zip_os_stat_t; +#define zip_os_fstat fstat +#define zip_os_stat stat + +#if defined(HAVE_FTELLO) && defined(HAVE_FSEEKO) +/* Using off_t */ +typedef off_t zip_off_t; +#if SIZEOF_OFF_T == 8 +#define ZIP_OFF_MAX ZIP_INT64_MAX +#define ZIP_OFF_MIN ZIP_INT64_MIN +#elif SIZEOF_OFF_T == 4 +#define ZIP_OFF_MAX ZIP_INT32_MAX +#define ZIP_OFF_MIN ZIP_INT32_MIN +#elif SIZEOF_OFF_T == 2 +#define ZIP_OFF_MAX ZIP_INT16_MAX +#define ZIP_OFF_MIN ZIP_INT16_MIN +#else +#error unsupported size of off_t +#endif + +#define ZIP_FSEEK_MAX ZIP_OFF_MAX +#define ZIP_FSEEK_MIN ZIP_OFF_MIN + +#define zip_os_fseek fseeko +#define zip_os_ftell ftello +#else + +/* Using long */ +typedef long zip_off_t; +#include <limits.h> +#define ZIP_FSEEK_MAX LONG_MAX +#define ZIP_FSEEK_MIN LONG_MIN + +#define zip_os_fseek fseek +#define zip_os_ftell ftell +#endif + #endif @@ -136,2 +186,3 @@ typedef char bool; + #ifdef HAVE_LOCALTIME_S @@ -184,23 +235,2 @@ typedef char bool; -#if SIZEOF_OFF_T == 8 -#define ZIP_OFF_MAX ZIP_INT64_MAX -#define ZIP_OFF_MIN ZIP_INT64_MIN -#elif SIZEOF_OFF_T == 4 -#define ZIP_OFF_MAX ZIP_INT32_MAX -#define ZIP_OFF_MIN ZIP_INT32_MIN -#elif SIZEOF_OFF_T == 2 -#define ZIP_OFF_MAX ZIP_INT16_MAX -#define ZIP_OFF_MIN ZIP_INT16_MIN -#else -#error unsupported size of off_t -#endif - -#if defined(HAVE_FTELLO) && defined(HAVE_FSEEKO) -#define ZIP_FSEEK_MAX ZIP_OFF_MAX -#define ZIP_FSEEK_MIN ZIP_OFF_MIN -#else -#include <limits.h> -#define ZIP_FSEEK_MAX LONG_MAX -#define ZIP_FSEEK_MIN LONG_MIN -#endif diff --git a/src/Common/libzip/config.h b/src/Common/libzip/config.h index 2976249c..5edc625f 100644 --- a/src/Common/libzip/config.h +++ b/src/Common/libzip/config.h @@ -12,2 +12,5 @@ #define HAVE__FILENO +#define HAVE__FSEEKI64 +#define HAVE__FSTAT64 +#define HAVE__FTELLI64 #define HAVE__SETMODE @@ -20,2 +23,3 @@ #define HAVE__SNWPRINTF_S +#define HAVE__STAT64 #define HAVE__STRDUP @@ -90,3 +94,3 @@ #define PACKAGE "libzip" -#define VERSION "1.10.1" +#define VERSION "1.11.2" diff --git a/src/Common/libzip/zip.h b/src/Common/libzip/zip.h index dc3751c8..da57ea56 100644 --- a/src/Common/libzip/zip.h +++ b/src/Common/libzip/zip.h @@ -5,3 +5,3 @@ zip.h -- exported declarations. - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -160,2 +160,3 @@ extern "C" { #define ZIP_ER_NOT_ALLOWED 34 /* N Not allowed in torrentzip */ +#define ZIP_ER_TRUNCATED_ZIP 35 /* N Possibly truncated or corrupted zip archive */ @@ -262,3 +263,4 @@ enum zip_source_cmd { ZIP_SOURCE_GET_FILE_ATTRIBUTES, /* get additional file attributes */ - ZIP_SOURCE_SUPPORTS_REOPEN /* allow reading from changed entry */ + ZIP_SOURCE_SUPPORTS_REOPEN, /* allow reading from changed entry */ + ZIP_SOURCE_GET_DOS_TIME /* get last modification time in DOS format */ }; diff --git a/src/Common/libzip/zip_add.c b/src/Common/libzip/zip_add.c index 9770139d..a426a579 100644 --- a/src/Common/libzip/zip_add.c +++ b/src/Common/libzip/zip_add.c @@ -2,3 +2,3 @@ zip_add.c -- add file via callback function - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_add_dir.c b/src/Common/libzip/zip_add_dir.c index c31fea36..2faaa1a6 100644 --- a/src/Common/libzip/zip_add_dir.c +++ b/src/Common/libzip/zip_add_dir.c @@ -2,3 +2,3 @@ zip_add_dir.c -- add directory - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_add_entry.c b/src/Common/libzip/zip_add_entry.c index bf12dd54..e8beaa81 100644 --- a/src/Common/libzip/zip_add_entry.c +++ b/src/Common/libzip/zip_add_entry.c @@ -2,3 +2,3 @@ zip_add_entry.c -- create and init struct zip_entry - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -66,3 +66,3 @@ _zip_add_entry(zip_t *za) { rentries = (zip_entry_t *)realloc(za->entry, sizeof(struct zip_entry) * (size_t)nalloc); - if (!rentries) { + if (rentries == NULL) { zip_error_set(&za->error, ZIP_ER_MEMORY, 0); diff --git a/src/Common/libzip/zip_algorithm_bzip2.c b/src/Common/libzip/zip_algorithm_bzip2.c index f25be143..1818039e 100644 --- a/src/Common/libzip/zip_algorithm_bzip2.c +++ b/src/Common/libzip/zip_algorithm_bzip2.c @@ -2,3 +2,3 @@ zip_algorithm_bzip2.c -- bzip2 (de)compression routines - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_algorithm_deflate.c b/src/Common/libzip/zip_algorithm_deflate.c index 3c85e204..5ab879df 100644 --- a/src/Common/libzip/zip_algorithm_deflate.c +++ b/src/Common/libzip/zip_algorithm_deflate.c @@ -2,3 +2,3 @@ zip_algorithm_deflate.c -- deflate (de)compression routines - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_algorithm_xz.c b/src/Common/libzip/zip_algorithm_xz.c index d7a7142d..b0413e01 100644 --- a/src/Common/libzip/zip_algorithm_xz.c +++ b/src/Common/libzip/zip_algorithm_xz.c @@ -3,3 +3,3 @@ Bazed on zip_algorithm_deflate.c -- deflate (de)compression routines - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_algorithm_zstd.c b/src/Common/libzip/zip_algorithm_zstd.c index d005da9d..b2aa2132 100644 --- a/src/Common/libzip/zip_algorithm_zstd.c +++ b/src/Common/libzip/zip_algorithm_zstd.c @@ -2,3 +2,3 @@ zip_algorithm_zstd.c -- zstd (de)compression routines - Copyright (C) 2020-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_buffer.c b/src/Common/libzip/zip_buffer.c index e2103f04..de22bab1 100644 --- a/src/Common/libzip/zip_buffer.c +++ b/src/Common/libzip/zip_buffer.c @@ -2,3 +2,3 @@ zip_buffer.c -- bounds checked access to memory buffer - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2024 Dieter Baron and Thomas Klausner @@ -308,4 +308,3 @@ _zip_buffer_put_8(zip_buffer_t *buffer, zip_uint8_t i) { -int -_zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset) { +int _zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset) { if (offset > buffer->size) { diff --git a/src/Common/libzip/zip_close.c b/src/Common/libzip/zip_close.c index ddc2c245..4313592c 100644 --- a/src/Common/libzip/zip_close.c +++ b/src/Common/libzip/zip_close.c @@ -2,3 +2,3 @@ zip_close.c -- close zip archive and update changes - Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -46,3 +46,3 @@ static int add_data(zip_t *, zip_source_t *, zip_dirent_t *, zip_uint32_t); static int copy_data(zip_t *, zip_uint64_t); -static int copy_source(zip_t *, zip_source_t *, zip_int64_t); +static int copy_source(zip_t *, zip_source_t *, zip_source_t *, zip_int64_t); static int torrentzip_compare_names(const void *a, const void *b); @@ -470,7 +470,3 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { if (de->changed & ZIP_DIRENT_LAST_MOD) { - zip_stat_t st_mtime; - zip_stat_init(&st_mtime); - st_mtime.valid = ZIP_STAT_MTIME; - st_mtime.mtime = de->last_mod; - if ((src_tmp = _zip_source_window_new(src_final, 0, -1, &st_mtime, 0, NULL, NULL, 0, true, &za->error)) == NULL) { + if ((src_tmp = _zip_source_window_new(src_final, 0, -1, NULL, 0, NULL, &de->last_mod, NULL, 0, true, &za->error)) == NULL) { zip_source_free(src_final); @@ -497,3 +493,3 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { - ret = copy_source(za, src_final, data_length); + ret = copy_source(za, src_final, src, data_length); @@ -531,6 +527,19 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { if ((de->changed & ZIP_DIRENT_LAST_MOD) == 0) { - if (st.valid & ZIP_STAT_MTIME) - de->last_mod = st.mtime; - else - time(&de->last_mod); + int ret2 = zip_source_get_dos_time(src, &de->last_mod); + if (ret2 < 0) { + zip_error_set_from_source(&za->error, src); + return -1; + } + if (ret2 == 0) { + time_t mtime; + if (st.valid & ZIP_STAT_MTIME) { + mtime = st.mtime; + } + else { + time(&mtime); + } + if (_zip_u2d_time(mtime, &de->last_mod, &za->error) < 0) { + return -1; + } + } } @@ -607,3 +616,3 @@ copy_data(zip_t *za, zip_uint64_t len) { static int -copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) { +copy_source(zip_t *za, zip_source_t *src, zip_source_t *src_for_length, zip_int64_t data_length) { DEFINE_BYTE_ARRAY(buf, BUFSIZE); @@ -630,3 +639,9 @@ copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) { if (n == BUFSIZE && za->progress && data_length > 0) { - current += n; + zip_int64_t t; + t = zip_source_tell(src_for_length); + if (t >= 0) { + current = t; + } else { + current += n; + } if (_zip_progress_update(za->progress, (double)current / (double)data_length) != 0) { @@ -744,2 +759,2 @@ static int torrentzip_compare_names(const void *a, const void *b) { return strcasecmp(aname, bname); -}
\ No newline at end of file +} diff --git a/src/Common/libzip/zip_crypto.h b/src/Common/libzip/zip_crypto.h index 0d74d1a4..805af52f 100644 --- a/src/Common/libzip/zip_crypto.h +++ b/src/Common/libzip/zip_crypto.h @@ -2,3 +2,3 @@ zip_crypto.h -- crypto definitions - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_commoncrypto.c b/src/Common/libzip/zip_crypto_commoncrypto.c index b198be56..e6cb72d3 100644 --- a/src/Common/libzip/zip_crypto_commoncrypto.c +++ b/src/Common/libzip/zip_crypto_commoncrypto.c @@ -2,3 +2,3 @@ zip_crypto_commoncrypto.c -- CommonCrypto wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_commoncrypto.h b/src/Common/libzip/zip_crypto_commoncrypto.h index 01828cc6..82dafdb4 100644 --- a/src/Common/libzip/zip_crypto_commoncrypto.h +++ b/src/Common/libzip/zip_crypto_commoncrypto.h @@ -2,3 +2,3 @@ zip_crypto_commoncrypto.h -- definitions for CommonCrypto wrapper. - Copyright (C) 2018 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_gnutls.c b/src/Common/libzip/zip_crypto_gnutls.c index 1a25aa12..fcc7fdfd 100644 --- a/src/Common/libzip/zip_crypto_gnutls.c +++ b/src/Common/libzip/zip_crypto_gnutls.c @@ -2,3 +2,3 @@ zip_crypto_gnutls.c -- GnuTLS wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_gnutls.h b/src/Common/libzip/zip_crypto_gnutls.h index dc8b97a4..a6fa508a 100644 --- a/src/Common/libzip/zip_crypto_gnutls.h +++ b/src/Common/libzip/zip_crypto_gnutls.h @@ -2,3 +2,3 @@ zip_crypto_gnutls.h -- definitions for GnuTLS wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_mbedtls.c b/src/Common/libzip/zip_crypto_mbedtls.c index 84544a82..0ed66c0d 100644 --- a/src/Common/libzip/zip_crypto_mbedtls.c +++ b/src/Common/libzip/zip_crypto_mbedtls.c @@ -2,3 +2,3 @@ zip_crypto_mbedtls.c -- mbed TLS wrapper - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_mbedtls.h b/src/Common/libzip/zip_crypto_mbedtls.h index 1151fff7..30ce21c9 100644 --- a/src/Common/libzip/zip_crypto_mbedtls.h +++ b/src/Common/libzip/zip_crypto_mbedtls.h @@ -2,3 +2,3 @@ zip_crypto_mbedtls.h -- definitions for mbedtls wrapper - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_openssl.c b/src/Common/libzip/zip_crypto_openssl.c index 7f1da10e..9e9e8e7c 100644 --- a/src/Common/libzip/zip_crypto_openssl.c +++ b/src/Common/libzip/zip_crypto_openssl.c @@ -2,3 +2,3 @@ zip_crypto_openssl.c -- OpenSSL wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner @@ -128,4 +128,5 @@ bool _zip_crypto_aes_encrypt_block(_zip_crypto_aes_t *aes, const zip_uint8_t *in, zip_uint8_t *out) { - int len; - if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1) { + int len = 0; + if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1 + || len != ZIP_CRYPTO_AES_BLOCK_LENGTH) { return false; @@ -216,7 +217,7 @@ _zip_crypto_hmac_output(_zip_crypto_hmac_t *hmac, zip_uint8_t *data) { #ifdef USE_OPENSSL_3_API - size_t length; + size_t length = 0; return EVP_MAC_final(hmac->ctx, data, &length, ZIP_CRYPTO_SHA1_LENGTH) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH; #else - unsigned int length; - return HMAC_Final(hmac, data, &length) == 1; + unsigned int length = 0; + return HMAC_Final(hmac, data, &length) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH; #endif diff --git a/src/Common/libzip/zip_crypto_openssl.h b/src/Common/libzip/zip_crypto_openssl.h index 198a9071..e593ec55 100644 --- a/src/Common/libzip/zip_crypto_openssl.h +++ b/src/Common/libzip/zip_crypto_openssl.h @@ -2,3 +2,3 @@ zip_crypto_openssl.h -- definitions for OpenSSL wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_crypto_win.c b/src/Common/libzip/zip_crypto_win.c index ee3ccc30..6d923038 100644 --- a/src/Common/libzip/zip_crypto_win.c +++ b/src/Common/libzip/zip_crypto_win.c @@ -2,3 +2,3 @@ zip_crypto_win.c -- Windows Crypto API wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2023 Dieter Baron and Thomas Klausner @@ -39,5 +39,2 @@ -#define WIN32_LEAN_AND_MEAN -#define NOCRYPT - #include <windows.h> diff --git a/src/Common/libzip/zip_crypto_win.h b/src/Common/libzip/zip_crypto_win.h index a533fe2d..3f05b621 100644 --- a/src/Common/libzip/zip_crypto_win.h +++ b/src/Common/libzip/zip_crypto_win.h @@ -2,3 +2,3 @@ zip_crypto_win.h -- Windows Crypto API wrapper. - Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_delete.c b/src/Common/libzip/zip_delete.c index 676c16bf..4eefdd97 100644 --- a/src/Common/libzip/zip_delete.c +++ b/src/Common/libzip/zip_delete.c @@ -2,3 +2,3 @@ zip_delete.c -- delete file from zip archive - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_dir_add.c b/src/Common/libzip/zip_dir_add.c index c0108191..01d8ec9d 100644 --- a/src/Common/libzip/zip_dir_add.c +++ b/src/Common/libzip/zip_dir_add.c @@ -2,3 +2,3 @@ zip_dir_add.c -- add directory - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_dirent.c b/src/Common/libzip/zip_dirent.c index 45a2a6a2..24bc6abf 100644 --- a/src/Common/libzip/zip_dirent.c +++ b/src/Common/libzip/zip_dirent.c @@ -2,3 +2,3 @@ zip_dirent.c -- read directory entry (local or central), clean dirent - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -43,3 +43,3 @@ -static zip_string_t *_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str); +static zip_string_t *_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str, bool check_consistency); static zip_extra_field_t *_zip_ef_utf8(zip_uint16_t, zip_string_t *, zip_error_t *); @@ -52,4 +52,5 @@ _zip_cdir_free(zip_cdir_t *cd) { - if (!cd) + if (cd == NULL) { return; + } @@ -64,3 +65,3 @@ _zip_cdir_free(zip_cdir_t *cd) { zip_cdir_t * -_zip_cdir_new(zip_uint64_t nentry, zip_error_t *error) { +_zip_cdir_new(zip_error_t *error) { zip_cdir_t *cd; @@ -78,7 +79,2 @@ _zip_cdir_new(zip_uint64_t nentry, zip_error_t *error) { - if (!_zip_cdir_grow(cd, nentry, error)) { - _zip_cdir_free(cd); - return NULL; - } - return cd; @@ -128,4 +124,2 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor zip_uint64_t i; - bool is_zip64; - int ret; zip_uint32_t cdir_crc; @@ -138,4 +132,2 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor - is_zip64 = false; - if (ZIP_WANT_TORRENTZIP(za)) { @@ -148,6 +140,6 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor - if ((ret = _zip_dirent_write(za, entry->changes ? entry->changes : entry->orig, ZIP_FL_CENTRAL)) < 0) + if (_zip_dirent_write(za, entry->changes ? entry->changes : entry->orig, ZIP_FL_CENTRAL) < 0) { + za->write_crc = NULL; return -1; - if (ret) - is_zip64 = true; + } } @@ -162,6 +154,2 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor - if (offset > ZIP_UINT32_MAX || survivors > ZIP_UINT16_MAX) { - is_zip64 = true; - } - if ((buffer = _zip_buffer_new(buf, sizeof(buf))) == NULL) { @@ -171,3 +159,3 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor - if (is_zip64) { + if (survivors > ZIP_UINT16_MAX || offset > ZIP_UINT32_MAX || size > ZIP_UINT32_MAX) { _zip_buffer_put(buffer, EOCD64_MAGIC, 4); @@ -296,2 +284,3 @@ _zip_dirent_init(zip_dirent_t *de) { de->crc_valid = true; + de->last_mod_mtime_valid = false; de->version_madeby = 63 | (ZIP_OPSYS_DEFAULT << 8); @@ -300,3 +289,4 @@ _zip_dirent_init(zip_dirent_t *de) { de->comp_method = ZIP_CM_DEFAULT; - de->last_mod = 0; + de->last_mod.date = 0; + de->last_mod.time = 0; de->crc = 0; @@ -338,3 +328,3 @@ _zip_dirent_new(void) { -/* _zip_dirent_read(zde, fp, bufp, left, localp, error): +/* Fills the zip directory entry zde. @@ -349,7 +339,8 @@ _zip_dirent_new(void) { zip_int64_t -_zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error) { +_zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_uint64_t central_compressed_size, bool check_consistency, zip_error_t *error) { zip_uint8_t buf[CDENTRYSIZE]; - zip_uint16_t dostime, dosdate; zip_uint32_t size, variable_size; zip_uint16_t filename_len, comment_len, ef_len; + zip_string_t *utf8_string; + bool is_zip64 = false; @@ -391,5 +382,4 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo /* convert to time_t */ - dostime = _zip_buffer_get_16(buffer); - dosdate = _zip_buffer_get_16(buffer); - zde->last_mod = _zip_d2u_time(dostime, dosdate); + zde->last_mod.time = _zip_buffer_get_16(buffer); + zde->last_mod.date = _zip_buffer_get_16(buffer); @@ -460,3 +450,3 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo zde->filename = _zip_read_string(buffer, src, filename_len, 1, error); - if (!zde->filename) { + if (zde->filename == NULL) { if (zip_error_code_zip(error) == ZIP_ER_EOF) { @@ -504,3 +494,3 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo zde->comment = _zip_read_string(buffer, src, comment_len, 0, error); - if (!zde->comment) { + if (zde->comment == NULL) { if (!from_buffer) { @@ -521,4 +511,20 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo - zde->filename = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_NAME, zde->filename); - zde->comment = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_COMMENT, zde->comment); + if ((utf8_string = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_NAME, zde->filename, check_consistency)) == NULL && zde->filename != NULL) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_UTF8_FILENAME_MISMATCH); + if (!from_buffer) { + _zip_buffer_free(buffer); + } + return -1; + } + zde->filename = utf8_string; + if (!local) { + if ((utf8_string = _zip_dirent_process_ef_utf_8(zde, ZIP_EF_UTF_8_COMMENT, zde->comment, check_consistency)) == NULL && zde->comment != NULL) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_UTF8_COMMENT_MISMATCH); + if (!from_buffer) { + _zip_buffer_free(buffer); + } + return -1; + } + zde->comment = utf8_string; + } @@ -537,2 +543,3 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo } + is_zip64 = true; } @@ -547,2 +554,3 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo } + if (!from_buffer) { @@ -551,2 +559,31 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo + if (local && zde->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) { + zip_uint32_t df_crc; + zip_uint64_t df_comp_size, df_uncomp_size; + if (zip_source_seek(src, central_compressed_size, SEEK_CUR) != 0 || (buffer = _zip_buffer_new_from_source(src, MAX_DATA_DESCRIPTOR_LENGTH, buf, error)) == NULL) { + return -1; + } + if (memcmp(_zip_buffer_peek(buffer, MAGIC_LEN), DATADES_MAGIC, MAGIC_LEN) == 0) { + _zip_buffer_skip(buffer, MAGIC_LEN); + } + df_crc = _zip_buffer_get_32(buffer); + df_comp_size = is_zip64 ? _zip_buffer_get_64(buffer) : _zip_buffer_get_32(buffer); + df_uncomp_size = is_zip64 ? _zip_buffer_get_64(buffer) : _zip_buffer_get_32(buffer); + + if (!_zip_buffer_ok(buffer)) { + zip_error_set(error, ZIP_ER_INTERNAL, 0); + _zip_buffer_free(buffer); + return -1; + } + _zip_buffer_free(buffer); + + if ((zde->crc != 0 && zde->crc != df_crc) || (zde->comp_size != 0 && zde->comp_size != df_comp_size) || (zde->uncomp_size != 0 && zde->uncomp_size != df_uncomp_size)) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_DATA_DESCRIPTOR_MISMATCH); + return -1; + } + zde->crc = df_crc; + zde->comp_size = df_comp_size; + zde->uncomp_size = df_uncomp_size; + } + /* zip_source_seek / zip_source_tell don't support values > ZIP_INT64_MAX */ @@ -566,3 +603,4 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo -bool zip_dirent_process_ef_zip64(zip_dirent_t* zde, const zip_uint8_t* ef, zip_uint64_t got_len, bool local, zip_error_t* error) { +bool +zip_dirent_process_ef_zip64(zip_dirent_t *zde, const zip_uint8_t *ef, zip_uint64_t got_len, bool local, zip_error_t *error) { zip_buffer_t *ef_buffer; @@ -627,3 +665,3 @@ bool zip_dirent_process_ef_zip64(zip_dirent_t* zde, const zip_uint8_t* ef, zip_u static zip_string_t * -_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str) { +_zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str, bool check_consistency) { zip_uint16_t ef_len; @@ -650,2 +688,10 @@ _zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string if (ef_str != NULL) { + if (check_consistency) { + if (!_zip_string_equal(str, ef_str) && _zip_string_is_ascii(ef_str)) { + _zip_string_free(ef_str); + _zip_buffer_free(buffer); + return NULL; + } + } + _zip_string_free(str); @@ -690,14 +736,14 @@ _zip_dirent_process_winzip_aes(zip_dirent_t *de, zip_error_t *error) { switch (_zip_buffer_get_16(buffer)) { - case 1: - break; + case 1: + break; - case 2: - crc_valid = false; - /* TODO: When checking consistency, check that crc is 0. */ - break; - - default: - zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0); - _zip_buffer_free(buffer); - return false; + case 2: + crc_valid = false; + /* TODO: When checking consistency, check that crc is 0. */ + break; + + default: + zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0); + _zip_buffer_free(buffer); + return false; } @@ -789,3 +835,3 @@ int _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) { - zip_uint16_t dostime, dosdate; + zip_dostime_t dostime; zip_encoding_type_t com_enc, name_enc; @@ -928,10 +974,10 @@ _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) { if (ZIP_WANT_TORRENTZIP(za)) { - dostime = 0xbc00; - dosdate = 0x2198; + dostime.time = 0xbc00; + dostime.date = 0x2198; } else { - _zip_u2d_time(de->last_mod, &dostime, &dosdate); + dostime = de->last_mod; } - _zip_buffer_put_16(buffer, dostime); - _zip_buffer_put_16(buffer, dosdate); + _zip_buffer_put_16(buffer, dostime.time); + _zip_buffer_put_16(buffer, dostime.date); @@ -1036,3 +1082,3 @@ _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) { time_t -_zip_d2u_time(zip_uint16_t dtime, zip_uint16_t ddate) { +_zip_d2u_time(const zip_dostime_t *dtime) { struct tm tm; @@ -1044,9 +1090,9 @@ _zip_d2u_time(zip_uint16_t dtime, zip_uint16_t ddate) { - tm.tm_year = ((ddate >> 9) & 127) + 1980 - 1900; - tm.tm_mon = ((ddate >> 5) & 15) - 1; - tm.tm_mday = ddate & 31; + tm.tm_year = ((dtime->date >> 9) & 127) + 1980 - 1900; + tm.tm_mon = ((dtime->date >> 5) & 15) - 1; + tm.tm_mday = dtime->date & 31; - tm.tm_hour = (dtime >> 11) & 31; - tm.tm_min = (dtime >> 5) & 63; - tm.tm_sec = (dtime << 1) & 62; + tm.tm_hour = (dtime->time >> 11) & 31; + tm.tm_min = (dtime->time >> 5) & 63; + tm.tm_sec = (dtime->time << 1) & 62; @@ -1121,4 +1167,4 @@ _zip_get_dirent(zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_t *err -void -_zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) { +int +_zip_u2d_time(time_t intime, zip_dostime_t *dtime, zip_error_t *ze) { struct tm *tpm; @@ -1128,5 +1174,8 @@ _zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) { /* if localtime fails, return an arbitrary date (1980-01-01 00:00:00) */ - *ddate = (1 << 5) + 1; - *dtime = 0; - return; + dtime->date = (1 << 5) + 1; + dtime->time = 0; + if (ze) { + zip_error_set(ze, ZIP_ER_INVAL, errno); + } + return -1; } @@ -1136,4 +1185,6 @@ _zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) { - *ddate = (zip_uint16_t)(((tpm->tm_year + 1900 - 1980) << 9) + ((tpm->tm_mon + 1) << 5) + tpm->tm_mday); - *dtime = (zip_uint16_t)(((tpm->tm_hour) << 11) + ((tpm->tm_min) << 5) + ((tpm->tm_sec) >> 1)); + dtime->date = (zip_uint16_t)(((tpm->tm_year + 1900 - 1980) << 9) + ((tpm->tm_mon + 1) << 5) + tpm->tm_mday); + dtime->time = (zip_uint16_t)(((tpm->tm_hour) << 11) + ((tpm->tm_min) << 5) + ((tpm->tm_sec) >> 1)); + + return 0; } @@ -1194,6 +1245,7 @@ _zip_dirent_apply_attributes(zip_dirent_t *de, zip_file_attributes_t *attributes -void zip_dirent_torrentzip_normalize(zip_dirent_t *de) { +void +zip_dirent_torrentzip_normalize(zip_dirent_t *de) { de->version_madeby = 0; de->version_needed = 20; /* 2.0 */ - de->bitflags = 2; /* maximum compression */ + de->bitflags = 2; /* maximum compression */ de->comp_method = ZIP_CM_DEFLATE; @@ -1205,3 +1257,19 @@ void zip_dirent_torrentzip_normalize(zip_dirent_t *de) { /* last_mod, extra_fields, and comment are normalized in zip_dirent_write() directly */ +} +int +zip_dirent_check_consistency(zip_dirent_t *dirent) { + if (dirent->comp_method == ZIP_CM_STORE && dirent->comp_size != dirent->uncomp_size) { + return ZIP_ER_DETAIL_STORED_SIZE_MISMATCH; + } + return 0; } + +time_t zip_dirent_get_last_mod_mtime(zip_dirent_t *de) { + if (!de->last_mod_mtime_valid) { + de->last_mod_mtime = _zip_d2u_time(&de->last_mod); + de->last_mod_mtime_valid = true; + } + + return de->last_mod_mtime; +}
\ No newline at end of file diff --git a/src/Common/libzip/zip_discard.c b/src/Common/libzip/zip_discard.c index d1dc4f8b..841a80e2 100644 --- a/src/Common/libzip/zip_discard.c +++ b/src/Common/libzip/zip_discard.c @@ -2,3 +2,3 @@ zip_discard.c -- discard and free struct zip - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_entry.c b/src/Common/libzip/zip_entry.c index 35a36e4a..dd25e61f 100644 --- a/src/Common/libzip/zip_entry.c +++ b/src/Common/libzip/zip_entry.c @@ -2,3 +2,3 @@ zip_entry.c -- struct zip_entry helper functions - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_err_str.c b/src/Common/libzip/zip_err_str.c index 28af773b..fb4b69fa 100644 --- a/src/Common/libzip/zip_err_str.c +++ b/src/Common/libzip/zip_err_str.c @@ -51,2 +51,3 @@ const struct _zip_err_info _zip_err_str[] = { { N, "Not allowed in torrentzip" }, + { N, "Possibly truncated or corrupted zip archive" }, }; @@ -76,2 +77,7 @@ const struct _zip_err_info _zip_err_details[] = { { E, "file length in header doesn't match actual file length" }, + { E, "compressed and uncompressed sizes don't match for stored file" }, + { E, "local header and data descriptor do not match" }, + { G, "EOCD64 and EOCD64 locator do not match" }, + { E, "UTF-8 filename is ASCII and doesn't match filename" }, + { E, "UTF-8 comment is ASCII and doesn't match comment" }, }; diff --git a/src/Common/libzip/zip_error.c b/src/Common/libzip/zip_error.c index c498e086..da910d44 100644 --- a/src/Common/libzip/zip_error.c +++ b/src/Common/libzip/zip_error.c @@ -2,3 +2,3 @@ zip_error.c -- zip_error_t helper functions - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_error_clear.c b/src/Common/libzip/zip_error_clear.c index 94ff5062..04062719 100644 --- a/src/Common/libzip/zip_error_clear.c +++ b/src/Common/libzip/zip_error_clear.c @@ -2,3 +2,3 @@ zip_error_clear.c -- clear zip error - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_error_get.c b/src/Common/libzip/zip_error_get.c index c0418f0d..2a5b3eaf 100644 --- a/src/Common/libzip/zip_error_get.c +++ b/src/Common/libzip/zip_error_get.c @@ -2,3 +2,3 @@ zip_error_get.c -- get zip error - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_error_get_sys_type.c b/src/Common/libzip/zip_error_get_sys_type.c index a22ffb03..973d26c0 100644 --- a/src/Common/libzip/zip_error_get_sys_type.c +++ b/src/Common/libzip/zip_error_get_sys_type.c @@ -2,3 +2,3 @@ zip_error_get_sys_type.c -- return type of system error code - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_error_strerror.c b/src/Common/libzip/zip_error_strerror.c index fe04cbb4..5be54b38 100644 --- a/src/Common/libzip/zip_error_strerror.c +++ b/src/Common/libzip/zip_error_strerror.c @@ -2,3 +2,3 @@ zip_error_sterror.c -- get string representation of struct zip_error - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner @@ -51,2 +51,5 @@ zip_error_strerror(zip_error_t *err) { system_error_buffer = (char *)malloc(128); + if (system_error_buffer == NULL) { + return _zip_err_str[ZIP_ER_MEMORY].description; + } snprintf_s(system_error_buffer, 128, "Unknown error %d", err->zip_err); @@ -63,2 +66,5 @@ zip_error_strerror(zip_error_t *err) { system_error_buffer = malloc(len); + if (system_error_buffer == NULL) { + return _zip_err_str[ZIP_ER_MEMORY].description; + } strerror_s(system_error_buffer, len, err->sys_err); @@ -81,2 +87,5 @@ zip_error_strerror(zip_error_t *err) { system_error_buffer = (char *)malloc(128); + if (system_error_buffer == NULL) { + return _zip_err_str[ZIP_ER_MEMORY].description; + } snprintf_s(system_error_buffer, 128, "invalid detail error %u", error); @@ -87,2 +96,5 @@ zip_error_strerror(zip_error_t *err) { system_error_buffer = (char *)malloc(128); + if (system_error_buffer == NULL) { + return _zip_err_str[ZIP_ER_MEMORY].description; + } snprintf_s(system_error_buffer, 128, "entry %d: %s", index, _zip_err_details[error].description); diff --git a/src/Common/libzip/zip_error_to_str.c b/src/Common/libzip/zip_error_to_str.c index b60b7881..4186e3a4 100644 --- a/src/Common/libzip/zip_error_to_str.c +++ b/src/Common/libzip/zip_error_to_str.c @@ -2,3 +2,3 @@ zip_error_to_str.c -- get string representation of zip error code - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_extra_field.c b/src/Common/libzip/zip_extra_field.c index 7aed12ad..52837046 100644 --- a/src/Common/libzip/zip_extra_field.c +++ b/src/Common/libzip/zip_extra_field.c @@ -2,3 +2,3 @@ zip_extra_field.c -- manipulate extra fields - Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_extra_field_api.c b/src/Common/libzip/zip_extra_field_api.c index 560c71bb..6f2b4596 100644 --- a/src/Common/libzip/zip_extra_field_api.c +++ b/src/Common/libzip/zip_extra_field_api.c @@ -2,3 +2,3 @@ zip_extra_field_api.c -- public extra fields API functions - Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2024 Dieter Baron and Thomas Klausner @@ -58,6 +58,2 @@ zip_file_extra_field_delete(zip_t *za, zip_uint64_t idx, zip_uint16_t ef_idx, zi } - if (ZIP_WANT_TORRENTZIP(za)) { - zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); - return -1; - } diff --git a/src/Common/libzip/zip_fclose.c b/src/Common/libzip/zip_fclose.c index b820d98b..2ef579a0 100644 --- a/src/Common/libzip/zip_fclose.c +++ b/src/Common/libzip/zip_fclose.c @@ -2,3 +2,3 @@ zip_fclose.c -- close file in zip archive - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_fdopen.c b/src/Common/libzip/zip_fdopen.c index e72c55dc..94fe6c7c 100644 --- a/src/Common/libzip/zip_fdopen.c +++ b/src/Common/libzip/zip_fdopen.c @@ -2,3 +2,3 @@ zip_fdopen.c -- open read-only archive from file descriptor - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_add.c b/src/Common/libzip/zip_file_add.c index c2c41e15..5959d504 100644 --- a/src/Common/libzip/zip_file_add.c +++ b/src/Common/libzip/zip_file_add.c @@ -2,3 +2,3 @@ zip_file_add.c -- add file via callback function - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_error_clear.c b/src/Common/libzip/zip_file_error_clear.c index a10bff80..eb9a614e 100644 --- a/src/Common/libzip/zip_file_error_clear.c +++ b/src/Common/libzip/zip_file_error_clear.c @@ -2,3 +2,3 @@ zip_file_error_clear.c -- clear zip file error - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_error_get.c b/src/Common/libzip/zip_file_error_get.c index b93117bb..679aeefb 100644 --- a/src/Common/libzip/zip_file_error_get.c +++ b/src/Common/libzip/zip_file_error_get.c @@ -2,3 +2,3 @@ zip_file_error_get.c -- get zip file error - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_get_comment.c b/src/Common/libzip/zip_file_get_comment.c index fa998f02..ca04042a 100644 --- a/src/Common/libzip/zip_file_get_comment.c +++ b/src/Common/libzip/zip_file_get_comment.c @@ -2,3 +2,3 @@ zip_file_get_comment.c -- get file comment - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_get_external_attributes.c b/src/Common/libzip/zip_file_get_external_attributes.c index a79bb3ed..483557f0 100644 --- a/src/Common/libzip/zip_file_get_external_attributes.c +++ b/src/Common/libzip/zip_file_get_external_attributes.c @@ -2,3 +2,3 @@ zip_file_get_external_attributes.c -- get opsys/external attributes - Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2013-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_get_offset.c b/src/Common/libzip/zip_file_get_offset.c index 72f4880e..c50def54 100644 --- a/src/Common/libzip/zip_file_get_offset.c +++ b/src/Common/libzip/zip_file_get_offset.c @@ -2,3 +2,3 @@ zip_file_get_offset.c -- get offset of file data in archive. - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_rename.c b/src/Common/libzip/zip_file_rename.c index 9ac25814..03101e43 100644 --- a/src/Common/libzip/zip_file_rename.c +++ b/src/Common/libzip/zip_file_rename.c @@ -2,3 +2,3 @@ zip_file_rename.c -- rename file in zip archive - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_replace.c b/src/Common/libzip/zip_file_replace.c index 4262d453..ce457ed1 100644 --- a/src/Common/libzip/zip_file_replace.c +++ b/src/Common/libzip/zip_file_replace.c @@ -2,3 +2,3 @@ zip_file_replace.c -- replace file via callback function - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -85,2 +85,8 @@ _zip_file_replace(zip_t *za, zip_uint64_t idx, const char *name, zip_source_t *s + /* delete all extra fields - these are usually data that are + * strongly coupled with the original data */ + if (zip_file_extra_field_delete(za, idx, ZIP_EXTRA_FIELD_ALL, ZIP_FL_CENTRAL | ZIP_FL_LOCAL) < 0) { + return -1; + } + /* does not change any name related data, so we can do it here; diff --git a/src/Common/libzip/zip_file_set_comment.c b/src/Common/libzip/zip_file_set_comment.c index 570f8e82..fb7b9edd 100644 --- a/src/Common/libzip/zip_file_set_comment.c +++ b/src/Common/libzip/zip_file_set_comment.c @@ -2,3 +2,3 @@ zip_file_set_comment.c -- set comment for file in archive - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_set_encryption.c b/src/Common/libzip/zip_file_set_encryption.c index 1cdcd4ab..7bb6cdc7 100644 --- a/src/Common/libzip/zip_file_set_encryption.c +++ b/src/Common/libzip/zip_file_set_encryption.c @@ -2,3 +2,3 @@ zip_file_set_encryption.c -- set encryption for file in archive - Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_set_external_attributes.c b/src/Common/libzip/zip_file_set_external_attributes.c index 2e0429b8..2f9d30f9 100644 --- a/src/Common/libzip/zip_file_set_external_attributes.c +++ b/src/Common/libzip/zip_file_set_external_attributes.c @@ -2,3 +2,3 @@ zip_file_set_external_attributes.c -- set external attributes for entry - Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2013-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_file_set_mtime.c b/src/Common/libzip/zip_file_set_mtime.c index 4126f5a1..e60f7a9a 100644 --- a/src/Common/libzip/zip_file_set_mtime.c +++ b/src/Common/libzip/zip_file_set_mtime.c @@ -2,3 +2,3 @@ zip_file_set_mtime.c -- set modification time of entry. - Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2024 Dieter Baron and Thomas Klausner @@ -35,15 +35,8 @@ -ZIP_EXTERN int -zip_file_set_dostime(zip_t *za, zip_uint64_t idx, zip_uint16_t dtime, zip_uint16_t ddate, zip_flags_t flags) { - time_t mtime; - mtime = _zip_d2u_time(dtime, ddate); - return zip_file_set_mtime(za, idx, mtime, flags); -} - -ZIP_EXTERN int -zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) { +static int zip_file_set_time(zip_t *za, zip_uint64_t idx, zip_uint16_t dtime, zip_uint16_t ddate, zip_flags_t flags, time_t *mtime) { zip_entry_t *e; - if (_zip_get_dirent(za, idx, 0, NULL) == NULL) + if (_zip_get_dirent(za, idx, 0, NULL) == NULL) { return -1; + } @@ -72,3 +65,11 @@ zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) - e->changes->last_mod = mtime; + e->changes->last_mod.time = dtime; + e->changes->last_mod.date = ddate; + if (mtime != NULL) { + e->changes->last_mod_mtime = *mtime; + e->changes->last_mod_mtime_valid = true; + } + else { + e->changes->last_mod_mtime_valid = false; + } e->changes->changed |= ZIP_DIRENT_LAST_MOD; @@ -77 +78,16 @@ zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) } + +ZIP_EXTERN int zip_file_set_dostime(zip_t *za, zip_uint64_t idx, zip_uint16_t dtime, zip_uint16_t ddate, zip_flags_t flags) { + return zip_file_set_time(za, idx, dtime, ddate, flags, NULL); +} + + +ZIP_EXTERN int zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) { + zip_dostime_t dostime; + + if (_zip_u2d_time(mtime, &dostime, &za->error) < 0) { + return -1; + } + + return zip_file_set_time(za, idx, dostime.time, dostime.date, flags, &mtime); +} diff --git a/src/Common/libzip/zip_file_strerror.c b/src/Common/libzip/zip_file_strerror.c index 5b5a0092..5e896b4c 100644 --- a/src/Common/libzip/zip_file_strerror.c +++ b/src/Common/libzip/zip_file_strerror.c @@ -2,3 +2,3 @@ zip_file_sterror.c -- get string representation of zip file error - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_fopen.c b/src/Common/libzip/zip_fopen.c index e3cde9be..93217f3d 100644 --- a/src/Common/libzip/zip_fopen.c +++ b/src/Common/libzip/zip_fopen.c @@ -2,3 +2,3 @@ zip_fopen.c -- open file in zip archive for reading - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_fopen_encrypted.c b/src/Common/libzip/zip_fopen_encrypted.c index d5880dcb..78143afe 100644 --- a/src/Common/libzip/zip_fopen_encrypted.c +++ b/src/Common/libzip/zip_fopen_encrypted.c @@ -2,3 +2,3 @@ zip_fopen_encrypted.c -- open file for reading with password - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_fopen_index.c b/src/Common/libzip/zip_fopen_index.c index a449b83a..b6676b7d 100644 --- a/src/Common/libzip/zip_fopen_index.c +++ b/src/Common/libzip/zip_fopen_index.c @@ -2,3 +2,3 @@ zip_fopen_index.c -- open file in zip archive for reading by index - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_fopen_index_encrypted.c b/src/Common/libzip/zip_fopen_index_encrypted.c index 40483709..86d69774 100644 --- a/src/Common/libzip/zip_fopen_index_encrypted.c +++ b/src/Common/libzip/zip_fopen_index_encrypted.c @@ -2,3 +2,3 @@ zip_fopen_index_encrypted.c -- open file for reading by index w/ password - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_fread.c b/src/Common/libzip/zip_fread.c index 5b7da46a..17cec4fb 100644 --- a/src/Common/libzip/zip_fread.c +++ b/src/Common/libzip/zip_fread.c @@ -2,3 +2,3 @@ zip_fread.c -- read from file - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -41,7 +41,9 @@ zip_fread(zip_file_t *zf, void *outbuf, zip_uint64_t toread) { - if (!zf) + if (zf == NULL) { return -1; + } - if (zf->error.zip_err != 0) + if (zf->error.zip_err != 0) { return -1; + } diff --git a/src/Common/libzip/zip_fseek.c b/src/Common/libzip/zip_fseek.c index e68ffd36..107a6f73 100644 --- a/src/Common/libzip/zip_fseek.c +++ b/src/Common/libzip/zip_fseek.c @@ -2,3 +2,3 @@ zip_fseek.c -- seek in file - Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2024 Dieter Baron and Thomas Klausner @@ -38,7 +38,9 @@ ZIP_EXTERN zip_int8_t zip_fseek(zip_file_t *zf, zip_int64_t offset, int whence) { - if (!zf) + if (zf == NULL) { return -1; + } - if (zf->error.zip_err != 0) + if (zf->error.zip_err != 0) { return -1; + } @@ -55,3 +57,3 @@ ZIP_EXTERN int zip_file_is_seekable(zip_file_t *zfile) { - if (!zfile) { + if (zfile == NULL) { return -1; diff --git a/src/Common/libzip/zip_ftell.c b/src/Common/libzip/zip_ftell.c index bf3b03d3..6299b2da 100644 --- a/src/Common/libzip/zip_ftell.c +++ b/src/Common/libzip/zip_ftell.c @@ -2,3 +2,3 @@ zip_ftell.c -- tell position in file - Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2024 Dieter Baron and Thomas Klausner @@ -40,7 +40,9 @@ zip_ftell(zip_file_t *zf) { - if (!zf) + if (zf == NULL) { return -1; + } - if (zf->error.zip_err != 0) + if (zf->error.zip_err != 0) { return -1; + } diff --git a/src/Common/libzip/zip_get_archive_comment.c b/src/Common/libzip/zip_get_archive_comment.c index ea9a00ab..b83e6bcf 100644 --- a/src/Common/libzip/zip_get_archive_comment.c +++ b/src/Common/libzip/zip_get_archive_comment.c @@ -2,3 +2,3 @@ zip_get_archive_comment.c -- get archive comment - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_get_archive_flag.c b/src/Common/libzip/zip_get_archive_flag.c index fc200bdc..80d59914 100644 --- a/src/Common/libzip/zip_get_archive_flag.c +++ b/src/Common/libzip/zip_get_archive_flag.c @@ -2,3 +2,3 @@ zip_get_archive_flag.c -- get archive global flag - Copyright (C) 2008-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2008-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_get_encryption_implementation.c b/src/Common/libzip/zip_get_encryption_implementation.c index 72e48fe8..28ad3297 100644 --- a/src/Common/libzip/zip_get_encryption_implementation.c +++ b/src/Common/libzip/zip_get_encryption_implementation.c @@ -2,3 +2,3 @@ zip_get_encryption_implementation.c -- get encryption implementation - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_get_file_comment.c b/src/Common/libzip/zip_get_file_comment.c index d58e22ba..0284aecd 100644 --- a/src/Common/libzip/zip_get_file_comment.c +++ b/src/Common/libzip/zip_get_file_comment.c @@ -2,3 +2,3 @@ zip_get_file_comment.c -- get file comment - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_get_name.c b/src/Common/libzip/zip_get_name.c index 4828d781..d1c94532 100644 --- a/src/Common/libzip/zip_get_name.c +++ b/src/Common/libzip/zip_get_name.c @@ -2,3 +2,3 @@ zip_get_name.c -- get filename for a file in zip file - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_get_num_entries.c b/src/Common/libzip/zip_get_num_entries.c index 667dc511..b2595dec 100644 --- a/src/Common/libzip/zip_get_num_entries.c +++ b/src/Common/libzip/zip_get_num_entries.c @@ -2,3 +2,3 @@ zip_get_num_entries.c -- get number of entries in archive - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_get_num_files.c b/src/Common/libzip/zip_get_num_files.c index 140e34f9..16d7754b 100644 --- a/src/Common/libzip/zip_get_num_files.c +++ b/src/Common/libzip/zip_get_num_files.c @@ -2,3 +2,3 @@ zip_get_num_files.c -- get number of files in archive - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_hash.c b/src/Common/libzip/zip_hash.c index d3a954ec..8479bec1 100644 --- a/src/Common/libzip/zip_hash.c +++ b/src/Common/libzip/zip_hash.c @@ -2,3 +2,3 @@ zip_hash.c -- hash table string -> uint64 - Copyright (C) 2015-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2015-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_io_util.c b/src/Common/libzip/zip_io_util.c index 9fcd10b4..6ae8aac6 100644 --- a/src/Common/libzip/zip_io_util.c +++ b/src/Common/libzip/zip_io_util.c @@ -2,3 +2,3 @@ zip_io_util.c -- I/O helper functions - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -71,4 +71,10 @@ _zip_read_data(zip_buffer_t *buffer, zip_source_t *src, size_t length, bool nulp +// VS2022: Workaround an Internal compiler error for Release ARM (32-bit) build. +#if _MSC_VER >= 1940 && _MSC_VER < 1950 && defined(_M_ARM) && defined(NDEBUG) + size_t l = length + (nulp ? 1 : 0); + r = (zip_uint8_t *)malloc(l); +#else r = (zip_uint8_t *)malloc(length + (nulp ? 1 : 0)); - if (!r) { +#endif + if (r == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); diff --git a/src/Common/libzip/zip_libzip_version.c b/src/Common/libzip/zip_libzip_version.c index 4200727f..139b250f 100644 --- a/src/Common/libzip/zip_libzip_version.c +++ b/src/Common/libzip/zip_libzip_version.c @@ -2,3 +2,3 @@ zip_libzip_version.c -- return run-time version of library - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_memdup.c b/src/Common/libzip/zip_memdup.c index 75d72c61..6ac9a5a2 100644 --- a/src/Common/libzip/zip_memdup.c +++ b/src/Common/libzip/zip_memdup.c @@ -2,3 +2,3 @@ zip_memdup.c -- internal zip function, "strdup" with len - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -47,3 +47,3 @@ _zip_memdup(const void *mem, size_t len, zip_error_t *error) { ret = malloc(len); - if (!ret) { + if (ret == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); diff --git a/src/Common/libzip/zip_new.c b/src/Common/libzip/zip_new.c index 4f69c8a2..68e1588f 100644 --- a/src/Common/libzip/zip_new.c +++ b/src/Common/libzip/zip_new.c @@ -2,3 +2,3 @@ zip_new.c -- create and init struct zip - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -48,3 +48,3 @@ _zip_new(zip_error_t *error) { za = (zip_t *)malloc(sizeof(struct zip)); - if (!za) { + if (za == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); @@ -70,2 +70,3 @@ _zip_new(zip_error_t *error) { za->progress = NULL; + za->torrent_mtime = 0; diff --git a/src/Common/libzip/zip_open.c b/src/Common/libzip/zip_open.c index ee7e9dec..9dccad61 100644 --- a/src/Common/libzip/zip_open.c +++ b/src/Common/libzip/zip_open.c @@ -2,3 +2,3 @@ zip_open.c -- open zip archive by name - Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -33,3 +33,2 @@ - #include <limits.h> @@ -41,3 +40,16 @@ -typedef enum { EXISTS_ERROR = -1, EXISTS_NOT = 0, EXISTS_OK } exists_t; +typedef enum { + EXISTS_ERROR = -1, + EXISTS_NOT = 0, + EXISTS_OK +} exists_t; +typedef enum { + CDIR_OK, + CDIR_INVALID, + CDIR_NOT_FOUND + +} cdir_status_t; + +static bool check_eocd(zip_cdir_t *cd, unsigned int flags, zip_error_t *error); +static bool check_magic(zip_uint64_t offset, zip_buffer_t *buffer, zip_uint64_t buffer_offset, zip_source_t *src, const char* magic); static zip_t *_zip_allocate_new(zip_source_t *src, unsigned int flags, zip_error_t *error); @@ -48,6 +60,6 @@ static exists_t _zip_file_exists(zip_source_t *src, zip_error_t *error); static int _zip_headercomp(const zip_dirent_t *, const zip_dirent_t *); -static const unsigned char *_zip_memmem(const unsigned char *, size_t, const unsigned char *, size_t); -static zip_cdir_t *_zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_error_t *error); -static zip_cdir_t *_zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error); -static zip_cdir_t *_zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error); +static bool _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_cdir_t **cdirp, zip_error_t *error); +static zip_cdir_t *_zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_error_t *error); +static cdir_status_t _zip_read_eocd64(zip_cdir_t *cdir, zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error); +static const unsigned char *find_eocd(zip_buffer_t *buffer, const unsigned char *last); @@ -146,2 +158,23 @@ zip_open_from_source(zip_source_t *src, int _flags, zip_error_t *error) { +static bool +_is_truncated_zip(zip_source_t *src) { + unsigned char data[4]; + /* check if the source is a truncated zip archive: true if yes, no + if not or can't be determined */ + if (zip_source_seek(src, 0, SEEK_SET) < 0) { + return false; + } + + if (zip_source_read(src, data, 4) != 4) { + return false; + } + + if (memcmp(data, LOCAL_MAGIC, 4) == 0) { + /* file starts with a ZIP local header signature */ + return true; + } + return false; +} + + zip_t * @@ -176,2 +209,8 @@ _zip_open(zip_source_t *src, unsigned int flags, zip_error_t *error) { _zip_error_copy(error, &za->error); + if (zip_error_code_zip(error) == ZIP_ER_NOZIP) { + /* not a zip - find out if it's truncated */ + if (_is_truncated_zip(src)) { + zip_error_set(error, ZIP_ER_TRUNCATED_ZIP, 0); + } + } /* keep src so discard does not get rid of it */ @@ -230,10 +269,10 @@ _zip_set_open_error(int *zep, const zip_error_t *err, int ze) { ze = zip_error_code_zip(err); - switch (zip_error_system_type(err)) { - case ZIP_ET_SYS: - case ZIP_ET_LIBZIP: - errno = zip_error_code_system(err); - break; - - default: - break; + switch (zip_error_system_type(err)) { + case ZIP_ET_SYS: + case ZIP_ET_LIBZIP: + errno = zip_error_code_system(err); + break; + + default: + break; } @@ -252,4 +291,3 @@ _zip_set_open_error(int *zep, const zip_error_t *err, int ze) { -static zip_cdir_t * -_zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_error_t *error) { +static bool _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_cdir_t **cdirp, zip_error_t *error) { zip_cdir_t *cd; @@ -259,13 +297,8 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err zip_buffer_t *cd_buffer; + bool eocd64_found = false; - if (_zip_buffer_left(buffer) < EOCDLEN) { - /* not enough bytes left for comment */ - zip_error_set(error, ZIP_ER_NOZIP, 0); - return NULL; - } + *cdirp = NULL; - /* check for end-of-central-dir magic */ - if (memcmp(_zip_buffer_get(buffer, 4), EOCD_MAGIC, 4) != 0) { - zip_error_set(error, ZIP_ER_NOZIP, 0); - return NULL; + if ((cd = _zip_read_eocd(buffer, buf_offset, error)) == NULL) { + return false; } @@ -273,12 +306,48 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err if (eocd_offset >= EOCD64LOCLEN && memcmp(_zip_buffer_data(buffer) + eocd_offset - EOCD64LOCLEN, EOCD64LOC_MAGIC, 4) == 0) { + eocd64_found = true; _zip_buffer_set_offset(buffer, eocd_offset - EOCD64LOCLEN); - cd = _zip_read_eocd64(za->src, buffer, buf_offset, za->flags, error); + switch (_zip_read_eocd64(cd, za->src, buffer, buf_offset, za->flags, error)) { + case CDIR_OK: + break; + + case CDIR_INVALID: + _zip_cdir_free(cd); + return true; + + case CDIR_NOT_FOUND: + _zip_cdir_free(cd); + return false; + } } - else { - _zip_buffer_set_offset(buffer, eocd_offset); - cd = _zip_read_eocd(buffer, buf_offset, za->flags, error); + + if ((cd->eocd_disk != 0 || cd->this_disk != 0) && !eocd64_found && cd->eocd_disk != cd->this_disk) { + /* If the central directory doesn't start on this disk, we can't check that offset is valid. Check as much as we can instead. */ + if (cd->this_disk < cd->eocd_disk) { + /* Disks before the start of the central directory don't contain an EOCD. */ + _zip_cdir_free(cd); + return false; + } + if (cd->size <= cd->eocd_offset) { + /* The complete central directory would fit on this disk. */ + _zip_cdir_free(cd); + return false; + } } - if (cd == NULL) - return NULL; + if (!eocd64_found) { + if (cd->this_disk == 0 && cd->eocd_disk == 0 && cd->eocd_offset == 0 && cd->offset == 0 && cd->num_entries == 0) { + /* An empty archive doesn't contain central directory entries. */ + } + else if (!check_magic(cd->offset, buffer, buf_offset, za->src, CENTRAL_MAGIC)) { + _zip_cdir_free(cd); + return false; + } + } + + /* We accept this EOCD as valid and won't search for an earlier one if it is unusable. */ + + if (!check_eocd(cd, za->flags, error)) { + _zip_cdir_free(cd); + return true; + } @@ -291,3 +360,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -300,6 +369,11 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err - if (tail_len < comment_len || ((za->open_flags & ZIP_CHECKCONS) && tail_len != comment_len)) { - zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_COMMENT_LENGTH_INVALID); - _zip_cdir_free(cd); - return NULL; + if (tail_len != comment_len) { + if (za->open_flags & ZIP_CHECKCONS) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_COMMENT_LENGTH_INVALID); + _zip_cdir_free(cd); + return true; + } + if (tail_len < comment_len) { + comment_len = tail_len; + } } @@ -309,3 +383,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -322,3 +396,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -327,3 +401,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -336,3 +410,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -343,3 +417,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -347,2 +421,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err + if (!_zip_cdir_grow(cd, cd->num_entries, error)) { + _zip_cdir_free(cd); + _zip_buffer_free(cd_buffer); + return true; + } left = (zip_uint64_t)cd->size; @@ -364,3 +443,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_buffer_free(cd_buffer); - return NULL; + return true; } @@ -369,7 +448,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err - if ((cd->entry[i].orig = _zip_dirent_new()) == NULL || (entry_size = _zip_dirent_read(cd->entry[i].orig, za->src, cd_buffer, false, error)) < 0) { - if (zip_error_code_zip(error) == ZIP_ER_INCONS) { - zip_error_set(error, ZIP_ER_INCONS, ADD_INDEX_TO_DETAIL(zip_error_code_system(error), i)); - } - else if (grown && zip_error_code_zip(error) == ZIP_ER_NOZIP) { + if ((cd->entry[i].orig = _zip_dirent_new()) == NULL || (entry_size = _zip_dirent_read(cd->entry[i].orig, za->src, cd_buffer, false, 0, za->open_flags & ZIP_CHECKCONS, error)) < 0) { + if (zip_error_code_zip(error) == ZIP_ER_INCONS) { + zip_error_set(error, ZIP_ER_INCONS, ADD_INDEX_TO_DETAIL(zip_error_code_system(error), i)); + } + else if (grown && zip_error_code_zip(error) == ZIP_ER_NOZIP) { zip_error_set(error, ZIP_ER_INCONS, MAKE_DETAIL_WITH_INDEX(ZIP_ER_DETAIL_CDIR_ENTRY_INVALID, i)); @@ -378,3 +457,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_buffer_free(cd_buffer); - return NULL; + return true; } @@ -384,2 +463,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err + /* If we didn't fill all we grew, cd->num_entries was wrong. */ if (i != cd->nentry || left > 0) { @@ -388,3 +468,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -403,3 +483,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -412,3 +492,3 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_cdir_free(cd); - return NULL; + return true; } @@ -417,3 +497,23 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_buffer_free(cd_buffer); - return cd; + *cdirp = cd; + return true; +} + + +static bool check_magic(zip_uint64_t offset, zip_buffer_t *buffer, zip_uint64_t buffer_offset, zip_source_t *src, const char* magic) { + if (buffer_offset <= offset) { + zip_uint8_t* data; + if (_zip_buffer_set_offset(buffer, offset - buffer_offset) < 0 || (data = _zip_buffer_get(buffer, MAGIC_LEN)) == NULL) { + return false; + } + return memcmp(data, magic, MAGIC_LEN) == 0; + } + else { + zip_uint8_t data[MAGIC_LEN]; + + if (zip_source_seek(src, offset, SEEK_SET) < 0 || zip_source_read(src, data, MAGIC_LEN) != MAGIC_LEN) { + return false; + } + return memcmp(data, magic, MAGIC_LEN) == 0; + } } @@ -432,2 +532,3 @@ _zip_checkcons(zip_t *za, zip_cdir_t *cd, zip_error_t *error) { struct zip_dirent temp; + int detail; @@ -462,6 +563,6 @@ _zip_checkcons(zip_t *za, zip_cdir_t *cd, zip_error_t *error) { - if (_zip_dirent_read(&temp, za->src, NULL, true, error) == -1) { - if (zip_error_code_zip(error) == ZIP_ER_INCONS) { - zip_error_set(error, ZIP_ER_INCONS, ADD_INDEX_TO_DETAIL(zip_error_code_system(error), i)); - } + if (_zip_dirent_read(&temp, za->src, NULL, true, cd->entry[i].orig->comp_size, true, error) == -1) { + if (zip_error_code_zip(error) == ZIP_ER_INCONS) { + zip_error_set(error, ZIP_ER_INCONS, ADD_INDEX_TO_DETAIL(zip_error_code_system(error), i)); + } _zip_dirent_finalize(&temp); @@ -481,2 +582,7 @@ _zip_checkcons(zip_t *za, zip_cdir_t *cd, zip_error_t *error) { _zip_dirent_finalize(&temp); + + if ((detail = zip_dirent_check_consistency(cd->entry[i].orig)) != 0) { + zip_error_set(error, ZIP_ER_INCONS, MAKE_DETAIL_WITH_INDEX(detail, i)); + return -1; + } } @@ -499,3 +605,3 @@ _zip_headercomp(const zip_dirent_t *central, const zip_dirent_t *local) { #endif - || (central->comp_method != local->comp_method) || (central->last_mod != local->last_mod) || !_zip_string_equal(central->filename, local->filename)) + || (central->comp_method != local->comp_method) || (central->last_mod.time != local->last_mod.time) || (central->last_mod.date != local->last_mod.date) || !_zip_string_equal(central->filename, local->filename)) return -1; @@ -505,15 +611,13 @@ _zip_headercomp(const zip_dirent_t *central, const zip_dirent_t *local) { This is in violation of the appnote. - macOS Archive sets the compressed size even when data descriptor is used ( but not the others), - also in violation of the appnote. - */ - /* if data descriptor is not used, the values must match */ + macOS Archive sets the compressed size even when data descriptor is used ( but not the others), + also in violation of the appnote. + */ + /* if data descriptor is not used, the values must match */ if ((local->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) == 0) { return -1; - } - /* when using a data descriptor, the local header value must be zero or match */ - if ((local->crc != 0 && central->crc != local->crc) || - (local->comp_size != 0 && central->comp_size != local->comp_size) || - (local->uncomp_size != 0 && central->uncomp_size != local->uncomp_size)) { - return -1; - } + } + /* when using a data descriptor, the local header value must be zero or match */ + if ((local->crc != 0 && central->crc != local->crc) || (local->comp_size != 0 && central->comp_size != local->comp_size) || (local->uncomp_size != 0 && central->uncomp_size != local->uncomp_size)) { + return -1; + } } @@ -570,3 +674,3 @@ static zip_cdir_t * _zip_find_central_dir(zip_t *za, zip_uint64_t len) { - zip_cdir_t *cdir, *cdirnew; + zip_cdir_t *cdir; const zip_uint8_t *match; @@ -574,4 +678,2 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { zip_uint64_t buflen; - zip_int64_t a; - zip_int64_t best; zip_error_t error; @@ -602,3 +704,2 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { - best = -1; cdir = NULL; @@ -610,35 +711,12 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { - match = _zip_buffer_get(buffer, 0); - /* The size of buffer never greater than CDBUFSIZE. */ - while (_zip_buffer_left(buffer) >= EOCDLEN && (match = _zip_memmem(match, (size_t)_zip_buffer_left(buffer) - (EOCDLEN - 4), (const unsigned char *)EOCD_MAGIC, 4)) != NULL) { + match = NULL; + while ((match = find_eocd(buffer, match)) != NULL) { _zip_buffer_set_offset(buffer, (zip_uint64_t)(match - _zip_buffer_data(buffer))); - if ((cdirnew = _zip_read_cdir(za, buffer, (zip_uint64_t)buf_offset, &error)) != NULL) { - if (cdir) { - if (best <= 0) { - best = _zip_checkcons(za, cdir, &error); - } - - a = _zip_checkcons(za, cdirnew, &error); - if (best < a) { - _zip_cdir_free(cdir); - cdir = cdirnew; - best = a; - } - else { - _zip_cdir_free(cdirnew); - } + if (_zip_read_cdir(za, buffer, (zip_uint64_t)buf_offset, &cdir, &error)) { + if (cdir != NULL && (za->open_flags & ZIP_CHECKCONS) && _zip_checkcons(za, cdir, &error) < 0) { + _zip_cdir_free(cdir); + cdir = NULL; } - else { - cdir = cdirnew; - if (za->open_flags & ZIP_CHECKCONS) - best = _zip_checkcons(za, cdir, &error); - else { - best = 0; - } - } - cdirnew = NULL; + break; } - - match++; - _zip_buffer_set_offset(buffer, (zip_uint64_t)(match - _zip_buffer_data(buffer))); } @@ -647,8 +725,5 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { - if (best < 0) { + if (cdir == NULL) { _zip_error_copy(&za->error, &error); - _zip_cdir_free(cdir); - return NULL; } - return cdir; @@ -657,24 +732,26 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { -static const unsigned char *_zip_memmem(const unsigned char *big, size_t biglen, const unsigned char *little, size_t littlelen) { +static const unsigned char * +find_eocd(zip_buffer_t *buffer, const unsigned char *last) { + const unsigned char *data = _zip_buffer_data(buffer); const unsigned char *p; - if (littlelen == 0) { - return big; + if (last == NULL) { + last = data + _zip_buffer_size(buffer) - MAGIC_LEN; } - - if (biglen < littlelen) { + else if (last == _zip_buffer_data(buffer)) { return NULL; } + else { + last -= 1; + } - p = big; - while (true) { - p = (const unsigned char *)memchr(p, little[0], biglen - (littlelen - 1) - (size_t)(p - big)); - if (p == NULL) { - return NULL; - } - if (memcmp(p + 1, little + 1, littlelen - 1) == 0) { - return p; + for (p = last; p >= data; p -= 1) { + if (*p == EOCD_MAGIC[0]) { + if (memcmp(p, EOCD_MAGIC, MAGIC_LEN) == 0) { + return p; + } } - p += 1; } + + return NULL; } @@ -683,5 +760,4 @@ static const unsigned char *_zip_memmem(const unsigned char *big, size_t biglen, static zip_cdir_t * -_zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error) { +_zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_error_t *error) { zip_cdir_t *cd; - zip_uint64_t i, nentry, size, offset, eocd_offset; @@ -692,8 +768,3 @@ _zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags - eocd_offset = _zip_buffer_offset(buffer); - - _zip_buffer_get(buffer, 4); /* magic already verified */ - - if (_zip_buffer_get_32(buffer) != 0) { - zip_error_set(error, ZIP_ER_MULTIDISK, 0); + if ((cd = _zip_cdir_new(error)) == NULL) { return NULL; @@ -701,39 +772,36 @@ _zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags + cd->eocd_offset = buf_offset + _zip_buffer_offset(buffer); + /* This function is only called where EOCD magic was found, so no need to check that here. */ + _zip_buffer_skip(buffer, MAGIC_LEN); + cd->is_zip64 = false; + cd->this_disk = _zip_buffer_get_16(buffer); + cd->eocd_disk = _zip_buffer_get_16(buffer); + /* number of cdir-entries on this disk */ - i = _zip_buffer_get_16(buffer); + cd->disk_entries = _zip_buffer_get_16(buffer); /* number of cdir-entries */ - nentry = _zip_buffer_get_16(buffer); - - if (nentry != i) { - zip_error_set(error, ZIP_ER_NOZIP, 0); - return NULL; - } + cd->num_entries = _zip_buffer_get_16(buffer); + cd->size = _zip_buffer_get_32(buffer); + cd->offset = _zip_buffer_get_32(buffer); - size = _zip_buffer_get_32(buffer); - offset = _zip_buffer_get_32(buffer); + return cd; +} - if (offset + size < offset) { - zip_error_set(error, ZIP_ER_SEEK, EFBIG); - return NULL; +static bool +check_eocd(zip_cdir_t *cd, unsigned int flags, zip_error_t *error) { + if (cd->disk_entries != cd->num_entries || cd->this_disk != 0 || cd->eocd_disk != 0) { + zip_error_set(error, ZIP_ER_MULTIDISK, 0); + return false; } - if (offset + size > buf_offset + eocd_offset) { - /* cdir spans past EOCD record */ - zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD); - return NULL; + if (cd->offset + cd->size < cd->offset) { + zip_error_set(error, ZIP_ER_SEEK, EFBIG); + return false; } - - if ((flags & ZIP_CHECKCONS) && offset + size != buf_offset + eocd_offset) { + if ((flags & ZIP_CHECKCONS) && cd->offset + cd->size != cd->eocd_offset) { zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_LENGTH_INVALID); - return NULL; + return false; } - if ((cd = _zip_cdir_new(nentry, error)) == NULL) - return NULL; - - cd->is_zip64 = false; - cd->size = size; - cd->offset = offset; - - return cd; + return true; } @@ -741,5 +809,3 @@ _zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags -static zip_cdir_t * -_zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error) { - zip_cdir_t *cd; +cdir_status_t _zip_read_eocd64(zip_cdir_t *cdir, zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error) { zip_uint64_t offset; @@ -749,3 +815,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse bool free_buffer; - zip_uint32_t num_disks, num_disks64, eocd_disk, eocd_disk64; + zip_uint32_t num_disks, eocd_disk, this_disk; @@ -755,5 +821,14 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse - num_disks = _zip_buffer_get_16(buffer); - eocd_disk = _zip_buffer_get_16(buffer); + eocd_disk = _zip_buffer_get_32(buffer); eocd_offset = _zip_buffer_get_64(buffer); + num_disks = _zip_buffer_get_32(buffer); + + if (!check_magic(eocd_offset, buffer, buf_offset, src, EOCD64_MAGIC)) { + return CDIR_NOT_FOUND; + } + + if (num_disks != 1) { + zip_error_set(error, ZIP_ER_MULTIDISK, 0); + return CDIR_INVALID; + } @@ -762,3 +837,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse zip_error_set(error, ZIP_ER_SEEK, EFBIG); - return NULL; + return CDIR_INVALID; } @@ -768,3 +843,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_OVERLAPS_EOCD); - return NULL; + return CDIR_INVALID; } @@ -779,6 +854,6 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse zip_error_set_from_source(error, src); - return NULL; + return CDIR_INVALID; } if ((buffer = _zip_buffer_new_from_source(src, EOCD64LEN, eocd, error)) == NULL) { - return NULL; + return CDIR_INVALID; } @@ -792,3 +867,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } - return NULL; + return CDIR_INVALID; } @@ -804,3 +879,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } - return NULL; + return CDIR_INVALID; } @@ -809,16 +884,5 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse - num_disks64 = _zip_buffer_get_32(buffer); - eocd_disk64 = _zip_buffer_get_32(buffer); - - /* if eocd values are 0xffff, we have to use eocd64 values. - otherwise, if the values are not the same, it's inconsistent; - in any case, if the value is not 0, we don't support it */ - if (num_disks == 0xffff) { - num_disks = num_disks64; - } - if (eocd_disk == 0xffff) { - eocd_disk = eocd_disk64; - } - if ((flags & ZIP_CHECKCONS) && (eocd_disk != eocd_disk64 || num_disks != num_disks64)) { - zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_MISMATCH); + this_disk = _zip_buffer_get_32(buffer); + if (_zip_buffer_get_32(buffer) != eocd_disk) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_LOCATOR_MISMATCH); if (free_buffer) { @@ -826,14 +890,7 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } - return NULL; - } - if (num_disks != 0 || eocd_disk != 0) { - zip_error_set(error, ZIP_ER_MULTIDISK, 0); - if (free_buffer) { - _zip_buffer_free(buffer); - } - return NULL; + return CDIR_INVALID; } - nentry = _zip_buffer_get_64(buffer); i = _zip_buffer_get_64(buffer); + nentry = _zip_buffer_get_64(buffer); @@ -844,3 +901,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } - return NULL; + return CDIR_INVALID; } @@ -856,3 +913,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } - return NULL; + return CDIR_INVALID; } @@ -865,12 +922,3 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse zip_error_set(error, ZIP_ER_SEEK, EFBIG); - return NULL; - } - if (offset + size > buf_offset + eocd_offset) { - /* cdir spans past EOCD record */ - zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD); - return NULL; - } - if ((flags & ZIP_CHECKCONS) && offset + size != buf_offset + eocd_offset) { - zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD); - return NULL; + return CDIR_INVALID; } @@ -879,13 +927,19 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_INVALID); - return NULL; + return CDIR_INVALID; } - if ((cd = _zip_cdir_new(nentry, error)) == NULL) - return NULL; + if ((cdir->size != 0xffffffff && cdir->size != size) || (cdir->offset != 0xffffffff && cdir->offset != offset) || (cdir->num_entries != 0xffff && cdir->num_entries != nentry) || (cdir->disk_entries != 0xffff && cdir->disk_entries != i) || (cdir->this_disk != 0xffff && cdir->this_disk != this_disk) || (cdir->eocd_disk != 0xffff && cdir->eocd_disk != eocd_disk)) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_MISMATCH); + return CDIR_INVALID; + } - cd->is_zip64 = true; - cd->size = size; - cd->offset = offset; + cdir->is_zip64 = true; + cdir->size = size; + cdir->offset = offset; + cdir->disk_entries = i; + cdir->num_entries = nentry; + cdir->this_disk = this_disk; + cdir->eocd_disk = eocd_disk; - return cd; + return CDIR_OK; } @@ -893,3 +947,4 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse -static int decode_hex(char c) { +static int +decode_hex(char c) { if (c >= '0' && c <= '9') { @@ -908,5 +963,6 @@ static int decode_hex(char c) { -static void zip_check_torrentzip(zip_t *za, const zip_cdir_t *cdir) { +static void +zip_check_torrentzip(zip_t *za, const zip_cdir_t *cdir) { zip_uint32_t crc_should; - char buf[8+1]; + char buf[8 + 1]; size_t i; @@ -917,4 +973,3 @@ static void zip_check_torrentzip(zip_t *za, const zip_cdir_t *cdir) { - if (_zip_string_length(cdir->comment) != TORRENTZIP_SIGNATURE_LENGTH + TORRENTZIP_CRC_LENGTH - || strncmp((const char *)cdir->comment->raw, TORRENTZIP_SIGNATURE, TORRENTZIP_SIGNATURE_LENGTH) != 0) + if (_zip_string_length(cdir->comment) != TORRENTZIP_SIGNATURE_LENGTH + TORRENTZIP_CRC_LENGTH || strncmp((const char *)cdir->comment->raw, TORRENTZIP_SIGNATURE, TORRENTZIP_SIGNATURE_LENGTH) != 0) return; @@ -936,4 +991,4 @@ static void zip_check_torrentzip(zip_t *za, const zip_cdir_t *cdir) { zip_stat_t st; - zip_source_t* src_window; - zip_source_t* src_crc; + zip_source_t *src_window; + zip_source_t *src_crc; zip_uint8_t buffer[512]; @@ -945,3 +1000,3 @@ static void zip_check_torrentzip(zip_t *za, const zip_cdir_t *cdir) { st.crc = crc_should; - if ((src_window = _zip_source_window_new(za->src, cdir->offset, cdir->size, &st, 0, NULL, NULL, 0, false, NULL)) == NULL) { + if ((src_window = _zip_source_window_new(za->src, cdir->offset, cdir->size, &st, 0, NULL, NULL, NULL, 0, false, NULL)) == NULL) { return; diff --git a/src/Common/libzip/zip_pkware.c b/src/Common/libzip/zip_pkware.c index 6a8c9fcd..ef3a30bb 100644 --- a/src/Common/libzip/zip_pkware.c +++ b/src/Common/libzip/zip_pkware.c @@ -2,3 +2,3 @@ zip_pkware.c -- Traditional PKWARE de/encryption backend routines - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_progress.c b/src/Common/libzip/zip_progress.c index e080514b..5693d7a5 100644 --- a/src/Common/libzip/zip_progress.c +++ b/src/Common/libzip/zip_progress.c @@ -2,3 +2,3 @@ zip_progress.c -- progress reporting - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2024 Dieter Baron and Thomas Klausner @@ -193,3 +193,3 @@ _zip_progress_update(zip_progress_t *progress, double sub_current) { - if (current - progress->last_update > progress->precision) { + if (current - progress->last_update > progress->precision || (progress->last_update < 1 && current == 1)) { progress->callback_progress(progress->za, current, progress->ud_progress); diff --git a/src/Common/libzip/zip_random_unix.c b/src/Common/libzip/zip_random_unix.c index 867df790..9446ca92 100644 --- a/src/Common/libzip/zip_random_unix.c +++ b/src/Common/libzip/zip_random_unix.c @@ -2,3 +2,3 @@ zip_random_unix.c -- fill the user's buffer with random stuff (Unix version) - Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_random_uwp.c b/src/Common/libzip/zip_random_uwp.c index 0883ce45..7accdeb2 100644 --- a/src/Common/libzip/zip_random_uwp.c +++ b/src/Common/libzip/zip_random_uwp.c @@ -2,3 +2,3 @@ zip_random_uwp.c -- fill the user's buffer with random stuff (UWP version) - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_random_win32.c b/src/Common/libzip/zip_random_win32.c index 789b9c20..209ca4b8 100644 --- a/src/Common/libzip/zip_random_win32.c +++ b/src/Common/libzip/zip_random_win32.c @@ -2,3 +2,3 @@ zip_random_win32.c -- fill the user's buffer with random stuff (Windows version) - Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_rename.c b/src/Common/libzip/zip_rename.c index c89b06c9..b356de45 100644 --- a/src/Common/libzip/zip_rename.c +++ b/src/Common/libzip/zip_rename.c @@ -2,3 +2,3 @@ zip_rename.c -- rename file in zip archive - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_replace.c b/src/Common/libzip/zip_replace.c index 96c083c3..549306a0 100644 --- a/src/Common/libzip/zip_replace.c +++ b/src/Common/libzip/zip_replace.c @@ -2,3 +2,3 @@ zip_replace.c -- replace file via callback function - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_set_archive_comment.c b/src/Common/libzip/zip_set_archive_comment.c index 7d06688e..2c75bda6 100644 --- a/src/Common/libzip/zip_set_archive_comment.c +++ b/src/Common/libzip/zip_set_archive_comment.c @@ -2,3 +2,3 @@ zip_set_archive_comment.c -- set archive comment - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_set_archive_flag.c b/src/Common/libzip/zip_set_archive_flag.c index 834ef5ba..7533ac50 100644 --- a/src/Common/libzip/zip_set_archive_flag.c +++ b/src/Common/libzip/zip_set_archive_flag.c @@ -2,3 +2,3 @@ zip_get_archive_flag.c -- set archive global flag - Copyright (C) 2008-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2008-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_set_default_password.c b/src/Common/libzip/zip_set_default_password.c index 4bab513f..07b3a06e 100644 --- a/src/Common/libzip/zip_set_default_password.c +++ b/src/Common/libzip/zip_set_default_password.c @@ -2,3 +2,3 @@ zip_set_default_password.c -- set default password for decryption - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_set_file_comment.c b/src/Common/libzip/zip_set_file_comment.c index 5d2b0b8a..b587ae95 100644 --- a/src/Common/libzip/zip_set_file_comment.c +++ b/src/Common/libzip/zip_set_file_comment.c @@ -2,3 +2,3 @@ zip_set_file_comment.c -- set comment for file in archive - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_set_file_compression.c b/src/Common/libzip/zip_set_file_compression.c index a193bb77..cee099d5 100644 --- a/src/Common/libzip/zip_set_file_compression.c +++ b/src/Common/libzip/zip_set_file_compression.c @@ -2,3 +2,3 @@ zip_set_file_compression.c -- set compression for file in archive - Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_set_name.c b/src/Common/libzip/zip_set_name.c index f1bf703e..0087af1a 100644 --- a/src/Common/libzip/zip_set_name.c +++ b/src/Common/libzip/zip_set_name.c @@ -2,3 +2,3 @@ zip_set_name.c -- rename helper function - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_accept_empty.c b/src/Common/libzip/zip_source_accept_empty.c index e772aeea..be319434 100644 --- a/src/Common/libzip/zip_source_accept_empty.c +++ b/src/Common/libzip/zip_source_accept_empty.c @@ -2,3 +2,3 @@ zip_source_accept_empty.c -- if empty source is a valid archive - Copyright (C) 2019-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2019-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_begin_write.c b/src/Common/libzip/zip_source_begin_write.c index 4a9d5d5d..2724335d 100644 --- a/src/Common/libzip/zip_source_begin_write.c +++ b/src/Common/libzip/zip_source_begin_write.c @@ -2,3 +2,3 @@ zip_source_begin_write.c -- start a new file for writing - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_begin_write_cloning.c b/src/Common/libzip/zip_source_begin_write_cloning.c index df195fcd..67d3475b 100644 --- a/src/Common/libzip/zip_source_begin_write_cloning.c +++ b/src/Common/libzip/zip_source_begin_write_cloning.c @@ -2,3 +2,3 @@ zip_source_begin_write_cloning.c -- clone part of file for writing - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_buffer.c b/src/Common/libzip/zip_source_buffer.c index 44159536..bdd522d6 100644 --- a/src/Common/libzip/zip_source_buffer.c +++ b/src/Common/libzip/zip_source_buffer.c @@ -2,3 +2,3 @@ zip_source_buffer.c -- create zip data source from buffer - Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_call.c b/src/Common/libzip/zip_source_call.c index 8c98fc2e..bc13c3b0 100644 --- a/src/Common/libzip/zip_source_call.c +++ b/src/Common/libzip/zip_source_call.c @@ -2,3 +2,3 @@ zip_source_call.c -- invoke callback command on zip_source - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_close.c b/src/Common/libzip/zip_source_close.c index f4f3ff2b..f1ae6f3e 100644 --- a/src/Common/libzip/zip_source_close.c +++ b/src/Common/libzip/zip_source_close.c @@ -2,3 +2,3 @@ zip_source_close.c -- close zip_source (stop reading) - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_commit_write.c b/src/Common/libzip/zip_source_commit_write.c index d7f567b8..ca7563ce 100644 --- a/src/Common/libzip/zip_source_commit_write.c +++ b/src/Common/libzip/zip_source_commit_write.c @@ -2,3 +2,3 @@ zip_source_commit_write.c -- commit changes to file - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_compress.c b/src/Common/libzip/zip_source_compress.c index 3cf709ff..54387eca 100644 --- a/src/Common/libzip/zip_source_compress.c +++ b/src/Common/libzip/zip_source_compress.c @@ -2,3 +2,3 @@ zip_source_compress.c -- (de)compression routines - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_crc.c b/src/Common/libzip/zip_source_crc.c index 435a084b..931a729c 100644 --- a/src/Common/libzip/zip_source_crc.c +++ b/src/Common/libzip/zip_source_crc.c @@ -2,3 +2,3 @@ zip_source_crc.c -- pass-through source that calculates CRC32 and size - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_error.c b/src/Common/libzip/zip_source_error.c index dc7fa20c..774eec0a 100644 --- a/src/Common/libzip/zip_source_error.c +++ b/src/Common/libzip/zip_source_error.c @@ -2,3 +2,3 @@ zip_source_error.c -- get last error from zip_source - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_file.h b/src/Common/libzip/zip_source_file.h index cca9fd2b..de07aecc 100644 --- a/src/Common/libzip/zip_source_file.h +++ b/src/Common/libzip/zip_source_file.h @@ -1,4 +1,7 @@ +#ifndef _HAD_ZIP_SOURCE_FILE_H +#define _HAD_ZIP_SOURCE_FILE_H + /* zip_source_file.h -- header for common file operations - Copyright (C) 2020-2022 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2024 Dieter Baron and Thomas Klausner @@ -90 +93,3 @@ struct zip_source_file_operations { zip_source_t *zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zip_int64_t len, const zip_stat_t *st, zip_source_file_operations_t *ops, void *ops_userdata, zip_error_t *error); + +#endif /* _HAD_ZIP_SOURCE_FILE_H */ diff --git a/src/Common/libzip/zip_source_file_common.c b/src/Common/libzip/zip_source_file_common.c index 6c58320f..99f893eb 100644 --- a/src/Common/libzip/zip_source_file_common.c +++ b/src/Common/libzip/zip_source_file_common.c @@ -2,3 +2,3 @@ zip_source_file_common.c -- create data source from file - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_file_stdio.c b/src/Common/libzip/zip_source_file_stdio.c index 6dcc5639..fd16f392 100644 --- a/src/Common/libzip/zip_source_file_stdio.c +++ b/src/Common/libzip/zip_source_file_stdio.c @@ -2,3 +2,3 @@ zip_source_file_stdio.c -- read-only stdio file source implementation - Copyright (C) 2020 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2023 Dieter Baron and Thomas Klausner @@ -122,3 +122,3 @@ _zip_stdio_op_seek(zip_source_file_context_t *ctx, void *f, zip_int64_t offset, - if (fseeko((FILE *)f, (off_t)offset, whence) < 0) { + if (zip_os_fseek((FILE *)f, (zip_off_t)offset, whence) < 0) { zip_error_set(&ctx->error, ZIP_ER_SEEK, errno); @@ -132,3 +132,3 @@ bool _zip_stdio_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st) { - struct stat sb; + zip_os_stat_t sb; @@ -137,6 +137,6 @@ _zip_stdio_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st) { if (ctx->fname) { - ret = stat(ctx->fname, &sb); + ret = zip_os_stat(ctx->fname, &sb); } else { - ret = fstat(fileno((FILE *)ctx->f), &sb); + ret = zip_os_fstat(fileno((FILE *)ctx->f), &sb); } @@ -170,3 +170,3 @@ zip_int64_t _zip_stdio_op_tell(zip_source_file_context_t *ctx, void *f) { - off_t offset = ftello((FILE *)f); + zip_off_t offset = zip_os_ftell((FILE *)f); diff --git a/src/Common/libzip/zip_source_file_stdio.h b/src/Common/libzip/zip_source_file_stdio.h index 802e6071..417a28c0 100644 --- a/src/Common/libzip/zip_source_file_stdio.h +++ b/src/Common/libzip/zip_source_file_stdio.h @@ -5,3 +5,3 @@ zip_source_file_stdio.h -- common header for stdio file implementation - Copyright (C) 2020 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_file_stdio_named.c b/src/Common/libzip/zip_source_file_stdio_named.c index 1495d7dd..1a5ca226 100644 --- a/src/Common/libzip/zip_source_file_stdio_named.c +++ b/src/Common/libzip/zip_source_file_stdio_named.c @@ -2,3 +2,3 @@ zip_source_file_stdio_named.c -- source for stdio file opened by name - Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner @@ -180,5 +180,5 @@ _zip_stdio_op_create_temp_output_cloning(zip_source_file_context_t *ctx, zip_uin struct file_clone_range range; - struct stat st; + zip_os_stat_t st; - if (fstat(fileno(ctx->f), &st) < 0) { + if (zip_os_fstat(fileno(ctx->f), &st) < 0) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); @@ -225,3 +225,3 @@ _zip_stdio_op_create_temp_output_cloning(zip_source_file_context_t *ctx, zip_uin } - if (fseeko(tfp, (off_t)offset, SEEK_SET) < 0) { + if (zip_os_fseek(tfp, (zip_off_t)offset, SEEK_SET) < 0) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); @@ -292,3 +292,3 @@ static int create_temp_file(zip_source_file_context_t *ctx, bool create_file) { int mode; - struct stat st; + zip_os_stat_t st; int fd = 0; @@ -296,3 +296,3 @@ static int create_temp_file(zip_source_file_context_t *ctx, bool create_file) { - if (stat(ctx->fname, &st) == 0) { + if (zip_os_stat(ctx->fname, &st) == 0) { mode = st.st_mode; @@ -346,3 +346,3 @@ static int create_temp_file(zip_source_file_context_t *ctx, bool create_file) { else { - if (stat(temp, &st) < 0) { + if (zip_os_stat(temp, &st) < 0) { if (errno == ENOENT) { diff --git a/src/Common/libzip/zip_source_file_win32.c b/src/Common/libzip/zip_source_file_win32.c index 624860b1..aa669766 100644 --- a/src/Common/libzip/zip_source_file_win32.c +++ b/src/Common/libzip/zip_source_file_win32.c @@ -2,3 +2,3 @@ zip_source_file_win32.c -- read-only Windows file source implementation - Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_file_win32.h b/src/Common/libzip/zip_source_file_win32.h index d86069ec..da691f0a 100644 --- a/src/Common/libzip/zip_source_file_win32.h +++ b/src/Common/libzip/zip_source_file_win32.h @@ -5,3 +5,3 @@ zip_source_file_win32.h -- common header for Windows file implementation - Copyright (C) 2020 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2024 Dieter Baron and Thomas Klausner @@ -61,2 +61,3 @@ struct zip_win32_file_operations { char *(*string_duplicate)(const char *string); + HANDLE(__stdcall *find_first_file)(const void *name, void *data); }; @@ -75,10 +76,2 @@ int _zip_win32_error_to_errno(DWORD win32err); -#ifdef __clang__ -#define DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wincompatible-function-pointer-types\"") -#define DONT_WARN_INCOMPATIBLE_FN_PTR_END _Pragma("GCC diagnostic pop") -#else -#define DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN -#define DONT_WARN_INCOMPATIBLE_FN_PTR_END -#endif - #endif /* _HAD_ZIP_SOURCE_FILE_WIN32_H */ diff --git a/src/Common/libzip/zip_source_file_win32_ansi.c b/src/Common/libzip/zip_source_file_win32_ansi.c index 58034cc2..f10f8ae3 100644 --- a/src/Common/libzip/zip_source_file_win32_ansi.c +++ b/src/Common/libzip/zip_source_file_win32_ansi.c @@ -2,3 +2,3 @@ zip_source_file_win32_ansi.c -- source for Windows file opened by ANSI name - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -36,20 +36,24 @@ static char *ansi_allocate_tempname(const char *name, size_t extra_chars, size_t *lengthp); +static HANDLE __stdcall ansi_create_file(const void *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file); +static BOOL __stdcall ansi_delete_file(const void *name); +static DWORD __stdcall ansi_get_file_attributes(const void *name); +static BOOL __stdcall ansi_get_file_attributes_ex(const void *name, GET_FILEEX_INFO_LEVELS info_level, void *information); static void ansi_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i); +static BOOL __stdcall ansi_move_file(const void *from, const void *to, DWORD flags); +static BOOL __stdcall ansi_set_file_attributes(const void *name, DWORD attributes); +static HANDLE __stdcall ansi_find_first_file(const void *name, void* data); /* clang-format off */ -DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN - zip_win32_file_operations_t ops_ansi = { ansi_allocate_tempname, - CreateFileA, - DeleteFileA, - GetFileAttributesA, - GetFileAttributesExA, + ansi_create_file, + ansi_delete_file, + ansi_get_file_attributes, + ansi_get_file_attributes_ex, ansi_make_tempname, - MoveFileExA, - SetFileAttributesA, - strdup + ansi_move_file, + ansi_set_file_attributes, + strdup, + ansi_find_first_file, }; - -DONT_WARN_INCOMPATIBLE_FN_PTR_END /* clang-format on */ @@ -82,2 +86,25 @@ ansi_allocate_tempname(const char *name, size_t extra_chars, size_t *lengthp) { +static HANDLE __stdcall +ansi_create_file(const void *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file) +{ + return CreateFileA((const char *)name, access, share_mode, security_attributes, creation_disposition, file_attributes, template_file); +} + +static BOOL __stdcall +ansi_delete_file(const void *name) +{ + return DeleteFileA((const char *)name); +} + +static DWORD __stdcall +ansi_get_file_attributes(const void *name) +{ + return GetFileAttributesA((const char *)name); +} + +static BOOL __stdcall +ansi_get_file_attributes_ex(const void *name, GET_FILEEX_INFO_LEVELS info_level, void *information) +{ + return GetFileAttributesExA((const char *)name, info_level, information); +} @@ -87 +114,19 @@ ansi_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i) { } + +static BOOL __stdcall +ansi_move_file(const void *from, const void *to, DWORD flags) +{ + return MoveFileExA((const char *)from, (const char *)to, flags); +} + +static BOOL __stdcall +ansi_set_file_attributes(const void *name, DWORD attributes) +{ + return SetFileAttributesA((const char *)name, attributes); +} + +static HANDLE __stdcall +ansi_find_first_file(const void *name, void *data) +{ + return FindFirstFileA((const char *)name, data); +} diff --git a/src/Common/libzip/zip_source_file_win32_named.c b/src/Common/libzip/zip_source_file_win32_named.c index 855e605a..ae72db19 100644 --- a/src/Common/libzip/zip_source_file_win32_named.c +++ b/src/Common/libzip/zip_source_file_win32_named.c @@ -2,3 +2,3 @@ zip_source_file_win32_named.c -- source for Windows file opened by name - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -35,2 +35,9 @@ +/* ACL is not available when targeting the games API partition */ +#if defined(WINAPI_FAMILY_PARTITION) && defined(WINAPI_PARTITION_GAMES) +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_GAMES) +#define ACL_UNSUPPORTED +#endif +#endif + static zip_int64_t _zip_win32_named_op_commit_write(zip_source_file_context_t *ctx); @@ -112,3 +119,7 @@ _zip_win32_named_op_create_temp_output(zip_source_file_context_t *ctx) { si = DACL_SECURITY_INFORMATION | UNPROTECTED_DACL_SECURITY_INFORMATION; + #ifdef ACL_UNSUPPORTED + success = ERROR_NOT_SUPPORTED; + #else success = GetSecurityInfo((HANDLE)ctx->f, SE_FILE_OBJECT, si, NULL, NULL, &dacl, NULL, &psd); + #endif if (success == ERROR_SUCCESS) { @@ -212,4 +223,16 @@ _zip_win32_named_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t if (file_attributes.dwFileAttributes != INVALID_FILE_ATTRIBUTES) { - if ((file_attributes.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE | FILE_ATTRIBUTE_REPARSE_POINT)) == 0) { - st->regular_file = true; + if ((file_attributes.dwFileAttributes & (FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_DEVICE)) == 0) { + if (file_attributes.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { +#ifdef IO_REPARSE_TAG_DEDUP // Not defined in WinSDK 7.1 or before (VS2010). + WIN32_FIND_DATA find_data; + /* Deduplication on Windows replaces files with reparse points; + * accept them as regular files. */ + if (file_ops->find_first_file(ctx->fname, &find_data) != INVALID_HANDLE_VALUE) { + st->regular_file = (find_data.dwReserved0 == IO_REPARSE_TAG_DEDUP); + } +#endif + } + else { + st->regular_file = true; + } } diff --git a/src/Common/libzip/zip_source_file_win32_utf16.c b/src/Common/libzip/zip_source_file_win32_utf16.c index 8f07d021..73e25666 100644 --- a/src/Common/libzip/zip_source_file_win32_utf16.c +++ b/src/Common/libzip/zip_source_file_win32_utf16.c @@ -2,3 +2,3 @@ zip_source_file_win32_utf16.c -- source for Windows file opened by UTF-16 name - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -36,9 +36,14 @@ static char *utf16_allocate_tempname(const char *name, size_t extra_chars, size_t *lengthp); -static HANDLE __stdcall utf16_create_file(const char *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file); +static HANDLE __stdcall utf16_create_file(const void *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file); +static BOOL __stdcall utf16_delete_file(const void *name); +static DWORD __stdcall utf16_get_file_attributes(const void *name); +static BOOL __stdcall utf16_get_file_attributes_ex(const void *name, GET_FILEEX_INFO_LEVELS info_level, void *information); static void utf16_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i); +static BOOL __stdcall utf16_move_file(const void *from, const void *to, DWORD flags); +static BOOL __stdcall utf16_set_file_attributes(const void *name, DWORD attributes); static char *utf16_strdup(const char *string); +static HANDLE __stdcall utf16_find_first_file(const void *name, void* data); -/* clang-format off */ -DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN +/* clang-format off */ zip_win32_file_operations_t ops_utf16 = { @@ -46,12 +51,11 @@ zip_win32_file_operations_t ops_utf16 = { utf16_create_file, - DeleteFileW, - GetFileAttributesW, - GetFileAttributesExW, + utf16_delete_file, + utf16_get_file_attributes, + utf16_get_file_attributes_ex, utf16_make_tempname, - MoveFileExW, - SetFileAttributesW, - utf16_strdup + utf16_move_file, + utf16_set_file_attributes, + utf16_strdup, + utf16_find_first_file }; - -DONT_WARN_INCOMPATIBLE_FN_PTR_END /* clang-format on */ @@ -86,3 +90,3 @@ utf16_allocate_tempname(const char *name, size_t extra_chars, size_t *lengthp) { -static HANDLE __stdcall utf16_create_file(const char *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file) { +static HANDLE __stdcall utf16_create_file(const void *name, DWORD access, DWORD share_mode, PSECURITY_ATTRIBUTES security_attributes, DWORD creation_disposition, DWORD file_attributes, HANDLE template_file) { #ifdef MS_UWP @@ -102,2 +106,19 @@ static HANDLE __stdcall utf16_create_file(const char *name, DWORD access, DWORD +static BOOL __stdcall +utf16_delete_file(const void *name) +{ + return DeleteFileW((const wchar_t *)name); +} + +static DWORD __stdcall +utf16_get_file_attributes(const void *name) +{ + return GetFileAttributesW((const wchar_t *)name); +} + +static BOOL __stdcall +utf16_get_file_attributes_ex(const void *name, GET_FILEEX_INFO_LEVELS info_level, void *information) +{ + return GetFileAttributesExW((const wchar_t *)name, info_level, information); +} @@ -108,2 +129,13 @@ utf16_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i) { +static BOOL __stdcall +utf16_move_file(const void *from, const void *to, DWORD flags) +{ + return MoveFileExW((const wchar_t *)from, (const wchar_t *)to, flags); +} + +static BOOL __stdcall +utf16_set_file_attributes(const void *name, DWORD attributes) +{ + return SetFileAttributesW((const wchar_t *)name, attributes); +} @@ -113 +145,8 @@ utf16_strdup(const char *string) { } + + +static HANDLE __stdcall +utf16_find_first_file(const void *name, void* data) +{ + return FindFirstFileW((const wchar_t *)name, data); +} diff --git a/src/Common/libzip/zip_source_file_win32_utf8.c b/src/Common/libzip/zip_source_file_win32_utf8.c index d154f97a..5c27df92 100644 --- a/src/Common/libzip/zip_source_file_win32_utf8.c +++ b/src/Common/libzip/zip_source_file_win32_utf8.c @@ -2,3 +2,3 @@ zip_source_file_win32_ansi.c -- source for Windows file opened by UTF-8 name - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_free.c b/src/Common/libzip/zip_source_free.c index 1a800405..df4b08d8 100644 --- a/src/Common/libzip/zip_source_free.c +++ b/src/Common/libzip/zip_source_free.c @@ -2,3 +2,3 @@ zip_source_free.c -- free zip data source - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_get_dostime.c b/src/Common/libzip/zip_source_get_dostime.c new file mode 100644 index 00000000..17f652bb --- /dev/null +++ b/src/Common/libzip/zip_source_get_dostime.c @@ -0,0 +1,72 @@ +/* + zip_source_get_dostime.c -- get modification time in DOS format from source + Copyright (C) 2024 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at <info@libzip.org> + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS + OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN + IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#include "zipint.h" + +/* Returns -1 on error, 0 on no dostime available, 1 for dostime returned */ +int +zip_source_get_dos_time(zip_source_t *src, zip_dostime_t *dos_time) { + if (src->source_closed) { + return -1; + } + if (dos_time == NULL) { + zip_error_set(&src->error, ZIP_ER_INVAL, 0); + return -1; + } + + if (src->write_state == ZIP_SOURCE_WRITE_REMOVED) { + zip_error_set(&src->error, ZIP_ER_READ, ENOENT); + } + + if (zip_source_supports(src) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_GET_DOS_TIME)) { + zip_int64_t n = _zip_source_call(src, dos_time, sizeof(*dos_time), ZIP_SOURCE_GET_DOS_TIME); + + if (n < 0) { + return -1; + } + else if (n == 0) { + return 0; + } + else if (n == sizeof(*dos_time)) { + return 1; + } + else { + zip_error_set(&src->error, ZIP_ER_INTERNAL, 0); + return -1; + } + } + else { + return 0; + } +} diff --git a/src/Common/libzip/zip_source_get_file_attributes.c b/src/Common/libzip/zip_source_get_file_attributes.c index 4771dc16..209e39f5 100644 --- a/src/Common/libzip/zip_source_get_file_attributes.c +++ b/src/Common/libzip/zip_source_get_file_attributes.c @@ -2,3 +2,3 @@ zip_source_get_file_attributes.c -- get attributes for file from source - Copyright (C) 2020 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_is_deleted.c b/src/Common/libzip/zip_source_is_deleted.c index 838aa909..d6016a02 100644 --- a/src/Common/libzip/zip_source_is_deleted.c +++ b/src/Common/libzip/zip_source_is_deleted.c @@ -2,3 +2,3 @@ zip_source_is_deleted.c -- was archive was removed? - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_layered.c b/src/Common/libzip/zip_source_layered.c index 62b78e68..be428190 100644 --- a/src/Common/libzip/zip_source_layered.c +++ b/src/Common/libzip/zip_source_layered.c @@ -2,3 +2,3 @@ zip_source_layered.c -- create layered source - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_open.c b/src/Common/libzip/zip_source_open.c index b34fa2c6..9e42d0a9 100644 --- a/src/Common/libzip/zip_source_open.c +++ b/src/Common/libzip/zip_source_open.c @@ -2,3 +2,3 @@ zip_source_open.c -- open zip_source (prepare for reading) - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_pass_to_lower_layer.c b/src/Common/libzip/zip_source_pass_to_lower_layer.c index 4a98222e..391729e4 100644 --- a/src/Common/libzip/zip_source_pass_to_lower_layer.c +++ b/src/Common/libzip/zip_source_pass_to_lower_layer.c @@ -2,3 +2,3 @@ zip_source_pass_to_lower_layer.c -- pass command to lower layer - Copyright (C) 2022 Dieter Baron and Thomas Klausner + Copyright (C) 2022-2024 Dieter Baron and Thomas Klausner @@ -49,2 +49,3 @@ zip_int64_t zip_source_pass_to_lower_layer(zip_source_t *src, void *data, zip_ui case ZIP_SOURCE_ERROR: + case ZIP_SOURCE_GET_DOS_TIME: case ZIP_SOURCE_READ: @@ -54,3 +55,2 @@ zip_int64_t zip_source_pass_to_lower_layer(zip_source_t *src, void *data, zip_ui - case ZIP_SOURCE_BEGIN_WRITE: diff --git a/src/Common/libzip/zip_source_pkware_decode.c b/src/Common/libzip/zip_source_pkware_decode.c index b4c482b3..9c22a069 100644 --- a/src/Common/libzip/zip_source_pkware_decode.c +++ b/src/Common/libzip/zip_source_pkware_decode.c @@ -2,3 +2,3 @@ zip_source_pkware_decode.c -- Traditional PKWARE decryption routines - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2024 Dieter Baron and Thomas Klausner @@ -82,5 +82,5 @@ decrypt_header(zip_source_t *src, struct trad_pkware *ctx) { zip_uint8_t header[ZIP_CRYPTO_PKWARE_HEADERLEN]; - struct zip_stat st; + zip_stat_t st; + zip_dostime_t dostime; zip_int64_t n; - bool ok = false; @@ -98,4 +98,4 @@ decrypt_header(zip_source_t *src, struct trad_pkware *ctx) { - if (zip_source_stat(src, &st)) { - /* stat failed, skip password validation */ + if (zip_source_stat(src, &st) < 0 || (st.valid & ZIP_STAT_CRC) == 0) { + /* skip password validation */ return 0; @@ -103,18 +103,10 @@ decrypt_header(zip_source_t *src, struct trad_pkware *ctx) { - /* password verification - two ways: - * mtime - InfoZIP way, to avoid computing complete CRC before encrypting data - * CRC - old PKWare way - */ - - if (st.valid & ZIP_STAT_MTIME) { - unsigned short dostime, dosdate; - _zip_u2d_time(st.mtime, &dostime, &dosdate); - if (header[ZIP_CRYPTO_PKWARE_HEADERLEN - 1] == dostime >> 8) { - ok = true; + if (zip_source_get_dos_time(src, &dostime) <= 0) { + if ((st.valid & ZIP_STAT_MTIME) == 0) { + /* no date available, skip password validation */ + return 0; } - } - if (st.valid & ZIP_STAT_CRC) { - if (header[ZIP_CRYPTO_PKWARE_HEADERLEN - 1] == st.crc >> 24) { - ok = true; + if (_zip_u2d_time(st.mtime, &dostime, &ctx->error) < 0) { + return -1; } @@ -122,3 +114,12 @@ decrypt_header(zip_source_t *src, struct trad_pkware *ctx) { - if (!ok && ((st.valid & (ZIP_STAT_MTIME | ZIP_STAT_CRC)) != 0)) { + /* + password verification - two ways: + - mtime - InfoZIP way, to avoid computing complete CRC before encrypting data + - CRC - old PKWare way + */ + if (header[ZIP_CRYPTO_PKWARE_HEADERLEN - 1] == dostime.time >> 8 + || header[ZIP_CRYPTO_PKWARE_HEADERLEN - 1] == st.crc >> 24) { + return 0; + } + else { zip_error_set(&ctx->error, ZIP_ER_WRONGPASSWD, 0); @@ -126,4 +127,2 @@ decrypt_header(zip_source_t *src, struct trad_pkware *ctx) { } - - return 0; } diff --git a/src/Common/libzip/zip_source_pkware_encode.c b/src/Common/libzip/zip_source_pkware_encode.c index d89b9f4e..fed76115 100644 --- a/src/Common/libzip/zip_source_pkware_encode.c +++ b/src/Common/libzip/zip_source_pkware_encode.c @@ -2,3 +2,3 @@ zip_source_pkware_encode.c -- Traditional PKWARE encryption routines - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2024 Dieter Baron and Thomas Klausner @@ -44,4 +44,3 @@ struct trad_pkware { bool eof; - bool mtime_set; - time_t mtime; + zip_dostime_t dostime; zip_error_t error; @@ -54,3 +53,2 @@ static void trad_pkware_free(struct trad_pkware *); static struct trad_pkware *trad_pkware_new(const char *password, zip_error_t *error); -static void set_mtime(struct trad_pkware* ctx, zip_stat_t* st); @@ -71,2 +69,3 @@ zip_source_pkware_encode(zip_t *za, zip_source_t *src, zip_uint16_t em, int flag if ((ctx = trad_pkware_new(password, &za->error)) == NULL) { + zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return NULL; @@ -74,2 +73,16 @@ zip_source_pkware_encode(zip_t *za, zip_source_t *src, zip_uint16_t em, int flag + if (zip_source_get_dos_time(src, &ctx->dostime) <= 0) { + zip_stat_t st; + + if (zip_source_stat(src, &st) < 0) { + zip_error_set_from_source(&za->error, src); + trad_pkware_free(ctx); + return NULL; + } + if (_zip_u2d_time((st.valid & ZIP_STAT_MTIME) ? st.mtime : time(NULL), &ctx->dostime, &za->error) < 0) { + trad_pkware_free(ctx); + return NULL; + } + } + if ((s2 = zip_source_layered(za, src, pkware_encrypt, ctx)) == NULL) { @@ -85,16 +98,4 @@ static int encrypt_header(zip_source_t *src, struct trad_pkware *ctx) { - unsigned short dostime, dosdate; zip_uint8_t *header; - if (!ctx->mtime_set) { - struct zip_stat st; - if (zip_source_stat(src, &st) != 0) { - zip_error_set_from_source(&ctx->error, src); - return -1; - } - set_mtime(ctx, &st); - } - - _zip_u2d_time(ctx->mtime, &dostime, &dosdate); - if ((ctx->buffer = _zip_buffer_new(NULL, ZIP_CRYPTO_PKWARE_HEADERLEN)) == NULL) { @@ -114,3 +115,3 @@ encrypt_header(zip_source_t *src, struct trad_pkware *ctx) { } - header[ZIP_CRYPTO_PKWARE_HEADERLEN - 1] = (zip_uint8_t)((dostime >> 8) & 0xff); + header[ZIP_CRYPTO_PKWARE_HEADERLEN - 1] = (zip_uint8_t)((ctx->dostime.time >> 8) & 0xff); @@ -189,5 +190,2 @@ pkware_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, zip } - set_mtime(ctx, st); - st->mtime = ctx->mtime; - st->valid |= ZIP_STAT_MTIME; @@ -208,4 +206,12 @@ pkware_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, zip + case ZIP_SOURCE_GET_DOS_TIME: + if (length < sizeof(ctx->dostime)) { + zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); + return -1; + } + (void)memcpy_s(data, sizeof(ctx->dostime), &ctx->dostime, sizeof(ctx->dostime)); + return sizeof(ctx->dostime); + case ZIP_SOURCE_SUPPORTS: - return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_GET_FILE_ATTRIBUTES, -1); + return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_GET_DOS_TIME, -1); @@ -239,4 +245,2 @@ trad_pkware_new(const char *password, zip_error_t *error) { ctx->buffer = NULL; - ctx->mtime_set = false; - ctx->mtime = 0; zip_error_init(&ctx->error); @@ -258,14 +262 @@ trad_pkware_free(struct trad_pkware *ctx) { } - - -static void set_mtime(struct trad_pkware* ctx, zip_stat_t* st) { - if (!ctx->mtime_set) { - if (st->valid & ZIP_STAT_MTIME) { - ctx->mtime = st->mtime; - } - else { - time(&ctx->mtime); - } - ctx->mtime_set = true; - } -} diff --git a/src/Common/libzip/zip_source_read.c b/src/Common/libzip/zip_source_read.c index 0938fcb0..910d4c3e 100644 --- a/src/Common/libzip/zip_source_read.c +++ b/src/Common/libzip/zip_source_read.c @@ -2,3 +2,3 @@ zip_source_read.c -- read data from zip_source - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_remove.c b/src/Common/libzip/zip_source_remove.c index c1d73ab9..06325b72 100644 --- a/src/Common/libzip/zip_source_remove.c +++ b/src/Common/libzip/zip_source_remove.c @@ -2,3 +2,3 @@ zip_source_remove.c -- remove empty archive - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_rollback_write.c b/src/Common/libzip/zip_source_rollback_write.c index ea1a1510..51613252 100644 --- a/src/Common/libzip/zip_source_rollback_write.c +++ b/src/Common/libzip/zip_source_rollback_write.c @@ -2,3 +2,3 @@ zip_source_rollback_write.c -- discard changes - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_seek.c b/src/Common/libzip/zip_source_seek.c index e3baad5a..42d6b0d2 100644 --- a/src/Common/libzip/zip_source_seek.c +++ b/src/Common/libzip/zip_source_seek.c @@ -2,3 +2,3 @@ zip_source_seek.c -- seek to offset - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_seek_write.c b/src/Common/libzip/zip_source_seek_write.c index 34ae2f5a..9e87fa4d 100644 --- a/src/Common/libzip/zip_source_seek_write.c +++ b/src/Common/libzip/zip_source_seek_write.c @@ -2,3 +2,3 @@ zip_source_seek_write.c -- seek to offset for writing - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_stat.c b/src/Common/libzip/zip_source_stat.c index 05dcb84d..7c8bacac 100644 --- a/src/Common/libzip/zip_source_stat.c +++ b/src/Common/libzip/zip_source_stat.c @@ -2,3 +2,3 @@ zip_source_stat.c -- get meta information from zip_source - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_supports.c b/src/Common/libzip/zip_source_supports.c index 8fea2ae9..e30ee757 100644 --- a/src/Common/libzip/zip_source_supports.c +++ b/src/Common/libzip/zip_source_supports.c @@ -2,3 +2,3 @@ zip_source_supports.c -- check for supported functions - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_tell.c b/src/Common/libzip/zip_source_tell.c index 49057ce5..33ec475e 100644 --- a/src/Common/libzip/zip_source_tell.c +++ b/src/Common/libzip/zip_source_tell.c @@ -2,3 +2,3 @@ zip_source_tell.c -- report current offset - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_tell_write.c b/src/Common/libzip/zip_source_tell_write.c index a5b0e531..6912af9e 100644 --- a/src/Common/libzip/zip_source_tell_write.c +++ b/src/Common/libzip/zip_source_tell_write.c @@ -2,3 +2,3 @@ zip_source_tell_write.c -- report current offset for writing - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_window.c b/src/Common/libzip/zip_source_window.c index 524e27c8..eac27c39 100644 --- a/src/Common/libzip/zip_source_window.c +++ b/src/Common/libzip/zip_source_window.c @@ -2,3 +2,3 @@ zip_source_window.c -- return part of lower source - Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2024 Dieter Baron and Thomas Klausner @@ -53,2 +53,4 @@ struct window { zip_file_attributes_t attributes; + zip_dostime_t dostime; + bool dostime_valid; zip_error_t error; @@ -63,3 +65,3 @@ ZIP_EXTERN zip_source_t * zip_source_window_create(zip_source_t *src, zip_uint64_t start, zip_int64_t len, zip_error_t *error) { - return _zip_source_window_new(src, start, len, NULL, 0, NULL, NULL, 0, false, error); + return _zip_source_window_new(src, start, len, NULL, 0, NULL, NULL, NULL, 0, false, error); } @@ -68,3 +70,3 @@ zip_source_window_create(zip_source_t *src, zip_uint64_t start, zip_int64_t len, zip_source_t * -_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length, zip_stat_t *st, zip_uint64_t st_invalid, zip_file_attributes_t *attributes, zip_t *source_archive, zip_uint64_t source_index, bool take_ownership, zip_error_t *error) { +_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length, zip_stat_t *st, zip_uint64_t st_invalid, zip_file_attributes_t *attributes, zip_dostime_t *dostime, zip_t *source_archive, zip_uint64_t source_index, bool take_ownership, zip_error_t *error) { zip_source_t* window_source; @@ -105,2 +107,9 @@ _zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length } + if (dostime != NULL) { + ctx->dostime = *dostime; + ctx->dostime_valid = true; + } + else { + ctx->dostime_valid = false; + } ctx->source_archive = source_archive; @@ -108,3 +117,3 @@ _zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length zip_error_init(&ctx->error); - ctx->supports = (zip_source_supports(src) & (ZIP_SOURCE_SUPPORTS_SEEKABLE | ZIP_SOURCE_SUPPORTS_REOPEN)) | (zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, ZIP_SOURCE_FREE, -1)); + ctx->supports = (zip_source_supports(src) & (ZIP_SOURCE_SUPPORTS_SEEKABLE | ZIP_SOURCE_SUPPORTS_REOPEN)) | (zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_GET_DOS_TIME, ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, ZIP_SOURCE_FREE, -1)); ctx->needs_seek = (ctx->supports & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK)) ? true : false; @@ -311,2 +320,15 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou + case ZIP_SOURCE_GET_DOS_TIME: + if (len < sizeof(ctx->dostime)) { + zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); + return -1; + } + if (ctx->dostime_valid) { + (void)memcpy_s(data, sizeof(ctx->dostime), &ctx->dostime, sizeof(ctx->dostime)); + return sizeof(ctx->dostime); + } + else { + return 0; + } + case ZIP_SOURCE_SUPPORTS: diff --git a/src/Common/libzip/zip_source_winzip_aes_decode.c b/src/Common/libzip/zip_source_winzip_aes_decode.c index ee53fb41..8830a005 100644 --- a/src/Common/libzip/zip_source_winzip_aes_decode.c +++ b/src/Common/libzip/zip_source_winzip_aes_decode.c @@ -2,3 +2,3 @@ zip_source_winzip_aes_decode.c -- Winzip AES decryption routines - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_winzip_aes_encode.c b/src/Common/libzip/zip_source_winzip_aes_encode.c index 87e2865a..c704b123 100644 --- a/src/Common/libzip/zip_source_winzip_aes_encode.c +++ b/src/Common/libzip/zip_source_winzip_aes_encode.c @@ -2,3 +2,3 @@ zip_source_winzip_aes_encode.c -- Winzip AES encryption routines - Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_write.c b/src/Common/libzip/zip_source_write.c index 24dde9b2..20ca361c 100644 --- a/src/Common/libzip/zip_source_write.c +++ b/src/Common/libzip/zip_source_write.c @@ -2,3 +2,3 @@ zip_source_write.c -- start a new file for writing - Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_zip.c b/src/Common/libzip/zip_source_zip.c index faabf0d2..07819865 100644 --- a/src/Common/libzip/zip_source_zip.c +++ b/src/Common/libzip/zip_source_zip.c @@ -2,3 +2,3 @@ zip_source_zip.c -- create data source from zip file - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2023 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_source_zip_new.c b/src/Common/libzip/zip_source_zip_new.c index ecccdd68..3eb8a4c2 100644 --- a/src/Common/libzip/zip_source_zip_new.c +++ b/src/Common/libzip/zip_source_zip_new.c @@ -2,3 +2,3 @@ zip_source_zip_new.c -- prepare data structures for zip_fopen/zip_source_zip - Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2024 Dieter Baron and Thomas Klausner @@ -202,3 +202,3 @@ ZIP_EXTERN zip_source_t *zip_source_zip_file_create(zip_t *srcza, zip_uint64_t s - if ((src = _zip_source_window_new(src, start, data_len, &st2, ZIP_STAT_NAME, &attributes, source_archive, source_index, take_ownership, error)) == NULL) { + if ((src = _zip_source_window_new(src, start, data_len, &st2, ZIP_STAT_NAME, &attributes, &de->last_mod, source_archive, source_index, take_ownership, error)) == NULL) { return NULL; @@ -221,3 +221,3 @@ ZIP_EXTERN zip_source_t *zip_source_zip_file_create(zip_t *srcza, zip_uint64_t s referring to the same underlying source */ - if ((src = _zip_source_window_new(srcza->src, 0, (zip_int64_t)st.comp_size, &st, ZIP_STAT_NAME, &attributes, srcza, srcidx, take_ownership, error)) == NULL) { + if ((src = _zip_source_window_new(srcza->src, 0, (zip_int64_t)st.comp_size, &st, ZIP_STAT_NAME, &attributes, &de->last_mod, srcza, srcidx, take_ownership, error)) == NULL) { return NULL; @@ -237,3 +237,3 @@ ZIP_EXTERN zip_source_t *zip_source_zip_file_create(zip_t *srcza, zip_uint64_t s referring to the same underlying source */ - if ((src = _zip_source_window_new(src, 0, data_len, &st, ZIP_STAT_NAME, &attributes, NULL, 0, take_ownership, error)) == NULL) { + if ((src = _zip_source_window_new(src, 0, data_len, &st, ZIP_STAT_NAME, &attributes, &de->last_mod, NULL, 0, take_ownership, error)) == NULL) { return NULL; @@ -255,2 +255,3 @@ ZIP_EXTERN zip_source_t *zip_source_zip_file_create(zip_t *srcza, zip_uint64_t s if ((enc_impl = _zip_get_encryption_implementation(st.encryption_method, ZIP_CODEC_DECODE)) == NULL) { + zip_source_free(src); zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0); @@ -291,3 +292,3 @@ ZIP_EXTERN zip_source_t *zip_source_zip_file_create(zip_t *srcza, zip_uint64_t s } - s2 = _zip_source_window_new(src, start, data_len, &st2, ZIP_STAT_NAME, NULL, NULL, 0, true, error); + s2 = _zip_source_window_new(src, start, data_len, &st2, ZIP_STAT_NAME, NULL, NULL, NULL, 0, true, error); if (s2 == NULL) { diff --git a/src/Common/libzip/zip_stat.c b/src/Common/libzip/zip_stat.c index 51d8026d..74fc5c37 100644 --- a/src/Common/libzip/zip_stat.c +++ b/src/Common/libzip/zip_stat.c @@ -2,3 +2,3 @@ zip_stat.c -- get information about file by name - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_stat_index.c b/src/Common/libzip/zip_stat_index.c index da33c09e..af9f0e5f 100644 --- a/src/Common/libzip/zip_stat_index.c +++ b/src/Common/libzip/zip_stat_index.c @@ -2,3 +2,3 @@ zip_stat_index.c -- get information about file by index - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -79,3 +79,3 @@ zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) if (entry->changes != NULL && entry->changes->changed & ZIP_DIRENT_LAST_MOD) { - st->mtime = de->last_mod; + st->mtime = zip_dirent_get_last_mod_mtime(de); st->valid |= ZIP_STAT_MTIME; @@ -88,3 +88,3 @@ zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) st->size = de->uncomp_size; - st->mtime = de->last_mod; + st->mtime = zip_dirent_get_last_mod_mtime(de); st->comp_size = de->comp_size; @@ -99,4 +99,8 @@ zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) if ((za->ch_flags & ZIP_AFL_WANT_TORRENTZIP) && (flags & ZIP_FL_UNCHANGED) == 0) { + if (za->torrent_mtime == 0) { + zip_dostime_t dostime = {0xbc00, 0x2198}; + za->torrent_mtime = _zip_d2u_time(&dostime); + } st->comp_method = ZIP_CM_DEFLATE; - st->mtime = _zip_d2u_time(0xbc00, 0x2198); + st->mtime = za->torrent_mtime; st->valid |= ZIP_STAT_MTIME | ZIP_STAT_COMP_METHOD; diff --git a/src/Common/libzip/zip_stat_init.c b/src/Common/libzip/zip_stat_init.c index 9c6088a7..bd83565b 100644 --- a/src/Common/libzip/zip_stat_init.c +++ b/src/Common/libzip/zip_stat_init.c @@ -2,3 +2,3 @@ zip_stat_init.c -- initialize struct zip_stat. - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_strerror.c b/src/Common/libzip/zip_strerror.c index 7d827931..681024a3 100644 --- a/src/Common/libzip/zip_strerror.c +++ b/src/Common/libzip/zip_strerror.c @@ -2,3 +2,3 @@ zip_sterror.c -- get string representation of zip error - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_string.c b/src/Common/libzip/zip_string.c index 1c964491..bb06c1d6 100644 --- a/src/Common/libzip/zip_string.c +++ b/src/Common/libzip/zip_string.c @@ -2,3 +2,3 @@ zip_string.c -- string handling (with encoding) - Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2024 Dieter Baron and Thomas Klausner @@ -90,4 +90,6 @@ _zip_string_get(zip_string_t *string, zip_uint32_t *lenp, zip_flags_t flags, zip /* start guessing */ - if (string->encoding == ZIP_ENCODING_UNKNOWN) - _zip_guess_encoding(string, ZIP_ENCODING_UNKNOWN); + if (string->encoding == ZIP_ENCODING_UNKNOWN) { + /* guess encoding, sets string->encoding */ + (void)_zip_guess_encoding(string, ZIP_ENCODING_UNKNOWN); + } @@ -109,2 +111,16 @@ _zip_string_get(zip_string_t *string, zip_uint32_t *lenp, zip_flags_t flags, zip +bool _zip_string_is_ascii(const zip_string_t *string) { + if (string->encoding != ZIP_ENCODING_ASCII) { + zip_uint16_t i; + + for (i = 0; i < string->length; i++) { + if (string->raw[i] & 0x80) { + return false; + } + } + } + + return true; +} + diff --git a/src/Common/libzip/zip_unchange_all.c b/src/Common/libzip/zip_unchange_all.c index 34f3702e..0b22c803 100644 --- a/src/Common/libzip/zip_unchange_all.c +++ b/src/Common/libzip/zip_unchange_all.c @@ -2,3 +2,3 @@ zip_unchange.c -- undo changes to all files in zip archive - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_unchange_archive.c b/src/Common/libzip/zip_unchange_archive.c index 56a8e31f..ddd617bc 100644 --- a/src/Common/libzip/zip_unchange_archive.c +++ b/src/Common/libzip/zip_unchange_archive.c @@ -2,3 +2,3 @@ zip_unchange_archive.c -- undo global changes to ZIP archive - Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_unchange_data.c b/src/Common/libzip/zip_unchange_data.c index 6bdecd18..30a7be7b 100644 --- a/src/Common/libzip/zip_unchange_data.c +++ b/src/Common/libzip/zip_unchange_data.c @@ -2,3 +2,3 @@ zip_unchange_data.c -- undo helper function - Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zip_utf-8.c b/src/Common/libzip/zip_utf-8.c index 678912f6..7d671f60 100644 --- a/src/Common/libzip/zip_utf-8.c +++ b/src/Common/libzip/zip_utf-8.c @@ -2,3 +2,3 @@ zip_utf-8.c -- UTF-8 support functions for libzip - Copyright (C) 2011-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2011-2024 Dieter Baron and Thomas Klausner @@ -103,5 +103,9 @@ _zip_guess_encoding(zip_string_t *str, zip_encoding_type_t expected_encoding) { zip_uint32_t i, j, ulen; + bool can_be_ascii = true; + bool can_be_utf8 = true; + bool has_control_characters = false; - if (str == NULL) + if (str == NULL) { return ZIP_ENCODING_ASCII; + } @@ -109,48 +113,95 @@ _zip_guess_encoding(zip_string_t *str, zip_encoding_type_t expected_encoding) { - if (str->encoding != ZIP_ENCODING_UNKNOWN) - enc = str->encoding; - else { - enc = ZIP_ENCODING_ASCII; - for (i = 0; i < str->length; i++) { - if ((name[i] > 31 && name[i] < 128) || name[i] == '\r' || name[i] == '\n' || name[i] == '\t') - continue; - - enc = ZIP_ENCODING_UTF8_GUESSED; - if ((name[i] & UTF_8_LEN_2_MASK) == UTF_8_LEN_2_MATCH) - ulen = 1; - else if ((name[i] & UTF_8_LEN_3_MASK) == UTF_8_LEN_3_MATCH) - ulen = 2; - else if ((name[i] & UTF_8_LEN_4_MASK) == UTF_8_LEN_4_MATCH) - ulen = 3; - else { - enc = ZIP_ENCODING_CP437; - break; - } + if (str->encoding != ZIP_ENCODING_UNKNOWN) { + return str->encoding; + } - if (i + ulen >= str->length) { - enc = ZIP_ENCODING_CP437; - break; + for (i = 0; i < str->length; i++) { + if (name[i] < 128) { + if (name[i] < 32 && name[i] != '\r' && name[i] != '\n' && name[i] != '\t') { + has_control_characters = true; } + continue; + } + + can_be_ascii = false; + if ((name[i] & UTF_8_LEN_2_MASK) == UTF_8_LEN_2_MATCH) { + ulen = 1; + } + else if ((name[i] & UTF_8_LEN_3_MASK) == UTF_8_LEN_3_MATCH) { + ulen = 2; + } + else if ((name[i] & UTF_8_LEN_4_MASK) == UTF_8_LEN_4_MATCH) { + ulen = 3; + } + else { + can_be_utf8 = false; + break; + } - for (j = 1; j <= ulen; j++) { - if ((name[i + j] & UTF_8_CONTINUE_MASK) != UTF_8_CONTINUE_MATCH) { - enc = ZIP_ENCODING_CP437; - goto done; - } + if (i + ulen >= str->length) { + can_be_utf8 = false; + break; + } + + for (j = 1; j <= ulen; j++) { + if ((name[i + j] & UTF_8_CONTINUE_MASK) != UTF_8_CONTINUE_MATCH) { + can_be_utf8 = false; + goto done; } - i += ulen; } + i += ulen; } -done: - str->encoding = enc; + done: + enc = ZIP_ENCODING_CP437; + + switch (expected_encoding) { + case ZIP_ENCODING_UTF8_KNOWN: + case ZIP_ENCODING_UTF8_GUESSED: + if (can_be_utf8) { + enc = ZIP_ENCODING_UTF8_KNOWN; + } + else { + enc = ZIP_ENCODING_ERROR; + } + break; - if (expected_encoding != ZIP_ENCODING_UNKNOWN) { - if (expected_encoding == ZIP_ENCODING_UTF8_KNOWN && enc == ZIP_ENCODING_UTF8_GUESSED) - str->encoding = enc = ZIP_ENCODING_UTF8_KNOWN; + case ZIP_ENCODING_ASCII: + if (can_be_ascii && !has_control_characters) { + enc = ZIP_ENCODING_ASCII; + } + else { + enc = ZIP_ENCODING_ERROR; + } + break; - if (expected_encoding != enc && enc != ZIP_ENCODING_ASCII) - return ZIP_ENCODING_ERROR; + case ZIP_ENCODING_CP437: + enc = ZIP_ENCODING_CP437; + break; + + case ZIP_ENCODING_UNKNOWN: + if (can_be_ascii && !has_control_characters) { + /* only bytes from 0x20-0x7F */ + enc = ZIP_ENCODING_ASCII; + } + else if (can_be_ascii && has_control_characters) { + /* only bytes from 0x00-0x7F */ + enc = ZIP_ENCODING_CP437; + } + else if (can_be_utf8) { + /* contains bytes from 0x80-0xFF and is valid UTF-8 */ + enc = ZIP_ENCODING_UTF8_GUESSED; + } + else { + /* fallback */ + enc = ZIP_ENCODING_CP437; + } + break; + case ZIP_ENCODING_ERROR: + /* invalid, shouldn't happen */ + enc = ZIP_ENCODING_ERROR; + break; } + str->encoding = enc; return enc; @@ -161,8 +212,11 @@ static zip_uint32_t _zip_unicode_to_utf8_len(zip_uint32_t codepoint) { - if (codepoint < 0x0080) + if (codepoint < 0x0080) { return 1; - if (codepoint < 0x0800) + } + if (codepoint < 0x0800) { return 2; - if (codepoint < 0x10000) + } + if (codepoint < 0x10000) { return 3; + } return 4; @@ -203,4 +257,5 @@ _zip_cp437_to_utf8(const zip_uint8_t *const _cp437buf, zip_uint32_t len, zip_uin if (len == 0) { - if (utf8_lenp) + if (utf8_lenp) { *utf8_lenp = 0; + } return NULL; @@ -209,4 +264,5 @@ _zip_cp437_to_utf8(const zip_uint8_t *const _cp437buf, zip_uint32_t len, zip_uin buflen = 1; - for (i = 0; i < len; i++) + for (i = 0; i < len; i++) { buflen += _zip_unicode_to_utf8_len(_cp437_to_unicode[cp437buf[i]]); + } @@ -218,8 +274,10 @@ _zip_cp437_to_utf8(const zip_uint8_t *const _cp437buf, zip_uint32_t len, zip_uin offset = 0; - for (i = 0; i < len; i++) + for (i = 0; i < len; i++) { offset += _zip_unicode_to_utf8(_cp437_to_unicode[cp437buf[i]], utf8buf + offset); + } utf8buf[buflen - 1] = 0; - if (utf8_lenp) + if (utf8_lenp) { *utf8_lenp = buflen - 1; + } return utf8buf; diff --git a/src/Common/libzip/zip_winzip_aes.c b/src/Common/libzip/zip_winzip_aes.c index ce269036..2c9874b0 100644 --- a/src/Common/libzip/zip_winzip_aes.c +++ b/src/Common/libzip/zip_winzip_aes.c @@ -2,3 +2,3 @@ zip_winzip_aes.c -- Winzip AES de/encryption backend routines - Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2022 Dieter Baron and Thomas Klausner diff --git a/src/Common/libzip/zipconf.h b/src/Common/libzip/zipconf.h index 472e06c1..28954780 100644 --- a/src/Common/libzip/zipconf.h +++ b/src/Common/libzip/zipconf.h @@ -10,6 +10,6 @@ -#define LIBZIP_VERSION "1.10.1" +#define LIBZIP_VERSION "1.11.2" #define LIBZIP_VERSION_MAJOR 1 -#define LIBZIP_VERSION_MINOR 10 -#define LIBZIP_VERSION_MICRO 1 +#define LIBZIP_VERSION_MINOR 11 +#define LIBZIP_VERSION_MICRO 2 diff --git a/src/Common/libzip/zipint.h b/src/Common/libzip/zipint.h index 4887b6c5..e22d74c2 100644 --- a/src/Common/libzip/zipint.h +++ b/src/Common/libzip/zipint.h @@ -5,3 +5,3 @@ zipint.h -- internal declarations. - Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner @@ -58,2 +58,3 @@ #define EOCD64_MAGIC "PK\6\6" +#define MAGIC_LEN 4 #define CDENTRYSIZE 46u @@ -231,8 +232,13 @@ extern const int _zip_err_details_count; #define ZIP_ER_DETAIL_INVALID_UTF8_IN_FILENAME 13 /* E invalid UTF-8 in filename */ -#define ZIP_ER_DETAIL_INVALID_UTF8_IN_COMMENT 13 /* E invalid UTF-8 in comment */ -#define ZIP_ER_DETAIL_INVALID_ZIP64_EF 14 /* E invalid Zip64 extra field */ -#define ZIP_ER_DETAIL_INVALID_WINZIPAES_EF 14 /* E invalid WinZip AES extra field */ -#define ZIP_ER_DETAIL_EF_TRAILING_GARBAGE 15 /* E garbage at end of extra fields */ -#define ZIP_ER_DETAIL_INVALID_EF_LENGTH 16 /* E extra field length is invalid */ -#define ZIP_ER_DETAIL_INVALID_FILE_LENGTH 17 /* E file length in header doesn't match actual file length */ +#define ZIP_ER_DETAIL_INVALID_UTF8_IN_COMMENT 14 /* E invalid UTF-8 in comment */ +#define ZIP_ER_DETAIL_INVALID_ZIP64_EF 15 /* E invalid Zip64 extra field */ +#define ZIP_ER_DETAIL_INVALID_WINZIPAES_EF 16 /* E invalid WinZip AES extra field */ +#define ZIP_ER_DETAIL_EF_TRAILING_GARBAGE 17 /* E garbage at end of extra fields */ +#define ZIP_ER_DETAIL_INVALID_EF_LENGTH 18 /* E extra field length is invalid */ +#define ZIP_ER_DETAIL_INVALID_FILE_LENGTH 19 /* E file length in header doesn't match actual file length */ +#define ZIP_ER_DETAIL_STORED_SIZE_MISMATCH 20 /* E compressed and uncompressed sizes don't match for stored file */ +#define ZIP_ER_DETAIL_DATA_DESCRIPTOR_MISMATCH 21 /* E local header and data descriptor do not match */ +#define ZIP_ER_DETAIL_EOCD64_LOCATOR_MISMATCH 22 /* G EOCD64 and EOCD64 locator do not match */ +#define ZIP_ER_DETAIL_UTF8_FILENAME_MISMATCH 23 /* E UTF-8 filename is ASCII and doesn't match filename */ +#define ZIP_ER_DETAIL_UTF8_COMMENT_MISMATCH 24 /* E UTF-8 comment is ASCII and doesn't match comment */ @@ -272,2 +278,3 @@ struct zip_progress; typedef struct zip_cdir zip_cdir_t; +typedef struct zip_dostime zip_dostime_t; typedef struct zip_dirent zip_dirent_t; @@ -309,2 +316,3 @@ struct zip { zip_uint32_t* write_crc; /* have _zip_write() compute CRC */ + time_t torrent_mtime; }; @@ -330,2 +338,7 @@ struct zip_file { +struct zip_dostime { + zip_uint16_t time; + zip_uint16_t date; +}; + struct zip_dirent { @@ -336,2 +349,3 @@ struct zip_dirent { bool crc_valid; /* if CRC is valid (sometimes not for encrypted archives) */ + bool last_mod_mtime_valid; @@ -341,3 +355,3 @@ struct zip_dirent { zip_int32_t comp_method; /* (cl) compression method used (uint16 and ZIP_CM_DEFAULT (-1)) */ - time_t last_mod; /* (cl) time of last modification */ + zip_dostime_t last_mod; /* (cl) time of last modification */ zip_uint32_t crc; /* (cl) CRC-32 of uncompressed data */ @@ -356,2 +370,4 @@ struct zip_dirent { char *password; /* file specific encryption password */ + + time_t last_mod_mtime; /* cached last_mod in Unix time format */ }; @@ -365,4 +381,9 @@ struct zip_cdir { + zip_uint32_t this_disk; + zip_uint32_t eocd_disk; + zip_uint64_t disk_entries; /* number of entries on this disk */ + zip_uint64_t num_entries; /* number of entries on all disks */ zip_uint64_t size; /* size of central directory */ zip_uint64_t offset; /* offset of central directory in file */ + zip_uint64_t eocd_offset; /* offset of EOCD in file */ zip_string_t *comment; /* zip archive comment */ @@ -528,5 +549,5 @@ void _zip_cdir_free(zip_cdir_t *); bool _zip_cdir_grow(zip_cdir_t *cd, zip_uint64_t additional_entries, zip_error_t *error); -zip_cdir_t *_zip_cdir_new(zip_uint64_t, zip_error_t *); +zip_cdir_t *_zip_cdir_new(zip_error_t *); zip_int64_t _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors); -time_t _zip_d2u_time(zip_uint16_t, zip_uint16_t); +time_t _zip_d2u_time(const zip_dostime_t*); void _zip_deregister_source(zip_t *za, zip_source_t *src); @@ -534,2 +555,3 @@ void _zip_deregister_source(zip_t *za, zip_source_t *src); void _zip_dirent_apply_attributes(zip_dirent_t *, zip_file_attributes_t *, bool, zip_uint32_t); +int zip_dirent_check_consistency(zip_dirent_t *dirent); zip_dirent_t *_zip_dirent_clone(const zip_dirent_t *); @@ -537,2 +559,3 @@ void _zip_dirent_free(zip_dirent_t *); void _zip_dirent_finalize(zip_dirent_t *); +time_t zip_dirent_get_last_mod_mtime(zip_dirent_t *de); void _zip_dirent_init(zip_dirent_t *); @@ -541,3 +564,3 @@ zip_dirent_t *_zip_dirent_new(void); bool zip_dirent_process_ef_zip64(zip_dirent_t * zde, const zip_uint8_t * ef, zip_uint64_t got_len, bool local, zip_error_t * error); -zip_int64_t _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error); +zip_int64_t _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_uint64_t central_compressed_size, bool check_consistency, zip_error_t *error); void _zip_dirent_set_version_needed(zip_dirent_t *de, bool force_zip64); @@ -613,2 +636,4 @@ zip_int64_t _zip_source_call(zip_source_t *src, void *data, zip_uint64_t length, bool _zip_source_eof(zip_source_t *); +int zip_source_get_dos_time(zip_source_t *src, zip_dostime_t *dos_time); + zip_source_t *_zip_source_file_or_p(const char *, FILE *, zip_uint64_t, zip_int64_t, const zip_stat_t *, zip_error_t *error); @@ -618,3 +643,3 @@ zip_source_t *_zip_source_new(zip_error_t *error); int _zip_source_set_source_archive(zip_source_t *, zip_t *); -zip_source_t *_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length, zip_stat_t *st, zip_uint64_t st_invalid, zip_file_attributes_t *attributes, zip_t *source_archive, zip_uint64_t source_index, bool take_ownership, zip_error_t *error); +zip_source_t *_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length, zip_stat_t *st, zip_uint64_t st_invalid, zip_file_attributes_t *attributes, zip_dostime_t *dostime, zip_t *source_archive, zip_uint64_t source_index, bool take_ownership, zip_error_t *error); @@ -625,2 +650,3 @@ zip_uint32_t _zip_string_crc32(const zip_string_t *string); const zip_uint8_t *_zip_string_get(zip_string_t *string, zip_uint32_t *lenp, zip_flags_t flags, zip_error_t *error); +bool _zip_string_is_ascii(const zip_string_t *string); zip_uint16_t _zip_string_length(const zip_string_t *string); @@ -649,3 +675,3 @@ zip_int64_t _zip_file_replace(zip_t *, zip_uint64_t, const char *, zip_source_t int _zip_set_name(zip_t *, zip_uint64_t, const char *, zip_flags_t); -void _zip_u2d_time(time_t, zip_uint16_t *, zip_uint16_t *); +int _zip_u2d_time(time_t, zip_dostime_t *, zip_error_t *); int _zip_unchange(zip_t *, zip_uint64_t, int); @@ -654,2 +680,2 @@ int _zip_write(zip_t *za, const void *data, zip_uint64_t length); -#endif /* zipint.h */ +#endif /* _HAD_ZIPINT_H */ diff --git a/src/Common/lzma/7zTypes.h b/src/Common/lzma/7zTypes.h index 1fcb2473..5b77420a 100644 --- a/src/Common/lzma/7zTypes.h +++ b/src/Common/lzma/7zTypes.h @@ -1,3 +1,3 @@ /* 7zTypes.h -- Basic types -2023-04-02 : Igor Pavlov : Public domain */ +2024-01-24 : Igor Pavlov : Public domain */ @@ -532,10 +532,10 @@ struct ISzAlloc #if defined (__clang__) || defined(__GNUC__) -#define Z7_DIAGNOSCTIC_IGNORE_BEGIN_CAST_QUAL \ +#define Z7_DIAGNOSTIC_IGNORE_BEGIN_CAST_QUAL \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") -#define Z7_DIAGNOSCTIC_IGNORE_END_CAST_QUAL \ +#define Z7_DIAGNOSTIC_IGNORE_END_CAST_QUAL \ _Pragma("GCC diagnostic pop") #else -#define Z7_DIAGNOSCTIC_IGNORE_BEGIN_CAST_QUAL -#define Z7_DIAGNOSCTIC_IGNORE_END_CAST_QUAL +#define Z7_DIAGNOSTIC_IGNORE_BEGIN_CAST_QUAL +#define Z7_DIAGNOSTIC_IGNORE_END_CAST_QUAL #endif @@ -543,5 +543,5 @@ struct ISzAlloc #define Z7_CONTAINER_FROM_VTBL_TO_DECL_VAR(ptr, type, m, p) \ - Z7_DIAGNOSCTIC_IGNORE_BEGIN_CAST_QUAL \ + Z7_DIAGNOSTIC_IGNORE_BEGIN_CAST_QUAL \ type *p = Z7_CONTAINER_FROM_VTBL(ptr, type, m); \ - Z7_DIAGNOSCTIC_IGNORE_END_CAST_QUAL + Z7_DIAGNOSTIC_IGNORE_END_CAST_QUAL diff --git a/src/Common/lzma/Alloc.c b/src/Common/lzma/Alloc.c index d841bf20..63e1a121 100644 --- a/src/Common/lzma/Alloc.c +++ b/src/Common/lzma/Alloc.c @@ -1,3 +1,3 @@ /* Alloc.c -- Memory allocation functions -2023-04-02 : Igor Pavlov : Public domain */ +2024-02-18 : Igor Pavlov : Public domain */ @@ -12,15 +12,14 @@ -#ifdef _WIN32 -#ifdef Z7_LARGE_PAGES -#if defined(__clang__) || defined(__GNUC__) -typedef void (*Z7_voidFunction)(void); -#define MY_CAST_FUNC (Z7_voidFunction) -#elif defined(_MSC_VER) && _MSC_VER > 1920 -#define MY_CAST_FUNC (void *) -// #pragma warning(disable : 4191) // 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)()' -#else -#define MY_CAST_FUNC +#if defined(Z7_LARGE_PAGES) && defined(_WIN32) && \ + (!defined(Z7_WIN32_WINNT_MIN) || Z7_WIN32_WINNT_MIN < 0x0502) // < Win2003 (xp-64) + #define Z7_USE_DYN_GetLargePageMinimum +#endif + +// for debug: +#if 0 +#if defined(__CHERI__) && defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 16) +// #pragma message("=== Z7_ALLOC_NO_OFFSET_ALLOCATOR === ") +#define Z7_ALLOC_NO_OFFSET_ALLOCATOR +#endif #endif -#endif // Z7_LARGE_PAGES -#endif // _WIN32 @@ -148,3 +147,5 @@ static void PrintAddr(void *p) #define PrintLn() +#ifndef Z7_ALLOC_NO_OFFSET_ALLOCATOR #define PrintHex(v, align) +#endif #define PrintAddr(p) @@ -248,5 +249,5 @@ void MidFree(void *address) #ifdef MEM_LARGE_PAGES - #define MY__MEM_LARGE_PAGES MEM_LARGE_PAGES + #define MY_MEM_LARGE_PAGES MEM_LARGE_PAGES #else - #define MY__MEM_LARGE_PAGES 0x20000000 + #define MY_MEM_LARGE_PAGES 0x20000000 #endif @@ -260,7 +261,9 @@ void SetLargePageSize(void) { - #ifdef Z7_LARGE_PAGES SIZE_T size; +#ifdef Z7_USE_DYN_GetLargePageMinimum +Z7_DIAGNOSTIC_IGNORE_CAST_FUNCTION + const Func_GetLargePageMinimum fn = - (Func_GetLargePageMinimum) MY_CAST_FUNC GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), + (Func_GetLargePageMinimum) Z7_CAST_FUNC_C GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum"); @@ -269,2 +272,5 @@ void SetLargePageSize(void) size = fn(); +#else + size = GetLargePageMinimum(); +#endif if (size == 0 || (size & (size - 1)) != 0) @@ -272,3 +278,2 @@ void SetLargePageSize(void) g_LargePageSize = size; - #endif } @@ -294,3 +299,3 @@ void *BigAlloc(size_t size) { - void *p = VirtualAlloc(NULL, size2, MEM_COMMIT | MY__MEM_LARGE_PAGES, PAGE_READWRITE); + void *p = VirtualAlloc(NULL, size2, MEM_COMMIT | MY_MEM_LARGE_PAGES, PAGE_READWRITE); if (p) @@ -330,16 +335,3 @@ const ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree }; -/* - uintptr_t : <stdint.h> C99 (optional) - : unsupported in VS6 -*/ - -#ifdef _WIN32 - typedef UINT_PTR UIntPtr; -#else - /* - typedef uintptr_t UIntPtr; - */ - typedef ptrdiff_t UIntPtr; -#endif - +#ifndef Z7_ALLOC_NO_OFFSET_ALLOCATOR @@ -354,10 +346,32 @@ const ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree }; - /* -#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((char *)(p) - ((size_t)(UIntPtr)(p) & ((align) - 1)))) + uintptr_t : <stdint.h> C99 (optional) + : unsupported in VS6 */ -#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((((UIntPtr)(p)) & ~((UIntPtr)(align) - 1)))) +typedef + #ifdef _WIN32 + UINT_PTR + #elif 1 + uintptr_t + #else + ptrdiff_t + #endif + MY_uintptr_t; + +#if 0 \ + || (defined(__CHERI__) \ + || defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ > 8)) +// for 128-bit pointers (cheri): +#define MY_ALIGN_PTR_DOWN(p, align) \ + ((void *)((char *)(p) - ((size_t)(MY_uintptr_t)(p) & ((align) - 1)))) +#else +#define MY_ALIGN_PTR_DOWN(p, align) \ + ((void *)((((MY_uintptr_t)(p)) & ~((MY_uintptr_t)(align) - 1)))) +#endif +#endif -#if !defined(_WIN32) && defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) +#if !defined(_WIN32) \ + && (defined(Z7_ALLOC_NO_OFFSET_ALLOCATOR) \ + || defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) #define USE_posix_memalign @@ -401,5 +415,5 @@ static int posix_memalign(void **ptr, size_t align, size_t size) -static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size) +void *z7_AlignedAlloc(size_t size) { - #ifndef USE_posix_memalign +#ifndef USE_posix_memalign @@ -408,3 +422,2 @@ static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size) size_t newSize; - UNUSED_VAR(pp) @@ -433,6 +446,5 @@ static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size) - #else +#else void *p; - UNUSED_VAR(pp) if (posix_memalign(&p, ALLOC_ALIGN_SIZE, size)) @@ -445,3 +457,21 @@ static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size) - #endif +#endif +} + + +void z7_AlignedFree(void *address) +{ +#ifndef USE_posix_memalign + if (address) + MyFree(((void **)address)[-1]); +#else + free(address); +#endif +} + + +static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size) +{ + UNUSED_VAR(pp) + return z7_AlignedAlloc(size); } @@ -452,8 +482,8 @@ static void SzAlignedFree(ISzAllocPtr pp, void *address) UNUSED_VAR(pp) - #ifndef USE_posix_memalign +#ifndef USE_posix_memalign if (address) MyFree(((void **)address)[-1]); - #else +#else free(address); - #endif +#endif } @@ -465,9 +495,33 @@ const ISzAlloc g_AlignedAlloc = { SzAlignedAlloc, SzAlignedFree }; -#define MY_ALIGN_PTR_DOWN_1(p) MY_ALIGN_PTR_DOWN(p, sizeof(void *)) - /* we align ptr to support cases where CAlignOffsetAlloc::offset is not multiply of sizeof(void *) */ -#define REAL_BLOCK_PTR_VAR(p) ((void **)MY_ALIGN_PTR_DOWN_1(p))[-1] -/* -#define REAL_BLOCK_PTR_VAR(p) ((void **)(p))[-1] -*/ +#ifndef Z7_ALLOC_NO_OFFSET_ALLOCATOR +#if 1 + #define MY_ALIGN_PTR_DOWN_1(p) MY_ALIGN_PTR_DOWN(p, sizeof(void *)) + #define REAL_BLOCK_PTR_VAR(p) ((void **)MY_ALIGN_PTR_DOWN_1(p))[-1] +#else + // we can use this simplified code, + // if (CAlignOffsetAlloc::offset == (k * sizeof(void *)) + #define REAL_BLOCK_PTR_VAR(p) (((void **)(p))[-1]) +#endif +#endif + + +#if 0 +#ifndef Z7_ALLOC_NO_OFFSET_ALLOCATOR +#include <stdio.h> +static void PrintPtr(const char *s, const void *p) +{ + const Byte *p2 = (const Byte *)&p; + unsigned i; + printf("%s %p ", s, p); + for (i = sizeof(p); i != 0;) + { + i--; + printf("%02x", p2[i]); + } + printf("\n"); +} +#endif +#endif + @@ -475,2 +529,6 @@ static void *AlignOffsetAlloc_Alloc(ISzAllocPtr pp, size_t size) { +#if defined(Z7_ALLOC_NO_OFFSET_ALLOCATOR) + UNUSED_VAR(pp) + return z7_AlignedAlloc(size); +#else const CAlignOffsetAlloc *p = Z7_CONTAINER_FROM_VTBL_CONST(pp, CAlignOffsetAlloc, vt); @@ -503,2 +561,8 @@ static void *AlignOffsetAlloc_Alloc(ISzAllocPtr pp, size_t size) +#if 0 + printf("\nalignSize = %6x, offset=%6x, size=%8x \n", (unsigned)alignSize, (unsigned)p->offset, (unsigned)size); + PrintPtr("base", adr); + PrintPtr("alig", pAligned); +#endif + PrintLn(); @@ -514,2 +578,3 @@ static void *AlignOffsetAlloc_Alloc(ISzAllocPtr pp, size_t size) return pAligned; +#endif } @@ -519,2 +584,6 @@ static void AlignOffsetAlloc_Free(ISzAllocPtr pp, void *address) { +#if defined(Z7_ALLOC_NO_OFFSET_ALLOCATOR) + UNUSED_VAR(pp) + z7_AlignedFree(address); +#else if (address) @@ -527,2 +596,3 @@ static void AlignOffsetAlloc_Free(ISzAllocPtr pp, void *address) } +#endif } diff --git a/src/Common/lzma/Alloc.h b/src/Common/lzma/Alloc.h index fac5b62f..01bf6b7d 100644 --- a/src/Common/lzma/Alloc.h +++ b/src/Common/lzma/Alloc.h @@ -1,3 +1,3 @@ /* Alloc.h -- Memory allocation functions -2023-03-04 : Igor Pavlov : Public domain */ +2024-01-22 : Igor Pavlov : Public domain */ @@ -24,2 +24,5 @@ void *MyRealloc(void *address, size_t size); +void *z7_AlignedAlloc(size_t size); +void z7_AlignedFree(void *p); + #ifdef _WIN32 @@ -35,8 +38,10 @@ void BigFree(void *address); +/* #define Z7_BIG_ALLOC_IS_ZERO_FILLED */ + #else -#define MidAlloc(size) MyAlloc(size) -#define MidFree(address) MyFree(address) -#define BigAlloc(size) MyAlloc(size) -#define BigFree(address) MyFree(address) +#define MidAlloc(size) z7_AlignedAlloc(size) +#define MidFree(address) z7_AlignedFree(address) +#define BigAlloc(size) z7_AlignedAlloc(size) +#define BigFree(address) z7_AlignedFree(address) diff --git a/src/Common/lzma/Compiler.h b/src/Common/lzma/Compiler.h index 185a52de..2a9c2b7a 100644 --- a/src/Common/lzma/Compiler.h +++ b/src/Common/lzma/Compiler.h @@ -1,3 +1,3 @@ /* Compiler.h : Compiler specific defines and pragmas -2023-04-02 : Igor Pavlov : Public domain */ +2024-01-22 : Igor Pavlov : Public domain */ @@ -27,2 +27,19 @@ +#if defined(__LCC__) && (defined(__MCST__) || defined(__e2k__)) +#define Z7_MCST_LCC +#define Z7_MCST_LCC_VERSION (__LCC__ * 100 + __LCC_MINOR__) +#endif + +/* +#if defined(__AVX2__) \ + || defined(Z7_GCC_VERSION) && (Z7_GCC_VERSION >= 40900) \ + || defined(Z7_APPLE_CLANG_VERSION) && (Z7_APPLE_CLANG_VERSION >= 40600) \ + || defined(Z7_LLVM_CLANG_VERSION) && (Z7_LLVM_CLANG_VERSION >= 30100) \ + || defined(Z7_MSC_VER_ORIGINAL) && (Z7_MSC_VER_ORIGINAL >= 1800) \ + || defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1400) + #define Z7_COMPILER_AVX2_SUPPORTED + #endif +#endif +*/ + // #pragma GCC diagnostic ignored "-Wunknown-pragmas" @@ -32,2 +49,53 @@ #pragma GCC diagnostic ignored "-Wpadded" + +#if defined(Z7_LLVM_CLANG_VERSION) && (__clang_major__ == 13) \ + && defined(__FreeBSD__) +// freebsd: +#pragma GCC diagnostic ignored "-Wexcess-padding" +#endif + +#if __clang_major__ >= 16 +#pragma GCC diagnostic ignored "-Wunsafe-buffer-usage" +#endif + +#if __clang_major__ == 13 +#if defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 16) +// cheri +#pragma GCC diagnostic ignored "-Wcapability-to-integer-cast" +#endif +#endif + +#if __clang_major__ == 13 + // for <arm_neon.h> + #pragma GCC diagnostic ignored "-Wreserved-identifier" +#endif + +#endif // __clang__ + +#if defined(_WIN32) && defined(__clang__) && __clang_major__ >= 16 +// #pragma GCC diagnostic ignored "-Wcast-function-type-strict" +#define Z7_DIAGNOSTIC_IGNORE_CAST_FUNCTION \ + _Pragma("GCC diagnostic ignored \"-Wcast-function-type-strict\"") +#else +#define Z7_DIAGNOSTIC_IGNORE_CAST_FUNCTION +#endif + +typedef void (*Z7_void_Function)(void); +#if defined(__clang__) || defined(__GNUC__) +#define Z7_CAST_FUNC_C (Z7_void_Function) +#elif defined(_MSC_VER) && _MSC_VER > 1920 +#define Z7_CAST_FUNC_C (void *) +// #pragma warning(disable : 4191) // 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)()' +#else +#define Z7_CAST_FUNC_C +#endif +/* +#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) + // #pragma GCC diagnostic ignored "-Wcast-function-type" +#endif +*/ +#ifdef __GNUC__ +#if defined(Z7_GCC_VERSION) && (Z7_GCC_VERSION >= 40000) && (Z7_GCC_VERSION < 70000) +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif #endif @@ -103,3 +171,4 @@ #define Z7_ATTRIB_NO_VECTORIZE -#elif defined(__GNUC__) && (__GNUC__ >= 5) +#elif defined(__GNUC__) && (__GNUC__ >= 5) \ + && (!defined(Z7_MCST_LCC_VERSION) || (Z7_MCST_LCC_VERSION >= 12610)) #define Z7_ATTRIB_NO_VECTORIZE __attribute__((optimize("no-tree-vectorize"))) @@ -144,11 +213,19 @@ -#if (defined(Z7_CLANG_VERSION) && (Z7_CLANG_VERSION >= 36000)) -#define Z7_DIAGNOSCTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER \ +#if (defined(Z7_CLANG_VERSION) && (Z7_CLANG_VERSION >= 30600)) + +#if (Z7_CLANG_VERSION < 130000) +#define Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER \ + _Pragma("GCC diagnostic push") \ + _Pragma("GCC diagnostic ignored \"-Wreserved-id-macro\"") +#else +#define Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER \ _Pragma("GCC diagnostic push") \ _Pragma("GCC diagnostic ignored \"-Wreserved-macro-identifier\"") -#define Z7_DIAGNOSCTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER \ +#endif + +#define Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER \ _Pragma("GCC diagnostic pop") #else -#define Z7_DIAGNOSCTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER -#define Z7_DIAGNOSCTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER +#define Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER +#define Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER #endif diff --git a/src/Common/lzma/CpuArch.c b/src/Common/lzma/CpuArch.c index 33f8a3ab..6e02551e 100644 --- a/src/Common/lzma/CpuArch.c +++ b/src/Common/lzma/CpuArch.c @@ -1,3 +1,3 @@ /* CpuArch.c -- CPU specific code -2023-05-18 : Igor Pavlov : Public domain */ +Igor Pavlov : Public domain */ @@ -19,3 +19,3 @@ that is used only with some specific (function) parameter values. - But we always use only (subFunction==0). + most functions use only (subFunction==0). */ @@ -51,3 +51,7 @@ -#define x86_cpuid_MACRO(p, func) { \ + /* "=&r" selects free register. It can select even rbx, if that register is free. + "=&D" for (RDI) also works, but the code can be larger with "=&D" + "2"(subFun) : 2 is (zero-based) index in the output constraint list "=c" (ECX). */ + +#define x86_cpuid_MACRO_2(p, func, subFunc) { \ __asm__ __volatile__ ( \ @@ -56,8 +60,3 @@ ASM_LN "xchg %%rbx, %q1" \ - : "=a" ((p)[0]), "=&r" ((p)[1]), "=c" ((p)[2]), "=d" ((p)[3]) : "0" (func), "2"(0)); } - - /* "=&r" selects free register. It can select even rbx, if that register is free. - "=&D" for (RDI) also works, but the code can be larger with "=&D" - "2"(0) means (subFunction = 0), - 2 is (zero-based) index in the output constraint list "=c" (ECX). */ + : "=a" ((p)[0]), "=&r" ((p)[1]), "=c" ((p)[2]), "=d" ((p)[3]) : "0" (func), "2"(subFunc)); } @@ -66,3 +65,3 @@ -#define x86_cpuid_MACRO(p, func) { \ +#define x86_cpuid_MACRO_2(p, func, subFunc) { \ __asm__ __volatile__ ( \ @@ -71,3 +70,3 @@ ASM_LN "xchg %%ebx, %k1" \ - : "=a" ((p)[0]), "=&r" ((p)[1]), "=c" ((p)[2]), "=d" ((p)[3]) : "0" (func), "2"(0)); } + : "=a" ((p)[0]), "=&r" ((p)[1]), "=c" ((p)[2]), "=d" ((p)[3]) : "0" (func), "2"(subFunc)); } @@ -75,6 +74,6 @@ -#define x86_cpuid_MACRO(p, func) { \ +#define x86_cpuid_MACRO_2(p, func, subFunc) { \ __asm__ __volatile__ ( \ ASM_LN "cpuid" \ - : "=a" ((p)[0]), "=b" ((p)[1]), "=c" ((p)[2]), "=d" ((p)[3]) : "0" (func), "2"(0)); } + : "=a" ((p)[0]), "=b" ((p)[1]), "=c" ((p)[2]), "=d" ((p)[3]) : "0" (func), "2"(subFunc)); } @@ -82,2 +81,3 @@ +#define x86_cpuid_MACRO(p, func) x86_cpuid_MACRO_2(p, func, 0) @@ -88,2 +88,8 @@ void Z7_FASTCALL z7_x86_cpuid(UInt32 p[4], UInt32 func) +static +void Z7_FASTCALL z7_x86_cpuid_subFunc(UInt32 p[4], UInt32 func, UInt32 subFunc) +{ + x86_cpuid_MACRO_2(p, func, subFunc) +} + @@ -207,2 +213,23 @@ void __declspec(naked) Z7_FASTCALL z7_x86_cpuid(UInt32 p[4], UInt32 func) +static +void __declspec(naked) Z7_FASTCALL z7_x86_cpuid_subFunc(UInt32 p[4], UInt32 func, UInt32 subFunc) +{ + UNUSED_VAR(p) + UNUSED_VAR(func) + UNUSED_VAR(subFunc) + __asm push ebx + __asm push edi + __asm mov edi, ecx // p + __asm mov eax, edx // func + __asm mov ecx, [esp + 12] // subFunc + __asm cpuid + __asm mov [edi ], eax + __asm mov [edi + 4], ebx + __asm mov [edi + 8], ecx + __asm mov [edi + 12], edx + __asm pop edi + __asm pop ebx + __asm ret 4 +} + #else // MY_CPU_AMD64 @@ -212,2 +239,9 @@ void __declspec(naked) Z7_FASTCALL z7_x86_cpuid(UInt32 p[4], UInt32 func) #define MY_cpuidex __cpuidex + +static +void Z7_FASTCALL z7_x86_cpuid_subFunc(UInt32 p[4], UInt32 func, UInt32 subFunc) +{ + __cpuidex((int *)p, func, subFunc); +} + #else @@ -221,3 +255,3 @@ void __declspec(naked) Z7_FASTCALL z7_x86_cpuid(UInt32 p[4], UInt32 func) So here we use the hack for old MSVC to send (subFunction) in ECX register to cpuid instruction, - where ECX value is first parameter for FASTCALL / NO_INLINE func, + where ECX value is first parameter for FASTCALL / NO_INLINE func. So the caller of MY_cpuidex_HACK() sets ECX as subFunction, and @@ -228,3 +262,3 @@ DON'T remove Z7_NO_INLINE and Z7_FASTCALL for MY_cpuidex_HACK(): !!! static -Z7_NO_INLINE void Z7_FASTCALL MY_cpuidex_HACK(UInt32 subFunction, UInt32 func, int *CPUInfo) +Z7_NO_INLINE void Z7_FASTCALL MY_cpuidex_HACK(Int32 subFunction, Int32 func, Int32 *CPUInfo) { @@ -235,2 +269,7 @@ Z7_NO_INLINE void Z7_FASTCALL MY_cpuidex_HACK(UInt32 subFunction, UInt32 func, i #pragma message("======== MY_cpuidex_HACK WAS USED ========") +static +void Z7_FASTCALL z7_x86_cpuid_subFunc(UInt32 p[4], UInt32 func, UInt32 subFunc) +{ + MY_cpuidex_HACK(subFunc, func, (Int32 *)p); +} #endif // _MSC_VER >= 1600 @@ -244,3 +283,3 @@ void Z7_FASTCALL z7_x86_cpuid(UInt32 p[4], UInt32 func) { - MY_cpuidex((int *)p, (int)func, 0); + MY_cpuidex((Int32 *)p, (Int32)func, 0); } @@ -250,3 +289,3 @@ UInt32 Z7_FASTCALL z7_x86_cpuid_GetMaxFunc(void) { - int a[4]; + Int32 a[4]; MY_cpuidex(a, 0, 0); @@ -386,3 +425,3 @@ BoolInt CPU_IsSupported_CMOV(void) return 0; - return (a[3] >> 15) & 1; + return (BoolInt)(a[3] >> 15) & 1; } @@ -395,3 +434,3 @@ BoolInt CPU_IsSupported_SSE(void) return 0; - return (a[3] >> 25) & 1; + return (BoolInt)(a[3] >> 25) & 1; } @@ -404,3 +443,3 @@ BoolInt CPU_IsSupported_SSE2(void) return 0; - return (a[3] >> 26) & 1; + return (BoolInt)(a[3] >> 26) & 1; } @@ -421,3 +460,3 @@ BoolInt CPU_IsSupported_AES(void) { - return (x86cpuid_Func_1_ECX() >> 25) & 1; + return (BoolInt)(x86cpuid_Func_1_ECX() >> 25) & 1; } @@ -426,3 +465,3 @@ BoolInt CPU_IsSupported_SSSE3(void) { - return (x86cpuid_Func_1_ECX() >> 9) & 1; + return (BoolInt)(x86cpuid_Func_1_ECX() >> 9) & 1; } @@ -431,3 +470,3 @@ BoolInt CPU_IsSupported_SSE41(void) { - return (x86cpuid_Func_1_ECX() >> 19) & 1; + return (BoolInt)(x86cpuid_Func_1_ECX() >> 19) & 1; } @@ -443,3 +482,20 @@ BoolInt CPU_IsSupported_SHA(void) z7_x86_cpuid(d, 7); - return (d[1] >> 29) & 1; + return (BoolInt)(d[1] >> 29) & 1; + } +} + + +BoolInt CPU_IsSupported_SHA512(void) +{ + if (!CPU_IsSupported_AVX2()) return False; // maybe CPU_IsSupported_AVX() is enough here + + if (z7_x86_cpuid_GetMaxFunc() < 7) + return False; + { + UInt32 d[4]; + z7_x86_cpuid_subFunc(d, 7, 0); + if (d[0] < 1) // d[0] - is max supported subleaf value + return False; + z7_x86_cpuid_subFunc(d, 7, 1); + return (BoolInt)(d[0]) & 1; } @@ -640,6 +696,6 @@ BoolInt CPU_IsSupported_AVX(void) const UInt32 bm = (UInt32)x86_xgetbv_0(MY_XCR_XFEATURE_ENABLED_MASK); - // printf("\n=== XGetBV=%d\n", bm); + // printf("\n=== XGetBV=0x%x\n", bm); return 1 - & (bm >> 1) // SSE state is supported (set by OS) for storing/restoring - & (bm >> 2); // AVX state is supported (set by OS) for storing/restoring + & (BoolInt)(bm >> 1) // SSE state is supported (set by OS) for storing/restoring + & (BoolInt)(bm >> 2); // AVX state is supported (set by OS) for storing/restoring } @@ -660,5 +716,34 @@ BoolInt CPU_IsSupported_AVX2(void) return 1 - & (d[1] >> 5); // avx2 + & (BoolInt)(d[1] >> 5); // avx2 + } +} + +#if 0 +BoolInt CPU_IsSupported_AVX512F_AVX512VL(void) +{ + if (!CPU_IsSupported_AVX()) + return False; + if (z7_x86_cpuid_GetMaxFunc() < 7) + return False; + { + UInt32 d[4]; + BoolInt v; + z7_x86_cpuid(d, 7); + // printf("\ncpuid(7): ebx=%8x ecx=%8x\n", d[1], d[2]); + v = 1 + & (BoolInt)(d[1] >> 16) // avx512f + & (BoolInt)(d[1] >> 31); // avx512vl + if (!v) + return False; + } + { + const UInt32 bm = (UInt32)x86_xgetbv_0(MY_XCR_XFEATURE_ENABLED_MASK); + // printf("\n=== XGetBV=0x%x\n", bm); + return 1 + & (BoolInt)(bm >> 5) // OPMASK + & (BoolInt)(bm >> 6) // ZMM upper 256-bit + & (BoolInt)(bm >> 7); // ZMM16 ... ZMM31 } } +#endif @@ -675,5 +760,5 @@ BoolInt CPU_IsSupported_VAES_AVX2(void) return 1 - & (d[1] >> 5) // avx2 + & (BoolInt)(d[1] >> 5) // avx2 // & (d[1] >> 31) // avx512vl - & (d[2] >> 9); // vaes // VEX-256/EVEX + & (BoolInt)(d[2] >> 9); // vaes // VEX-256/EVEX } @@ -690,3 +775,3 @@ BoolInt CPU_IsSupported_PageGB(void) z7_x86_cpuid(d, 0x80000001); - return (d[3] >> 26) & 1; + return (BoolInt)(d[3] >> 26) & 1; } @@ -749,2 +834,14 @@ BoolInt CPU_IsSupported_NEON(void) +BoolInt CPU_IsSupported_SHA512(void) +{ + return z7_sysctlbyname_Get_BoolInt("hw.optional.armv8_2_sha512"); +} + +/* +BoolInt CPU_IsSupported_SHA3(void) +{ + return z7_sysctlbyname_Get_BoolInt("hw.optional.armv8_2_sha3"); +} +*/ + #ifdef MY_CPU_ARM64 @@ -762,5 +859,19 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; } -#include <sys/auxv.h> +#if defined(__GLIBC__) && (__GLIBC__ * 100 + __GLIBC_MINOR__ >= 216) + #define Z7_GETAUXV_AVAILABLE +#else +// #pragma message("=== is not NEW GLIBC === ") + #if defined __has_include + #if __has_include (<sys/auxv.h>) +// #pragma message("=== sys/auxv.h is avail=== ") + #define Z7_GETAUXV_AVAILABLE + #endif + #endif +#endif +#ifdef Z7_GETAUXV_AVAILABLE +// #pragma message("=== Z7_GETAUXV_AVAILABLE === ") +#include <sys/auxv.h> #define USE_HWCAP +#endif @@ -768,6 +879,21 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; } +#if defined(__FreeBSD__) +static unsigned long MY_getauxval(int aux) +{ + unsigned long val; + if (elf_aux_info(aux, &val, sizeof(val))) + return 0; + return val; +} +#else +#define MY_getauxval getauxval + #if defined __has_include + #if __has_include (<asm/hwcap.h>) #include <asm/hwcap.h> + #endif + #endif +#endif #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \ - BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP) & (HWCAP_ ## name2)) ? 1 : 0; } + BoolInt CPU_IsSupported_ ## name1(void) { return (MY_getauxval(AT_HWCAP) & (HWCAP_ ## name2)); } @@ -776,3 +902,7 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; } MY_HWCAP_CHECK_FUNC_2(name, name) +#if 1 || defined(__ARM_NEON) + BoolInt CPU_IsSupported_NEON(void) { return True; } +#else MY_HWCAP_CHECK_FUNC_2(NEON, ASIMD) +#endif // MY_HWCAP_CHECK_FUNC (ASIMD) @@ -780,3 +910,3 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; } #define MY_HWCAP_CHECK_FUNC(name) \ - BoolInt CPU_IsSupported_ ## name() { return (getauxval(AT_HWCAP2) & (HWCAP2_ ## name)) ? 1 : 0; } + BoolInt CPU_IsSupported_ ## name(void) { return (MY_getauxval(AT_HWCAP2) & (HWCAP2_ ## name)); } MY_HWCAP_CHECK_FUNC_2(NEON, NEON) @@ -787,4 +917,8 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYPTO_SUPPORT_VAL; } #define MY_HWCAP_CHECK_FUNC(name) \ - BoolInt CPU_IsSupported_ ## name() { return 0; } + BoolInt CPU_IsSupported_ ## name(void) { return 0; } +#if defined(__ARM_NEON) + BoolInt CPU_IsSupported_NEON(void) { return True; } +#else MY_HWCAP_CHECK_FUNC(NEON) +#endif @@ -796,2 +930,15 @@ MY_HWCAP_CHECK_FUNC (SHA2) MY_HWCAP_CHECK_FUNC (AES) +#ifdef MY_CPU_ARM64 +// <hwcap.h> supports HWCAP_SHA512 and HWCAP_SHA3 since 2017. +// we define them here, if they are not defined +#ifndef HWCAP_SHA3 +// #define HWCAP_SHA3 (1 << 17) +#endif +#ifndef HWCAP_SHA512 +// #pragma message("=== HWCAP_SHA512 define === ") +#define HWCAP_SHA512 (1 << 21) +#endif +MY_HWCAP_CHECK_FUNC (SHA512) +// MY_HWCAP_CHECK_FUNC (SHA3) +#endif diff --git a/src/Common/lzma/CpuArch.h b/src/Common/lzma/CpuArch.h index 8e5d8a54..a6297ea4 100644 --- a/src/Common/lzma/CpuArch.h +++ b/src/Common/lzma/CpuArch.h @@ -1,3 +1,3 @@ /* CpuArch.h -- CPU specific code -2023-04-02 : Igor Pavlov : Public domain */ +Igor Pavlov : Public domain */ @@ -22,2 +22,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#if !defined(_M_ARM64EC) #if defined(_M_X64) \ @@ -37,2 +38,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #endif +#endif @@ -49,2 +51,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #if defined(_M_ARM64) \ + || defined(_M_ARM64EC) \ || defined(__AARCH64EL__) \ @@ -53,9 +56,17 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #define MY_CPU_ARM64 - #ifdef __ILP32__ +#if defined(__ILP32__) \ + || defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 4) #define MY_CPU_NAME "arm64-32" #define MY_CPU_SIZEOF_POINTER 4 - #else +#elif defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 16) + #define MY_CPU_NAME "arm64-128" + #define MY_CPU_SIZEOF_POINTER 16 +#else +#if defined(_M_ARM64EC) + #define MY_CPU_NAME "arm64ec" +#else #define MY_CPU_NAME "arm64" +#endif #define MY_CPU_SIZEOF_POINTER 8 - #endif +#endif #define MY_CPU_64BIT @@ -135,4 +146,32 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#if defined(__sparc__) \ + || defined(__sparc) + #define MY_CPU_SPARC + #if defined(__LP64__) \ + || defined(_LP64) \ + || defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 8) + #define MY_CPU_NAME "sparcv9" + #define MY_CPU_SIZEOF_POINTER 8 + #define MY_CPU_64BIT + #elif defined(__sparc_v9__) \ + || defined(__sparcv9) + #define MY_CPU_64BIT + #if defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 4) + #define MY_CPU_NAME "sparcv9-32" + #else + #define MY_CPU_NAME "sparcv9m" + #endif + #elif defined(__sparc_v8__) \ + || defined(__sparcv8) + #define MY_CPU_NAME "sparcv8" + #define MY_CPU_SIZEOF_POINTER 4 + #else + #define MY_CPU_NAME "sparc" + #endif +#endif + + #if defined(__riscv) \ || defined(__riscv__) + #define MY_CPU_RISCV #if __riscv_xlen == 32 @@ -147,2 +186,35 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#if defined(__loongarch__) + #define MY_CPU_LOONGARCH + #if defined(__loongarch64) || defined(__loongarch_grlen) && (__loongarch_grlen == 64) + #define MY_CPU_64BIT + #endif + #if defined(__loongarch64) + #define MY_CPU_NAME "loongarch64" + #define MY_CPU_LOONGARCH64 + #else + #define MY_CPU_NAME "loongarch" + #endif +#endif + + +// #undef MY_CPU_NAME +// #undef MY_CPU_SIZEOF_POINTER +// #define __e2k__ +// #define __SIZEOF_POINTER__ 4 +#if defined(__e2k__) + #define MY_CPU_E2K + #if defined(__ILP32__) || defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 4) + #define MY_CPU_NAME "e2k-32" + #define MY_CPU_SIZEOF_POINTER 4 + #else + #define MY_CPU_NAME "e2k" + #if defined(__LP64__) || defined(__SIZEOF_POINTER__) && (__SIZEOF_POINTER__ == 8) + #define MY_CPU_SIZEOF_POINTER 8 + #endif + #endif + #define MY_CPU_64BIT +#endif + + #if defined(MY_CPU_X86) || defined(MY_CPU_AMD64) @@ -177,2 +249,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. || defined(MY_CPU_IA64_LE) \ + || defined(_LITTLE_ENDIAN) \ || defined(__LITTLE_ENDIAN__) \ @@ -253,2 +326,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #ifndef MY_CPU_NAME + // #define MY_CPU_IS_UNKNOWN #ifdef MY_CPU_LE @@ -297,5 +371,15 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. -#elif (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \ - || (defined(__clang__) && Z7_has_builtin(__builtin_bswap16)) - +/* GCC can generate slow code that calls function for __builtin_bswap32() for: + - GCC for RISCV, if Zbb/XTHeadBb extension is not used. + - GCC for SPARC. + The code from CLANG for SPARC also is not fastest. + So we don't define Z7_CPU_FAST_BSWAP_SUPPORTED in some cases. +*/ +#elif (!defined(MY_CPU_RISCV) || defined (__riscv_zbb) || defined(__riscv_xtheadbb)) \ + && !defined(MY_CPU_SPARC) \ + && ( \ + (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \ + || (defined(__clang__) && Z7_has_builtin(__builtin_bswap16)) \ + ) + #define Z7_BSWAP16(v) __builtin_bswap16(v) @@ -331,3 +415,5 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #if defined(MY_CPU_X86_OR_AMD64) \ - || defined(MY_CPU_ARM64) + || defined(MY_CPU_ARM64) \ + || defined(MY_CPU_RISCV) && defined(__riscv_misaligned_fast) \ + || defined(MY_CPU_E2K) && defined(__iset__) && (__iset__ >= 6) #define MY_CPU_LE_UNALIGN @@ -335,5 +421,38 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #elif defined(__ARM_FEATURE_UNALIGNED) - /* gcc9 for 32-bit arm can use LDRD instruction that requires 32-bit alignment. - So we can't use unaligned 64-bit operations. */ - #define MY_CPU_LE_UNALIGN +/* === ALIGNMENT on 32-bit arm and LDRD/STRD/LDM/STM instructions. + Description of problems: +problem-1 : 32-bit ARM architecture: + multi-access (pair of 32-bit accesses) instructions (LDRD/STRD/LDM/STM) + require 32-bit (WORD) alignment (by 32-bit ARM architecture). + So there is "Alignment fault exception", if data is not aligned for 32-bit. + +problem-2 : 32-bit kernels and arm64 kernels: + 32-bit linux kernels provide fixup for these "paired" instruction "Alignment fault exception". + So unaligned paired-access instructions work via exception handler in kernel in 32-bit linux. + + But some arm64 kernels do not handle these faults in 32-bit programs. + So we have unhandled exception for such instructions. + Probably some new arm64 kernels have fixed it, and unaligned + paired-access instructions work in new kernels? + +problem-3 : compiler for 32-bit arm: + Compilers use LDRD/STRD/LDM/STM for UInt64 accesses + and for another cases where two 32-bit accesses are fused + to one multi-access instruction. + So UInt64 variables must be aligned for 32-bit, and each + 32-bit access must be aligned for 32-bit, if we want to + avoid "Alignment fault" exception (handled or unhandled). + +problem-4 : performace: + Even if unaligned access is handled by kernel, it will be slow. + So if we allow unaligned access, we can get fast unaligned + single-access, and slow unaligned paired-access. + + We don't allow unaligned access on 32-bit arm, because compiler + genarates paired-access instructions that require 32-bit alignment, + and some arm64 kernels have no handler for these instructions. + Also unaligned paired-access instructions will be slow, if kernel handles them. +*/ + // it must be disabled: + // #define MY_CPU_LE_UNALIGN #endif @@ -392,2 +511,9 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#if 0 +// Z7_BSWAP16 can be slow for x86-msvc +#define GetBe16_to32(p) (Z7_BSWAP16 (*(const UInt16 *)(const void *)(p))) +#else +#define GetBe16_to32(p) (Z7_BSWAP32 (*(const UInt16 *)(const void *)(p)) >> 16) +#endif + #define GetBe32(p) Z7_BSWAP32 (*(const UInt32 *)(const void *)(p)) @@ -397,2 +523,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #define GetBe64(p) Z7_BSWAP64 (*(const UInt64 *)(const void *)(p)) +#define SetBe64(p, v) { (*(UInt64 *)(void *)(p)) = Z7_BSWAP64(v); } #endif @@ -419,3 +546,18 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#ifndef SetBe64 +#define SetBe64(p, v) { Byte *_ppp_ = (Byte *)(p); UInt64 _vvv_ = (v); \ + _ppp_[0] = (Byte)(_vvv_ >> 56); \ + _ppp_[1] = (Byte)(_vvv_ >> 48); \ + _ppp_[2] = (Byte)(_vvv_ >> 40); \ + _ppp_[3] = (Byte)(_vvv_ >> 32); \ + _ppp_[4] = (Byte)(_vvv_ >> 24); \ + _ppp_[5] = (Byte)(_vvv_ >> 16); \ + _ppp_[6] = (Byte)(_vvv_ >> 8); \ + _ppp_[7] = (Byte)_vvv_; } +#endif + #ifndef GetBe16 +#ifdef GetBe16_to32 +#define GetBe16(p) ( (UInt16) GetBe16_to32(p)) +#else #define GetBe16(p) ( (UInt16) ( \ @@ -424,2 +566,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. #endif +#endif @@ -441,2 +584,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#define GetBe64a(p) (*(const UInt64 *)(const void *)(p)) #define GetBe32a(p) (*(const UInt32 *)(const void *)(p)) @@ -446,2 +590,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#define GetUi64a(p) GetUi64(p) #define GetUi32a(p) GetUi32(p) @@ -453,2 +598,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#define GetUi64a(p) (*(const UInt64 *)(const void *)(p)) #define GetUi32a(p) (*(const UInt32 *)(const void *)(p)) @@ -458,2 +604,3 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#define GetBe64a(p) GetBe64(p) #define GetBe32a(p) GetBe32(p) @@ -468,2 +615,7 @@ MY_CPU_64BIT means that processor can work with 64-bit registers. +#ifndef GetBe16_to32 +#define GetBe16_to32(p) GetBe16(p) +#endif + + #if defined(MY_CPU_X86_OR_AMD64) \ @@ -488,2 +640,3 @@ BoolInt CPU_IsSupported_AVX(void); BoolInt CPU_IsSupported_AVX2(void); +BoolInt CPU_IsSupported_AVX512F_AVX512VL(void); BoolInt CPU_IsSupported_VAES_AVX2(void); @@ -495,2 +648,3 @@ BoolInt CPU_IsSupported_SSE41(void); BoolInt CPU_IsSupported_SHA(void); +BoolInt CPU_IsSupported_SHA512(void); BoolInt CPU_IsSupported_PageGB(void); @@ -512,2 +666,3 @@ BoolInt CPU_IsSupported_AES(void); #endif +BoolInt CPU_IsSupported_SHA512(void); diff --git a/src/Common/lzma/LzFind.c b/src/Common/lzma/LzFind.c index 0fbd5aae..1ce40464 100644 --- a/src/Common/lzma/LzFind.c +++ b/src/Common/lzma/LzFind.c @@ -1,3 +1,3 @@ /* LzFind.c -- Match finder for LZ algorithms -2023-03-14 : Igor Pavlov : Public domain */ +2024-03-01 : Igor Pavlov : Public domain */ @@ -110,5 +110,11 @@ static int LzInWindow_Create2(CMatchFinder *p, UInt32 blockSize, ISzAllocPtr all -static const Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } +static const Byte *MatchFinder_GetPointerToCurrentPos(void *p) +{ + return ((CMatchFinder *)p)->buffer; +} -static UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return GET_AVAIL_BYTES(p); } +static UInt32 MatchFinder_GetNumAvailableBytes(void *p) +{ + return GET_AVAIL_BYTES((CMatchFinder *)p); +} @@ -573,4 +579,5 @@ void MatchFinder_Init_4(CMatchFinder *p) -void MatchFinder_Init(CMatchFinder *p) +void MatchFinder_Init(void *_p) { + CMatchFinder *p = (CMatchFinder *)_p; MatchFinder_Init_HighHash(p); @@ -609,7 +616,7 @@ void MatchFinder_Init(CMatchFinder *p) -// #elif defined(MY_CPU_ARM_OR_ARM64) -#elif defined(MY_CPU_ARM64) +#elif defined(MY_CPU_ARM64) \ + /* || (defined(__ARM_ARCH) && (__ARM_ARCH >= 7)) */ - #if defined(__clang__) && (__clang_major__ >= 8) \ - || defined(__GNUC__) && (__GNUC__ >= 8) + #if defined(Z7_CLANG_VERSION) && (Z7_CLANG_VERSION >= 30800) \ + || defined(__GNUC__) && (__GNUC__ >= 6) #define USE_LZFIND_SATUR_SUB_128 @@ -618,3 +625,3 @@ void MatchFinder_Init(CMatchFinder *p) #else - // #define LZFIND_ATTRIB_SSE41 __attribute__((__target__("fpu=crypto-neon-fp-armv8"))) + #define LZFIND_ATTRIB_SSE41 __attribute__((__target__("fpu=neon"))) #endif @@ -627,3 +634,3 @@ void MatchFinder_Init(CMatchFinder *p) - #if defined(_MSC_VER) && defined(MY_CPU_ARM64) + #if defined(Z7_MSC_VER_ORIGINAL) && defined(MY_CPU_ARM64) #include <arm64_neon.h> @@ -1084,5 +1091,7 @@ static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const #define MOVE_POS \ - ++p->cyclicBufferPos; \ + p->cyclicBufferPos++; \ p->buffer++; \ - { const UInt32 pos1 = p->pos + 1; p->pos = pos1; if (pos1 == p->posLimit) MatchFinder_CheckLimits(p); } + { const UInt32 pos1 = p->pos + 1; \ + p->pos = pos1; \ + if (pos1 == p->posLimit) MatchFinder_CheckLimits(p); } @@ -1105,4 +1114,5 @@ static void MatchFinder_MovePos(CMatchFinder *p) #define GET_MATCHES_HEADER2(minLen, ret_op) \ - unsigned lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \ - lenLimit = (unsigned)p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ + UInt32 hv; const Byte *cur; UInt32 curMatch; \ + UInt32 lenLimit = p->lenLimit; \ + if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; } \ cur = p->buffer; @@ -1110,11 +1120,16 @@ static void MatchFinder_MovePos(CMatchFinder *p) #define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return distances) -#define SKIP_HEADER(minLen) do { GET_MATCHES_HEADER2(minLen, continue) +#define SKIP_HEADER(minLen) \ + do { GET_MATCHES_HEADER2(minLen, continue) -#define MF_PARAMS(p) lenLimit, curMatch, p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue +#define MF_PARAMS(p) lenLimit, curMatch, p->pos, p->buffer, p->son, \ + p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue -#define SKIP_FOOTER SkipMatchesSpec(MF_PARAMS(p)); MOVE_POS } while (--num); +#define SKIP_FOOTER \ + SkipMatchesSpec(MF_PARAMS(p)); \ + MOVE_POS \ + } while (--num); #define GET_MATCHES_FOOTER_BASE(_maxLen_, func) \ - distances = func(MF_PARAMS(p), \ - distances, (UInt32)_maxLen_); MOVE_POS_RET + distances = func(MF_PARAMS(p), distances, (UInt32)_maxLen_); \ + MOVE_POS_RET @@ -1135,4 +1150,5 @@ static void MatchFinder_MovePos(CMatchFinder *p) -static UInt32* Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +static UInt32* Bt2_MatchFinder_GetMatches(void *_p, UInt32 *distances) { + CMatchFinder *p = (CMatchFinder *)_p; GET_MATCHES_HEADER(2) @@ -1160,4 +1176,5 @@ UInt32* Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -static UInt32* Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +static UInt32* Bt3_MatchFinder_GetMatches(void *_p, UInt32 *distances) { + CMatchFinder *p = (CMatchFinder *)_p; UInt32 mmm; @@ -1201,4 +1218,5 @@ static UInt32* Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -static UInt32* Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +static UInt32* Bt4_MatchFinder_GetMatches(void *_p, UInt32 *distances) { + CMatchFinder *p = (CMatchFinder *)_p; UInt32 mmm; @@ -1269,6 +1287,8 @@ static UInt32* Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -static UInt32* Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +static UInt32* Bt5_MatchFinder_GetMatches(void *_p, UInt32 *distances) { + CMatchFinder *p = (CMatchFinder *)_p; UInt32 mmm; - UInt32 h2, h3, d2, d3, maxLen, pos; + UInt32 h2, h3, d2, d3, pos; + unsigned maxLen; UInt32 *hash; @@ -1341,4 +1361,5 @@ static UInt32* Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -static UInt32* Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +static UInt32* Hc4_MatchFinder_GetMatches(void *_p, UInt32 *distances) { + CMatchFinder *p = (CMatchFinder *)_p; UInt32 mmm; @@ -1409,6 +1430,8 @@ static UInt32* Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -static UInt32 * Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +static UInt32 * Hc5_MatchFinder_GetMatches(void *_p, UInt32 *distances) { + CMatchFinder *p = (CMatchFinder *)_p; UInt32 mmm; - UInt32 h2, h3, d2, d3, maxLen, pos; + UInt32 h2, h3, d2, d3, pos; + unsigned maxLen; UInt32 *hash; @@ -1468,3 +1491,3 @@ static UInt32 * Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) UPDATE_maxLen - distances[-2] = maxLen; + distances[-2] = (UInt32)maxLen; if (maxLen == lenLimit) @@ -1491,4 +1514,5 @@ UInt32* Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) -static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +static void Bt2_MatchFinder_Skip(void *_p, UInt32 num) { + CMatchFinder *p = (CMatchFinder *)_p; SKIP_HEADER(2) @@ -1513,4 +1537,5 @@ void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +static void Bt3_MatchFinder_Skip(void *_p, UInt32 num) { + CMatchFinder *p = (CMatchFinder *)_p; SKIP_HEADER(3) @@ -1528,4 +1553,5 @@ static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +static void Bt4_MatchFinder_Skip(void *_p, UInt32 num) { + CMatchFinder *p = (CMatchFinder *)_p; SKIP_HEADER(4) @@ -1544,4 +1570,5 @@ static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +static void Bt5_MatchFinder_Skip(void *_p, UInt32 num) { + CMatchFinder *p = (CMatchFinder *)_p; SKIP_HEADER(5) @@ -1591,4 +1618,5 @@ static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +static void Hc4_MatchFinder_Skip(void *_p, UInt32 num) { + CMatchFinder *p = (CMatchFinder *)_p; HC_SKIP_HEADER(4) @@ -1606,4 +1634,5 @@ static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) -static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +static void Hc5_MatchFinder_Skip(void *_p, UInt32 num) { + CMatchFinder *p = (CMatchFinder *)_p; HC_SKIP_HEADER(5) @@ -1636,5 +1665,5 @@ void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable) { - vTable->Init = (Mf_Init_Func)MatchFinder_Init; - vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; - vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; + vTable->Init = MatchFinder_Init; + vTable->GetNumAvailableBytes = MatchFinder_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = MatchFinder_GetPointerToCurrentPos; if (!p->btMode) @@ -1643,4 +1672,4 @@ void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable) { - vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; + vTable->GetMatches = Hc4_MatchFinder_GetMatches; + vTable->Skip = Hc4_MatchFinder_Skip; } @@ -1648,4 +1677,4 @@ void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable) { - vTable->GetMatches = (Mf_GetMatches_Func)Hc5_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Hc5_MatchFinder_Skip; + vTable->GetMatches = Hc5_MatchFinder_GetMatches; + vTable->Skip = Hc5_MatchFinder_Skip; } @@ -1654,4 +1683,4 @@ void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable) { - vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; + vTable->GetMatches = Bt2_MatchFinder_GetMatches; + vTable->Skip = Bt2_MatchFinder_Skip; } @@ -1659,4 +1688,4 @@ void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable) { - vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; + vTable->GetMatches = Bt3_MatchFinder_GetMatches; + vTable->Skip = Bt3_MatchFinder_Skip; } @@ -1664,4 +1693,4 @@ void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable) { - vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; + vTable->GetMatches = Bt4_MatchFinder_GetMatches; + vTable->Skip = Bt4_MatchFinder_Skip; } @@ -1669,4 +1698,4 @@ void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder2 *vTable) { - vTable->GetMatches = (Mf_GetMatches_Func)Bt5_MatchFinder_GetMatches; - vTable->Skip = (Mf_Skip_Func)Bt5_MatchFinder_Skip; + vTable->GetMatches = Bt5_MatchFinder_GetMatches; + vTable->Skip = Bt5_MatchFinder_Skip; } diff --git a/src/Common/lzma/LzFind.h b/src/Common/lzma/LzFind.h index a3f72c98..67e8a6e0 100644 --- a/src/Common/lzma/LzFind.h +++ b/src/Common/lzma/LzFind.h @@ -1,3 +1,3 @@ /* LzFind.h -- Match finder for LZ algorithms -2023-03-04 : Igor Pavlov : Public domain */ +2024-01-22 : Igor Pavlov : Public domain */ @@ -146,3 +146,4 @@ void MatchFinder_Init_HighHash(CMatchFinder *p); void MatchFinder_Init_4(CMatchFinder *p); -void MatchFinder_Init(CMatchFinder *p); +// void MatchFinder_Init(CMatchFinder *p); +void MatchFinder_Init(void *p); diff --git a/src/Common/lzma/LzFindMt.c b/src/Common/lzma/LzFindMt.c index 5253e6eb..ac9d59d0 100644 --- a/src/Common/lzma/LzFindMt.c +++ b/src/Common/lzma/LzFindMt.c @@ -1,3 +1,3 @@ /* LzFindMt.c -- multithreaded Match finder for LZ algorithms -2023-04-02 : Igor Pavlov : Public domain */ +2024-01-22 : Igor Pavlov : Public domain */ @@ -96,3 +96,3 @@ static void MtSync_Construct(CMtSync *p) -#define DEBUG_BUFFER_LOCK // define it to debug lock state +// #define DEBUG_BUFFER_LOCK // define it to debug lock state @@ -879,4 +879,5 @@ SRes MatchFinderMt_InitMt(CMatchFinderMt *p) -static void MatchFinderMt_Init(CMatchFinderMt *p) +static void MatchFinderMt_Init(void *_p) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; CMatchFinder *mf = MF(p); @@ -983,4 +984,5 @@ static UInt32 MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p) -static const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p) +static const Byte * MatchFinderMt_GetPointerToCurrentPos(void *_p) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; return p->pointerToCurPos; @@ -992,4 +994,5 @@ static const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p) -static UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p) +static UInt32 MatchFinderMt_GetNumAvailableBytes(void *_p) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; if (p->btBufPos != p->btBufPosLimit) @@ -1245,4 +1248,5 @@ static UInt32 * MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *d) -static UInt32 * MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *d) +static UInt32 * MatchFinderMt2_GetMatches(void *_p, UInt32 *d) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; const UInt32 *bt = p->btBufPos; @@ -1269,4 +1273,5 @@ static UInt32 * MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *d) -static UInt32 * MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *d) +static UInt32 * MatchFinderMt_GetMatches(void *_p, UInt32 *d) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; const UInt32 *bt = p->btBufPos; @@ -1317,4 +1322,5 @@ static UInt32 * MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *d) -static void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num) +static void MatchFinderMt0_Skip(void *_p, UInt32 num) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; SKIP_HEADER2_MT { p->btNumAvailBytes--; @@ -1323,4 +1329,5 @@ static void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num) -static void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num) +static void MatchFinderMt2_Skip(void *_p, UInt32 num) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; SKIP_HEADER_MT(2) @@ -1332,4 +1339,5 @@ static void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num) -static void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num) +static void MatchFinderMt3_Skip(void *_p, UInt32 num) { + CMatchFinderMt *p = (CMatchFinderMt *)_p; SKIP_HEADER_MT(3) @@ -1363,6 +1371,6 @@ void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable) { - vTable->Init = (Mf_Init_Func)MatchFinderMt_Init; - vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes; - vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos; - vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches; + vTable->Init = MatchFinderMt_Init; + vTable->GetNumAvailableBytes = MatchFinderMt_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = MatchFinderMt_GetPointerToCurrentPos; + vTable->GetMatches = MatchFinderMt_GetMatches; @@ -1372,5 +1380,5 @@ void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable) p->GetHeadsFunc = GetHeads2; - p->MixMatchesFunc = (Mf_Mix_Matches)NULL; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip; - vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches; + p->MixMatchesFunc = NULL; + vTable->Skip = MatchFinderMt0_Skip; + vTable->GetMatches = MatchFinderMt2_GetMatches; break; @@ -1378,4 +1386,4 @@ void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable) p->GetHeadsFunc = MF(p)->bigHash ? GetHeads3b : GetHeads3; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip; + p->MixMatchesFunc = MixMatches2; + vTable->Skip = MatchFinderMt2_Skip; break; @@ -1385,6 +1393,6 @@ void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable) // it's fast inline version of GetMatches() - // vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches_Bt4; + // vTable->GetMatches = MatchFinderMt_GetMatches_Bt4; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip; + p->MixMatchesFunc = MixMatches3; + vTable->Skip = MatchFinderMt3_Skip; break; @@ -1392,6 +1400,6 @@ void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder2 *vTable) p->GetHeadsFunc = MF(p)->bigHash ? GetHeads5b : GetHeads5; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4; + p->MixMatchesFunc = MixMatches4; vTable->Skip = - (Mf_Skip_Func)MatchFinderMt3_Skip; - // (Mf_Skip_Func)MatchFinderMt4_Skip; + MatchFinderMt3_Skip; + // MatchFinderMt4_Skip; break; diff --git a/src/Common/lzma/LzFindMt.h b/src/Common/lzma/LzFindMt.h index db5923ea..fcb479da 100644 --- a/src/Common/lzma/LzFindMt.h +++ b/src/Common/lzma/LzFindMt.h @@ -1,3 +1,3 @@ /* LzFindMt.h -- multithreaded Match finder for LZ algorithms -2023-03-05 : Igor Pavlov : Public domain */ +2024-01-22 : Igor Pavlov : Public domain */ @@ -33,3 +33,6 @@ typedef struct -typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances); + +struct CMatchFinderMt_; + +typedef UInt32 * (*Mf_Mix_Matches)(struct CMatchFinderMt_ *p, UInt32 matchMinPos, UInt32 *distances); @@ -41,3 +44,3 @@ typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos, -typedef struct +typedef struct CMatchFinderMt_ { diff --git a/src/Common/lzma/LzmaEnc.c b/src/Common/lzma/LzmaEnc.c index 6d13cac8..088b78f8 100644 --- a/src/Common/lzma/LzmaEnc.c +++ b/src/Common/lzma/LzmaEnc.c @@ -1,3 +1,3 @@ /* LzmaEnc.c -- LZMA Encoder -2023-04-13: Igor Pavlov : Public domain */ +Igor Pavlov : Public domain */ @@ -74,7 +74,7 @@ void LzmaEncProps_Normalize(CLzmaEncProps *p) if (p->dictSize == 0) - p->dictSize = - ( level <= 3 ? ((UInt32)1 << (level * 2 + 16)) : - ( level <= 6 ? ((UInt32)1 << (level + 19)) : - ( level <= 7 ? ((UInt32)1 << 25) : ((UInt32)1 << 26) - ))); + p->dictSize = (unsigned)level <= 4 ? + (UInt32)1 << (level * 2 + 16) : + (unsigned)level <= sizeof(size_t) / 2 + 4 ? + (UInt32)1 << (level + 20) : + (UInt32)1 << (sizeof(size_t) / 2 + 24); @@ -94,4 +94,4 @@ void LzmaEncProps_Normalize(CLzmaEncProps *p) - if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); - if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); + if (p->algo < 0) p->algo = (unsigned)level < 5 ? 0 : 1; + if (p->fb < 0) p->fb = (unsigned)level < 7 ? 32 : 64; if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); @@ -197,7 +197,7 @@ unsigned GetPosSlot1(UInt32 pos) unsigned res; - BSR2_RET(pos, res); + BSR2_RET(pos, res) return res; } -#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } -#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res) } +#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res) } @@ -514,3 +514,3 @@ struct CLzmaEnc (d)->repLenProbs = (s)->repLenProbs; \ - memcpy((d)->litProbs, (s)->litProbs, ((UInt32)0x300 << (p)->lclp) * sizeof(CLzmaProb)); + memcpy((d)->litProbs, (s)->litProbs, ((size_t)0x300 * sizeof(CLzmaProb)) << (p)->lclp); @@ -1042,3 +1042,3 @@ Z7_NO_INLINE static void Z7_FASTCALL LenPriceEnc_UpdateTables( { - unsigned bit = sym & 1; + const unsigned bit = sym & 1; sym >>= 1; @@ -1049,3 +1049,3 @@ Z7_NO_INLINE static void Z7_FASTCALL LenPriceEnc_UpdateTables( { - unsigned prob = probs[(size_t)i + (1 << (kLenNumHighBits - 1))]; + const unsigned prob = probs[(size_t)i + (1 << (kLenNumHighBits - 1))]; prices[(size_t)i * 2 ] = price + GET_PRICEa_0(prob); @@ -1058,3 +1058,3 @@ Z7_NO_INLINE static void Z7_FASTCALL LenPriceEnc_UpdateTables( unsigned posState; - size_t num = (p->tableSize - kLenNumLowSymbols * 2) * sizeof(p->prices[0][0]); + const size_t num = (p->tableSize - kLenNumLowSymbols * 2) * sizeof(p->prices[0][0]); for (posState = 1; posState < numPosStates; posState++) @@ -2698,3 +2698,3 @@ static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, { - unsigned lclp = p->lc + p->lp; + const unsigned lclp = p->lc + p->lp; if (!p->litProbs || !p->saveState.litProbs || p->lclp != lclp) @@ -2702,4 +2702,4 @@ static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, LzmaEnc_FreeLits(p, alloc); - p->litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb)); - p->saveState.litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb)); + p->litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((size_t)0x300 * sizeof(CLzmaProb)) << lclp); + p->saveState.litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((size_t)0x300 * sizeof(CLzmaProb)) << lclp); if (!p->litProbs || !p->saveState.litProbs) @@ -2804,4 +2804,4 @@ static void LzmaEnc_Init(CLzmaEnc *p) { - UInt32 num = (UInt32)0x300 << (p->lp + p->lc); - UInt32 k; + const size_t num = (size_t)0x300 << (p->lp + p->lc); + size_t k; CLzmaProb *probs = p->litProbs; diff --git a/src/Common/lzma/Precomp.h b/src/Common/lzma/Precomp.h index 69afb2ff..7747fdd7 100644 --- a/src/Common/lzma/Precomp.h +++ b/src/Common/lzma/Precomp.h @@ -1,3 +1,3 @@ -/* Precomp.h -- StdAfx -2023-04-02 : Igor Pavlov : Public domain */ +/* Precomp.h -- precompilation file +2024-01-25 : Igor Pavlov : Public domain */ @@ -6,4 +6,121 @@ +/* + this file must be included before another *.h files and before <windows.h>. + this file is included from the following files: + C\*.c + C\Util\*\Precomp.h <- C\Util\*\*.c + CPP\Common\Common.h <- *\StdAfx.h <- *\*.cpp + + this file can set the following macros: + Z7_LARGE_PAGES 1 + Z7_LONG_PATH 1 + Z7_WIN32_WINNT_MIN 0x0500 (or higher) : we require at least win2000+ for 7-Zip + _WIN32_WINNT 0x0500 (or higher) + WINVER _WIN32_WINNT + UNICODE 1 + _UNICODE 1 +*/ + #include "Compiler.h" -/* #include "7zTypes.h" */ + +#ifdef _MSC_VER +// #pragma warning(disable : 4206) // nonstandard extension used : translation unit is empty +#if _MSC_VER >= 1912 +// #pragma warning(disable : 5039) // pointer or reference to potentially throwing function passed to 'extern "C"' function under - EHc.Undefined behavior may occur if this function throws an exception. +#endif +#endif + +/* +// for debug: +#define UNICODE 1 +#define _UNICODE 1 +#define _WIN32_WINNT 0x0500 // win2000 +#ifndef WINVER + #define WINVER _WIN32_WINNT +#endif +*/ + +#ifdef _WIN32 +/* + this "Precomp.h" file must be included before <windows.h>, + if we want to define _WIN32_WINNT before <windows.h>. +*/ + +#ifndef Z7_LARGE_PAGES +#ifndef Z7_NO_LARGE_PAGES +#define Z7_LARGE_PAGES 1 +#endif +#endif + +#ifndef Z7_LONG_PATH +#ifndef Z7_NO_LONG_PATH +#define Z7_LONG_PATH 1 +#endif +#endif + +#ifndef Z7_DEVICE_FILE +#ifndef Z7_NO_DEVICE_FILE +// #define Z7_DEVICE_FILE 1 +#endif +#endif + +// we don't change macros if included after <windows.h> +#ifndef _WINDOWS_ + +#ifndef Z7_WIN32_WINNT_MIN + #if defined(_M_ARM64) || defined(__aarch64__) + // #define Z7_WIN32_WINNT_MIN 0x0a00 // win10 + #define Z7_WIN32_WINNT_MIN 0x0600 // vista + #elif defined(_M_ARM) && defined(_M_ARMT) && defined(_M_ARM_NT) + // #define Z7_WIN32_WINNT_MIN 0x0602 // win8 + #define Z7_WIN32_WINNT_MIN 0x0600 // vista + #elif defined(_M_X64) || defined(_M_AMD64) || defined(__x86_64__) || defined(_M_IA64) + #define Z7_WIN32_WINNT_MIN 0x0503 // win2003 + // #elif defined(_M_IX86) || defined(__i386__) + // #define Z7_WIN32_WINNT_MIN 0x0500 // win2000 + #else // x86 and another(old) systems + #define Z7_WIN32_WINNT_MIN 0x0500 // win2000 + // #define Z7_WIN32_WINNT_MIN 0x0502 // win2003 // for debug + #endif +#endif // Z7_WIN32_WINNT_MIN + + +#ifndef Z7_DO_NOT_DEFINE_WIN32_WINNT +#ifdef _WIN32_WINNT + // #error Stop_Compiling_Bad_WIN32_WINNT +#else + #ifndef Z7_NO_DEFINE_WIN32_WINNT +Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER + #define _WIN32_WINNT Z7_WIN32_WINNT_MIN +Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER + #endif +#endif // _WIN32_WINNT + +#ifndef WINVER + #define WINVER _WIN32_WINNT +#endif +#endif // Z7_DO_NOT_DEFINE_WIN32_WINNT + + +#ifndef _MBCS +#ifndef Z7_NO_UNICODE +// UNICODE and _UNICODE are used by <windows.h> and by 7-zip code. + +#ifndef UNICODE +#define UNICODE 1 +#endif + +#ifndef _UNICODE +Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER +#define _UNICODE 1 +Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER +#endif + +#endif // Z7_NO_UNICODE +#endif // _MBCS +#endif // _WINDOWS_ + +// #include "7zWindows.h" + +#endif // _WIN32 diff --git a/src/Common/lzma/Threads.c b/src/Common/lzma/Threads.c index cf52bd30..464efeca 100644 --- a/src/Common/lzma/Threads.c +++ b/src/Common/lzma/Threads.c @@ -1,3 +1,3 @@ /* Threads.c -- multithreading library -2023-03-04 : Igor Pavlov : Public domain */ +2024-03-28 : Igor Pavlov : Public domain */ @@ -197,3 +197,3 @@ WRes CriticalSection_Init(CCriticalSection *p) -#ifndef __APPLE__ +#if defined(__linux__) && !defined(__APPLE__) && !defined(_AIX) && !defined(__ANDROID__) #ifndef Z7_AFFINITY_DISABLE @@ -204,9 +204,8 @@ WRes CriticalSection_Init(CCriticalSection *p) #if !defined(_GNU_SOURCE) - #if defined(__clang__) && (__clang_major__ >= 4) && (__clang_major__ <= 12) - #pragma GCC diagnostic ignored "-Wreserved-id-macro" - #endif -#define _GNU_SOURCE +Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER +// #define _GNU_SOURCE +Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER #endif // !defined(_GNU_SOURCE) #endif // Z7_AFFINITY_DISABLE -#endif // __APPLE__ +#endif // __linux__ @@ -246,4 +245,5 @@ WRes Thread_Create_With_CpuSet(CThread *p, THREAD_FUNC_TYPE func, LPVOID param, { - #ifdef Z7_AFFINITY_SUPPORTED - + // pthread_attr_setaffinity_np() is not supported for MUSL compile. + // so we check for __GLIBC__ here +#if defined(Z7_AFFINITY_SUPPORTED) && defined( __GLIBC__) /* @@ -269,3 +269,3 @@ WRes Thread_Create_With_CpuSet(CThread *p, THREAD_FUNC_TYPE func, LPVOID param, // if (ret2) ret = ret2; - #endif +#endif } @@ -371,2 +371,7 @@ WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) +#if defined(Z7_LLVM_CLANG_VERSION) && (__clang_major__ == 13) +// freebsd: +#pragma GCC diagnostic ignored "-Wthread-safety-analysis" +#endif + WRes Event_Set(CEvent *p) @@ -375,5 +380,7 @@ WRes Event_Set(CEvent *p) p->_state = True; - int res1 = pthread_cond_broadcast(&p->_cond); - int res2 = pthread_mutex_unlock(&p->_mutex); - return (res2 ? res2 : res1); + { + const int res1 = pthread_cond_broadcast(&p->_cond); + const int res2 = pthread_mutex_unlock(&p->_mutex); + return (res2 ? res2 : res1); + } } @@ -410,4 +417,4 @@ WRes Event_Close(CEvent *p) { - int res1 = pthread_mutex_destroy(&p->_mutex); - int res2 = pthread_cond_destroy(&p->_cond); + const int res1 = pthread_mutex_destroy(&p->_mutex); + const int res2 = pthread_cond_destroy(&p->_cond); return (res1 ? res1 : res2); @@ -489,4 +496,4 @@ WRes Semaphore_Close(CSemaphore *p) { - int res1 = pthread_mutex_destroy(&p->_mutex); - int res2 = pthread_cond_destroy(&p->_cond); + const int res1 = pthread_mutex_destroy(&p->_mutex); + const int res2 = pthread_cond_destroy(&p->_cond); return (res1 ? res1 : res2); @@ -551,2 +558,14 @@ LONG InterlockedIncrement(LONG volatile *addend) +LONG InterlockedDecrement(LONG volatile *addend) +{ + // Print("InterlockedDecrement") + #ifdef USE_HACK_UNSAFE_ATOMIC + LONG val = *addend - 1; + *addend = val; + return val; + #else + return __sync_sub_and_fetch(addend, 1); + #endif +} + #endif // _WIN32 diff --git a/src/Common/lzma/Threads.h b/src/Common/lzma/Threads.h index 4028464a..c1484a27 100644 --- a/src/Common/lzma/Threads.h +++ b/src/Common/lzma/Threads.h @@ -1,3 +1,3 @@ /* Threads.h -- multithreading library -2023-04-02 : Igor Pavlov : Public domain */ +2024-03-28 : Igor Pavlov : Public domain */ @@ -11,2 +11,5 @@ +#include "Compiler.h" + +// #define Z7_AFFINITY_DISABLE #if defined(__linux__) @@ -16,3 +19,9 @@ // #pragma message(" ==== Z7_AFFINITY_SUPPORTED") -// #define _GNU_SOURCE +#if !defined(_GNU_SOURCE) +// #pragma message(" ==== _GNU_SOURCE set") +// we need _GNU_SOURCE for cpu_set_t, if we compile for MUSL +Z7_DIAGNOSTIC_IGNORE_BEGIN_RESERVED_MACRO_IDENTIFIER +#define _GNU_SOURCE +Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER +#endif #endif @@ -175,3 +184,3 @@ WRes CriticalSection_Init(CCriticalSection *p); -typedef struct _CEvent +typedef struct { @@ -201,3 +210,3 @@ WRes Event_Close(CEvent *p); -typedef struct _CSemaphore +typedef struct { @@ -221,3 +230,3 @@ WRes Semaphore_Close(CSemaphore *p); -typedef struct _CCriticalSection +typedef struct { @@ -232,2 +241,3 @@ void CriticalSection_Leave(CCriticalSection *cs); LONG InterlockedIncrement(LONG volatile *addend); +LONG InterlockedDecrement(LONG volatile *addend); diff --git a/src/Common/lzma/lzma-history.txt b/src/Common/lzma/lzma-history.txt index a151c4b9..20e0a441 100644 --- a/src/Common/lzma/lzma-history.txt +++ b/src/Common/lzma/lzma-history.txt @@ -3,2 +3,76 @@ HISTORY of the LZMA SDK +24.09 2024-11-29 +------------------------- +- The default dictionary size values for LZMA/LZMA2 compression methods were increased: + dictionary size compression level + v24.08 v24.09 v24.09 + 32-bit 64-bit + 8 MB 16 MB 16 MB -mx4 + 16 MB 32 MB 32 MB -mx5 : Normal + 32 MB 64 MB 64 MB -mx6 + 32 MB 64 MB 128 MB -mx7 : Maximum + 64 MB 64 MB 256 MB -mx8 + 64 MB 64 MB 256 MB -mx9 : Ultra + The default dictionary size values for 32-bit versions of LZMA/LZMA2 don't exceed 64 MB. +- If an archive update operation uses a temporary archive folder and + the archive is moved to the destination folder, 7-Zip shows the progress of moving + the archive file, as this operation can take a long time if the archive is large. +- Some bugs were fixed. + + +24.07 2024-06-19 +------------------------- +- Changes in files: + Asm/x86/Sha256Opt.asm + Now it uses "READONLY" flag for constant array segment. + It fixes an issue where ".rodata" section in 7-Zip for x86/x64 Linux had a "WRITE" attribute. + + +24.05 2024-05-14 +------------------------- +- New switch -myv={MMNN} to set decoder compatibility version for 7z archive creating. + {MMNN} is 4-digit number that represents the version of 7-Zip without a dot. + If -myv={MMNN} switch is specified, 7-Zip will only use compression methods that can + be decoded by the specified version {MMNN} of 7-Zip and newer versions. + If -myv={MMNN} switch is not specified, -myv=2300 is used, and 7-Zip will only + use compression methods that can be decoded by 7-Zip 23.00 and newer versions. +- New switch -myfa={FilterID} to allow 7-Zip to use the specified filter method for 7z archive creating. +- New switch -myfd={FilterID} to disallow 7-Zip to use the specified filter method for 7z archive creating. + + +24.03 2024-03-23 +------------------------- +- 7-Zip now can use new RISCV filter for compression to 7z and xz archives. + RISCV filter can increase compression ratio for data containing executable + files compiled for RISC-V architecture. +- The speed for LZMA and LZMA2 decompression in ARM64 version for Windows + was increased by 20%-60%. + It uses arm64 assembler code, and clang-cl is required for arm64 assembler code compiling. +- -slmu switch : to show timestamps as UTC instead of LOCAL TIME. +- -slsl switch : in console 7-Zip for Windows : to show file paths with + linux path separator slash '/' instead of backslash separator '\'. +- 7-Zip supports .sha256 files that use backslash path separator '\'. +- Some bugs were fixed. + + +24.01 2024-01-31 +------------------------- +- 7-Zip uses file C/Precomp.h that is included to all c and c++ files. + CPP/Common/Common.h also includes C/Precomp.h. + C/Precomp.h defines the following macros (if _WIN32 is defined): + Z7_LARGE_PAGES 1 + Z7_LONG_PATH 1 + Z7_WIN32_WINNT_MIN 0x0500 (or higher) + _WIN32_WINNT 0x0500 (or higher) + WINVER _WIN32_WINNT + UNICODE 1 + _UNICODE 1 + if _WIN32_WINNT is defined already, C/Precomp.h doesn't redefine it. + +- Speed optimizations for hash caclulation: CRC-32, CRC-64. +- The bug was fixed: 7-Zip for Linux could fail for multivolume creation in some cases. +- 7zr.exe for arm64 is included to LZMA SDK package. +- Some bugs were fixed. + + 23.01 2023-06-20 diff --git a/src/Common/lzma/lzma-sdk.txt b/src/Common/lzma/lzma-sdk.txt index 141b0fd4..f7016709 100644 --- a/src/Common/lzma/lzma-sdk.txt +++ b/src/Common/lzma/lzma-sdk.txt @@ -1,2 +1,2 @@ -LZMA SDK 23.01 +LZMA SDK 24.09 -------------- @@ -139,5 +139,8 @@ bin/installer/ - example script to create installer that uses SFX module, -bin/7zdec.exe - simplified 7z archive decoder -bin/7zr.exe - 7-Zip console program (reduced version) +bin/7zdec.exe - simplified 7z archive decoder (x86 32-bit version) +bin/7zr.exe - 7-Zip console program (reduced version) (x86 32-bit version) bin/x64/7zr.exe - 7-Zip console program (reduced version) (x64 version) +bin/x64/7zdec.exe - simplified 7z archive decoder (x64 version) +bin/arm64/7zr.exe - 7-Zip console program (reduced version) (arm64 version) +bin/arm64/7zdec.exe - simplified 7z archive decoder (arm64 version) bin/lzma.exe - file->file LZMA encoder/decoder for Windows @@ -237,3 +240,3 @@ LZMA features ------------- - - Variable dictionary size (up to 1 GB) + - Variable dictionary size (up to 4 GB) - Estimated compressing speed: about 2 MB/s on 2 GHz CPU @@ -287,4 +290,4 @@ Usage: LZMA <e|d> inputFile outputFile [<switches>...] - d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB) - The maximum value for dictionary size is 1 GB = 2^30 bytes. + d{N}: Sets Dictionary size - [0, 31], default: N=24 (32 MB) + The maximum value for dictionary size is N=31 (2 GB). Dictionary size is calculated as DictionarySize = 2^N bytes. @@ -323,3 +326,5 @@ Usage: LZMA <e|d> inputFile outputFile [<switches>...] bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing. + bt5 d * 11.5 + 4MB Binary Tree with 5 bytes hashing. hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing. + hc5 d * 7.5 + 4MB Hash Chain with 5 bytes hashing. diff --git a/src/Core/Core.h b/src/Core/Core.h index b9e53021..b2573cd4 100644 --- a/src/Core/Core.h +++ b/src/Core/Core.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/CoreBase.cpp b/src/Core/CoreBase.cpp index 0c6d5c9e..d2dbd6d7 100644 --- a/src/Core/CoreBase.cpp +++ b/src/Core/CoreBase.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -25,2 +25,5 @@ namespace VeraCrypt #endif +#if defined(TC_UNIX) + ,AllowInsecureMount (false) +#endif { diff --git a/src/Core/CoreBase.h b/src/Core/CoreBase.h index e646fce3..e4ff0a94 100644 --- a/src/Core/CoreBase.h +++ b/src/Core/CoreBase.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -79,7 +79,15 @@ namespace VeraCrypt virtual void WipePasswordCache () const = 0; -#if defined(TC_LINUX ) || defined (TC_FREEBSD) virtual void ForceUseDummySudoPassword (bool useDummySudoPassword) { UseDummySudoPassword = useDummySudoPassword;} virtual bool GetUseDummySudoPassword () const { return UseDummySudoPassword;} + +#if defined(TC_UNIX) + virtual bool IsProtectedSystemDirectory (const DirectoryPath &directory) const = 0; + virtual bool IsDirectoryOnUserPath(const DirectoryPath &directory) const = 0; + virtual void SetAllowInsecureMount (bool allowInsecureMount) { AllowInsecureMount = allowInsecureMount; } + virtual bool GetAllowInsecureMount () const { return AllowInsecureMount; } #endif + virtual void SetUserEnvPATH (const string &path) { UserEnvPATH = path; } + virtual string GetUserEnvPATH () const { return UserEnvPATH; } + Event VolumeDismountedEvent; @@ -93,4 +101,7 @@ namespace VeraCrypt FilePath ApplicationExecutablePath; -#if defined(TC_LINUX ) || defined (TC_FREEBSD) + string UserEnvPATH; bool UseDummySudoPassword; + +#if defined(TC_UNIX) + bool AllowInsecureMount; #endif diff --git a/src/Core/CoreException.cpp b/src/Core/CoreException.cpp index 9284d714..a8123917 100644 --- a/src/Core/CoreException.cpp +++ b/src/Core/CoreException.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/CoreException.h b/src/Core/CoreException.h index 8eab1b8e..b2e6b0a1 100644 --- a/src/Core/CoreException.h +++ b/src/Core/CoreException.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/FatFormatter.cpp b/src/Core/FatFormatter.cpp index c8115f9b..0d29c33d 100644 --- a/src/Core/FatFormatter.cpp +++ b/src/Core/FatFormatter.cpp @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/FatFormatter.h b/src/Core/FatFormatter.h index 17f4dd39..1a7de26d 100644 --- a/src/Core/FatFormatter.h +++ b/src/Core/FatFormatter.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/HostDevice.cpp b/src/Core/HostDevice.cpp index f48d84d7..4b9f8f2f 100644 --- a/src/Core/HostDevice.cpp +++ b/src/Core/HostDevice.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/HostDevice.h b/src/Core/HostDevice.h index 48adf32a..93779281 100644 --- a/src/Core/HostDevice.h +++ b/src/Core/HostDevice.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/MountOptions.cpp b/src/Core/MountOptions.cpp index 2f28c089..6228d3cf 100644 --- a/src/Core/MountOptions.cpp +++ b/src/Core/MountOptions.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/MountOptions.h b/src/Core/MountOptions.h index 3dcfa599..449ccbae 100644 --- a/src/Core/MountOptions.h +++ b/src/Core/MountOptions.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/RandomNumberGenerator.cpp b/src/Core/RandomNumberGenerator.cpp index b60b4eed..781d951e 100644 --- a/src/Core/RandomNumberGenerator.cpp +++ b/src/Core/RandomNumberGenerator.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/RandomNumberGenerator.h b/src/Core/RandomNumberGenerator.h index 333a8e36..5fd769a7 100644 --- a/src/Core/RandomNumberGenerator.h +++ b/src/Core/RandomNumberGenerator.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/CoreService.cpp b/src/Core/Unix/CoreService.cpp index 6d0f05e5..dc2f4e6b 100644 --- a/src/Core/Unix/CoreService.cpp +++ b/src/Core/Unix/CoreService.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -101,2 +101,7 @@ namespace VeraCrypt + // Update Core properties based on the received request + Core->SetUserEnvPATH (request->UserEnvPATH); + Core->ForceUseDummySudoPassword(request->UseDummySudoPassword); + Core->SetAllowInsecureMount(request->AllowInsecureMount); + try @@ -285,2 +290,8 @@ namespace VeraCrypt + // Copy Core properties to the request so that they can be transferred to the elevated process + request.ApplicationExecutablePath = Core->GetApplicationExecutablePath(); + request.UserEnvPATH = Core->GetUserEnvPATH(); + request.UseDummySudoPassword = Core->GetUseDummySudoPassword(); + request.AllowInsecureMount = Core->GetAllowInsecureMount(); + if (request.RequiresElevation()) @@ -289,4 +300,3 @@ namespace VeraCrypt request.FastElevation = !ElevatedServiceAvailable; - request.ApplicationExecutablePath = Core->GetApplicationExecutablePath(); - + while (!ElevatedServiceAvailable) @@ -294,37 +304,34 @@ namespace VeraCrypt // Test if the user has an active "sudo" session. - // This is only done under Linux / FreeBSD by executing the command 'sudo -n uptime'. - // In case a "sudo" session is active, the result of the command contains the string 'load average'. - // Otherwise, the result contains "sudo: a password is required". - // This may not work on all OSX versions because of a bug in sudo in its version 1.7.10, - // therefore we keep the old behaviour of sending a 'dummy' password under OSX. - // See : https://superuser.com/questions/902826/why-does-sudo-n-on-mac-os-x-always-return-0 - // - // If for some reason we are getting empty output from pipe, we revert to old behavior - // We also use the old way if the user is forcing the use of dummy password for sudo - -#if defined(TC_LINUX ) || defined (TC_FREEBSD) bool authCheckDone = false; if (!Core->GetUseDummySudoPassword ()) - { - std::vector<char> buffer(128, 0); - std::string result; - - FILE* pipe = popen("sudo -n uptime 2>&1 | grep 'load average' | wc -l | tr -d '[:blank:]'", "r"); // We redirect stderr to stdout (2>&1) to be able to catch the result of the command + { + // We are using -n to avoid prompting the user for a password. + // We are redirecting stderr to stdout and discarding both to avoid any output. + // This approach also works on newer macOS versions (12.0 and later). + std::string errorMsg; + + string sudoAbsolutePath = Process::FindSystemBinary("sudo", errorMsg); + if (sudoAbsolutePath.empty()) + throw SystemException(SRC_POS, errorMsg); + + std::string popenCommand = sudoAbsolutePath + " -n true > /dev/null 2>&1"; // We redirect stderr to stdout (2>&1) to be able to catch the result of the command + FILE* pipe = popen(popenCommand.c_str(), "r"); if (pipe) { - while (!feof(pipe)) - { - if (fgets(buffer.data(), 128, pipe) != nullptr) - result += buffer.data(); - } - - fflush(pipe); - pclose(pipe); + // We only care about the exit code + char buf[128]; + while (!feof(pipe)) + { + if (fgets(buf, sizeof(buf), pipe) == NULL) + break; + } + int status = pclose(pipe); pipe = NULL; - if (!result.empty() && strlen(result.c_str()) != 0) - { - authCheckDone = true; - if (result[0] == '0') // no line found with "load average" text, rerquest admin password - (*AdminPasswordCallback) (request.AdminPassword); + authCheckDone = true; + + // If exit code != 0, user does NOT have an active session => request password + if (status != 0) + { + (*AdminPasswordCallback)(request.AdminPassword); } @@ -338,3 +345,3 @@ namespace VeraCrypt } -#endif + try @@ -355,5 +362,4 @@ namespace VeraCrypt request.FastElevation = false; -#if defined(TC_LINUX ) || defined (TC_FREEBSD) + if(!authCheckDone) -#endif (*AdminPasswordCallback) (request.AdminPassword); @@ -407,2 +413,17 @@ namespace VeraCrypt { + // Throw exception if sudo is not found in secure locations + std::string errorMsg; + string sudoPath = Process::FindSystemBinary("sudo", errorMsg); + if (sudoPath.empty()) + throw SystemException(SRC_POS, errorMsg); + + string appPath = request.ApplicationExecutablePath; + // if appPath is empty or not absolute, use FindSystemBinary to get the full path of veracrpyt executable + if (appPath.empty() || appPath[0] != '/') + { + appPath = Process::FindSystemBinary("veracrypt", errorMsg); + if (appPath.empty()) + throw SystemException(SRC_POS, errorMsg); + } + throw_sys_if (dup2 (inPipe->GetReadFD(), STDIN_FILENO) == -1); @@ -411,7 +432,3 @@ namespace VeraCrypt - string appPath = request.ApplicationExecutablePath; - if (appPath.empty()) - appPath = "veracrypt"; - - const char *args[] = { "sudo", "-S", "-p", "", appPath.c_str(), TC_CORE_SERVICE_CMDLINE_OPTION, nullptr }; + const char *args[] = { sudoPath.c_str(), "-S", "-p", "", appPath.c_str(), TC_CORE_SERVICE_CMDLINE_OPTION, nullptr }; execvp (args[0], ((char* const*) args)); diff --git a/src/Core/Unix/CoreService.h b/src/Core/Unix/CoreService.h index dfb8b350..5c43f0ed 100644 --- a/src/Core/Unix/CoreService.h +++ b/src/Core/Unix/CoreService.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/CoreServiceProxy.h b/src/Core/Unix/CoreServiceProxy.h index d57d8163..896df3e6 100644 --- a/src/Core/Unix/CoreServiceProxy.h +++ b/src/Core/Unix/CoreServiceProxy.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/CoreServiceRequest.cpp b/src/Core/Unix/CoreServiceRequest.cpp index 98101ba4..14e2ec28 100644 --- a/src/Core/Unix/CoreServiceRequest.cpp +++ b/src/Core/Unix/CoreServiceRequest.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -25,2 +25,5 @@ namespace VeraCrypt sr.Deserialize ("FastElevation", FastElevation); + sr.Deserialize ("UserEnvPATH", UserEnvPATH); + sr.Deserialize ("UseDummySudoPassword", UseDummySudoPassword); + sr.Deserialize ("AllowInsecureMount", AllowInsecureMount); } @@ -35,2 +38,5 @@ namespace VeraCrypt sr.Serialize ("FastElevation", FastElevation); + sr.Serialize ("UserEnvPATH", UserEnvPATH); + sr.Serialize ("UseDummySudoPassword", UseDummySudoPassword); + sr.Serialize ("AllowInsecureMount", AllowInsecureMount); } diff --git a/src/Core/Unix/CoreServiceRequest.h b/src/Core/Unix/CoreServiceRequest.h index 5b12cc11..77778ca2 100644 --- a/src/Core/Unix/CoreServiceRequest.h +++ b/src/Core/Unix/CoreServiceRequest.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -22,3 +22,3 @@ namespace VeraCrypt { - CoreServiceRequest () : ElevateUserPrivileges (false), FastElevation (false) { } + CoreServiceRequest () : ElevateUserPrivileges (false), FastElevation (false), UseDummySudoPassword (false), AllowInsecureMount (false) { } TC_SERIALIZABLE (CoreServiceRequest); @@ -31,2 +31,5 @@ namespace VeraCrypt bool FastElevation; + string UserEnvPATH; + bool UseDummySudoPassword; + bool AllowInsecureMount; }; diff --git a/src/Core/Unix/CoreServiceResponse.cpp b/src/Core/Unix/CoreServiceResponse.cpp index b53b8a30..1eb0af3f 100644 --- a/src/Core/Unix/CoreServiceResponse.cpp +++ b/src/Core/Unix/CoreServiceResponse.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/CoreServiceResponse.h b/src/Core/Unix/CoreServiceResponse.h index 1f4c675e..91a2483b 100644 --- a/src/Core/Unix/CoreServiceResponse.h +++ b/src/Core/Unix/CoreServiceResponse.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/CoreUnix.cpp b/src/Core/Unix/CoreUnix.cpp index 1868eb6d..1f2d3125 100644 --- a/src/Core/Unix/CoreUnix.cpp +++ b/src/Core/Unix/CoreUnix.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -31,2 +31,37 @@ namespace VeraCrypt + // Struct to hold terminal emulator information + struct TerminalInfo { + const char* name; + const char** args; + const char** dependency_path; + }; + + // Popular terminal emulators data and arguments + static const char* xterm_args[] = {"-T", "fsck", "-e", NULL}; + + static const char* gnome_args[] = {"--title", "fsck", "--", "sh", "-c", NULL}; + static const char* gnome_deps[] = {"dbus-launch", NULL}; + + static const char* konsole_args[] = {"--hold", "-p", "tabtitle=fsck", "-e", "sh", "-c", NULL}; + static const char* xfce4_args[] = {"--title=fsck", "-x", "sh", "-c", NULL}; + static const char* mate_args[] = {"--title", "fsck", "--", "sh", "-c", NULL}; + static const char* lxterminal_args[] = {"--title=fsck", "-e", "sh", "-c", NULL}; + static const char* terminator_args[] = {"-T", "fsck", "-x", "sh", "-c", NULL}; + static const char* urxvt_args[] = {"-title", "fsck", "-e", "sh", "-c", NULL}; + static const char* st_args[] = {"-t", "fsck", "-e", "sh", "-c", NULL}; + + // List of popular terminal emulators + static const TerminalInfo TERMINALS[] = { + {"xterm", xterm_args, NULL}, + {"gnome-terminal", gnome_args, gnome_deps}, + {"konsole", konsole_args, NULL}, + {"xfce4-terminal", xfce4_args, NULL}, + {"mate-terminal", mate_args, NULL}, + {"lxterminal", lxterminal_args, NULL}, + {"terminator", terminator_args, NULL}, + {"urxvt", urxvt_args, NULL}, + {"st", st_args, NULL}, + {NULL, NULL, NULL} + }; + CoreUnix::CoreUnix () @@ -49,10 +84,12 @@ namespace VeraCrypt - list <string> args; - - args.push_back ("-T"); - args.push_back ("fsck"); + // Find system fsck first + std::string errorMsg; + std::string fsckPath = Process::FindSystemBinary("fsck", errorMsg); + if (fsckPath.empty()) { + throw SystemException(SRC_POS, errorMsg); + } - args.push_back ("-e"); + list <string> args; - string xargs = "fsck "; + string xargs = fsckPath + " "; // Use absolute fsck path @@ -66,45 +103,44 @@ namespace VeraCrypt xargs += string (mountedVolume->VirtualDevice) + "; echo '[Done]'; read W"; - args.push_back (xargs); + // Try each terminal + for (const TerminalInfo* term = TERMINALS; term->name != NULL; ++term) { + errno = 0; + std::string termPath = Process::FindSystemBinary(term->name, errorMsg); + if (termPath.length() > 0) { + // check dependencies + if (term->dependency_path) { + bool depFound = true; + for (const char** dep = term->dependency_path; *dep != NULL; ++dep) { + string depPath = Process::FindSystemBinary(*dep, errorMsg); + if (depPath.empty()) { + depFound = false; + break; + } + } - try - { - Process::Execute ("xterm", args, 1000); - } catch (TimeOut&) { } -#ifdef TC_LINUX - catch (SystemException&) - { - // xterm not available. Try with KDE konsole if it exists - struct stat sb; - if (stat("/usr/bin/konsole", &sb) == 0) - { - args.clear (); - args.push_back ("-p"); - args.push_back ("tabtitle=fsck"); - args.push_back ("-e"); - args.push_back ("sh"); - args.push_back ("-c"); - args.push_back (xargs); - try - { - Process::Execute ("konsole", args, 1000); - } catch (TimeOut&) { } - } - else if (stat("/usr/bin/gnome-terminal", &sb) == 0 && stat("/usr/bin/dbus-launch", &sb) == 0) - { - args.clear (); - args.push_back ("--title"); - args.push_back ("fsck"); - args.push_back ("--"); - args.push_back ("sh"); - args.push_back ("-c"); - args.push_back (xargs); - try - { - Process::Execute ("gnome-terminal", args, 1000); - } catch (TimeOut&) { } + if (!depFound) { + continue; // dependency not found, skip + } + } + + // Build args + std::list<std::string> args; + for (const char** arg = term->args; *arg != NULL; ++arg) { + args.push_back(*arg); + } + args.push_back(xargs); + + try { + Process::Execute (termPath, args, 1000); + return; + } + catch (TimeOut&) { + return; + } + catch (SystemException&) { + // Continue to next terminal + } } - else - throw TerminalNotFound(); } -#endif + + throw TerminalNotFound(); } @@ -562,2 +598,13 @@ namespace VeraCrypt + if (options.MountPoint && !options.MountPoint->IsEmpty()) + { + // Reject if the mount point is a system directory + if (IsProtectedSystemDirectory(*options.MountPoint)) + throw MountPointBlocked (SRC_POS); + + // Reject if the mount point is in the user's PATH and the user has not explicitly allowed insecure mount points + if (!GetAllowInsecureMount() && IsDirectoryOnUserPath(*options.MountPoint)) + throw MountPointNotAllowed (SRC_POS); + } + Cipher::EnableHwSupport (!options.NoHardwareCrypto); @@ -794,2 +841,98 @@ namespace VeraCrypt } + + bool CoreUnix::IsProtectedSystemDirectory (const DirectoryPath &directory) const + { + static const char* systemDirs[] = { + "/usr", + "/bin", + "/sbin", + "/lib", +#ifdef TC_LINUX + "/lib32", + "/lib64", + "/libx32", +#endif + "/etc", + "/boot", + "/root", + "/proc", + "/sys", + "/dev", + NULL + }; + + // Resolve any symlinks in the path + string path(directory); + char* resolvedPathCStr = realpath(path.c_str(), NULL); + if (resolvedPathCStr) + { + path = resolvedPathCStr; + free(resolvedPathCStr); // Free the allocated memory + } + + // reject of the path is the root directory "/" + if (path == "/") + return true; + + // Check if resolved path matches any system directory + for (int i = 0; systemDirs[i] != NULL; ++i) + { + if (path == systemDirs[i] || path.find(string(systemDirs[i]) + "/") == 0) + return true; + } + + return false; + } + + bool CoreUnix::IsDirectoryOnUserPath(const DirectoryPath &directory) const + { + // Obtain the PATH environment variable + const char* pathEnv = UserEnvPATH.c_str(); + if (!pathEnv[0]) + return false; + + // Resolve the given directory + string dirPath(directory); + char* resolvedDir = realpath(dirPath.c_str(), NULL); + if (resolvedDir) + { + dirPath = resolvedDir; + free(resolvedDir); + } + + // Split PATH and compare each entry + stringstream ss(pathEnv); + string token; + while (getline(ss, token, ':')) + { + // remove any trailing slashes from the token + while (!token.empty() && token.back() == '/') + token.pop_back(); + + if (token.empty()) + continue; + + // check if the directory is the same as the entry or a subdirectory + if (dirPath == token || dirPath.find(token + "/") == 0) + return true; + + // handle the case where the PATH entry is a symlink + char* resolvedEntry = realpath(token.c_str(), NULL); + if (!resolvedEntry) + continue; // skip to the next entry since the path does not exist + + string entryPath(resolvedEntry); + free(resolvedEntry); + + // remove any trailing slashes from the token + while (!entryPath.empty() && entryPath.back() == '/') + entryPath.pop_back(); + + // perform check again if the resolved path is different from the original (symlink) + if (dirPath == entryPath || dirPath.find(entryPath + "/") == 0) + return true; + } + + return false; + } } diff --git a/src/Core/Unix/CoreUnix.h b/src/Core/Unix/CoreUnix.h index 586d4df3..ae26bf0a 100644 --- a/src/Core/Unix/CoreUnix.h +++ b/src/Core/Unix/CoreUnix.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -50,2 +50,4 @@ namespace VeraCrypt virtual void WipePasswordCache () const { throw NotApplicable (SRC_POS); } + virtual bool IsProtectedSystemDirectory (const DirectoryPath &directory) const; + virtual bool IsDirectoryOnUserPath(const DirectoryPath &directory) const; diff --git a/src/Core/Unix/FreeBSD/CoreFreeBSD.cpp b/src/Core/Unix/FreeBSD/CoreFreeBSD.cpp index 05520274..8f5b8048 100644 --- a/src/Core/Unix/FreeBSD/CoreFreeBSD.cpp +++ b/src/Core/Unix/FreeBSD/CoreFreeBSD.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -48,3 +48,3 @@ namespace VeraCrypt - string dev = StringConverter::Trim (Process::Execute ("mdconfig", args)); + string dev = StringConverter::Trim (Process::Execute ("/sbin/mdconfig", args)); @@ -67,3 +67,3 @@ namespace VeraCrypt { - Process::Execute ("mdconfig", args); + Process::Execute ("/sbin/mdconfig", args); break; diff --git a/src/Core/Unix/FreeBSD/CoreFreeBSD.h b/src/Core/Unix/FreeBSD/CoreFreeBSD.h index 453f6440..5510aa2c 100644 --- a/src/Core/Unix/FreeBSD/CoreFreeBSD.h +++ b/src/Core/Unix/FreeBSD/CoreFreeBSD.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/FreeBSD/System.h b/src/Core/Unix/FreeBSD/System.h index b5e28f31..63f68aae 100644 --- a/src/Core/Unix/FreeBSD/System.h +++ b/src/Core/Unix/FreeBSD/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/Linux/CoreLinux.cpp b/src/Core/Unix/Linux/CoreLinux.cpp index cd4be80f..77ec874a 100644 --- a/src/Core/Unix/Linux/CoreLinux.cpp +++ b/src/Core/Unix/Linux/CoreLinux.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/Linux/CoreLinux.h b/src/Core/Unix/Linux/CoreLinux.h index 9af801ec..b851fc27 100644 --- a/src/Core/Unix/Linux/CoreLinux.h +++ b/src/Core/Unix/Linux/CoreLinux.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/Linux/System.h b/src/Core/Unix/Linux/System.h index 0ec1daf0..c98bfd0a 100644 --- a/src/Core/Unix/Linux/System.h +++ b/src/Core/Unix/Linux/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/MacOSX/CoreMacOSX.cpp b/src/Core/Unix/MacOSX/CoreMacOSX.cpp index cfd34072..df8a40e2 100644 --- a/src/Core/Unix/MacOSX/CoreMacOSX.cpp +++ b/src/Core/Unix/MacOSX/CoreMacOSX.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -49,3 +49,3 @@ namespace VeraCrypt { - Process::Execute ("hdiutil", args); + Process::Execute ("/usr/bin/hdiutil", args); } @@ -86,3 +86,3 @@ namespace VeraCrypt { - Process::Execute ("umount", args); + Process::Execute ("/sbin/umount", args); break; @@ -116,3 +116,3 @@ namespace VeraCrypt - Process::Execute ("open", args); + Process::Execute ("/usr/bin/open", args); } @@ -192,3 +192,3 @@ namespace VeraCrypt { - xml = Process::Execute ("hdiutil", args); + xml = Process::Execute ("/usr/bin/hdiutil", args); break; @@ -235,3 +235,3 @@ namespace VeraCrypt - Process::Execute ("hdiutil", args); + Process::Execute ("/usr/bin/hdiutil", args); } diff --git a/src/Core/Unix/MacOSX/CoreMacOSX.h b/src/Core/Unix/MacOSX/CoreMacOSX.h index d2c70a87..da905708 100644 --- a/src/Core/Unix/MacOSX/CoreMacOSX.h +++ b/src/Core/Unix/MacOSX/CoreMacOSX.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/MacOSX/System.h b/src/Core/Unix/MacOSX/System.h index d187877f..af286829 100644 --- a/src/Core/Unix/MacOSX/System.h +++ b/src/Core/Unix/MacOSX/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/MountedFilesystem.h b/src/Core/Unix/MountedFilesystem.h index 3f6bd3e2..de9bc138 100644 --- a/src/Core/Unix/MountedFilesystem.h +++ b/src/Core/Unix/MountedFilesystem.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/OpenBSD/CoreOpenBSD.cpp b/src/Core/Unix/OpenBSD/CoreOpenBSD.cpp index 3064103b..161d4a79 100644 --- a/src/Core/Unix/OpenBSD/CoreOpenBSD.cpp +++ b/src/Core/Unix/OpenBSD/CoreOpenBSD.cpp @@ -9,3 +9,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -77,3 +77,3 @@ namespace VeraCrypt - Process::Execute ("vnconfig", args); + Process::Execute ("/sbin/vnconfig", args); @@ -92,3 +92,3 @@ namespace VeraCrypt { - Process::Execute ("vnconfig", args); + Process::Execute ("/sbin/vnconfig", args); break; diff --git a/src/Core/Unix/OpenBSD/CoreOpenBSD.h b/src/Core/Unix/OpenBSD/CoreOpenBSD.h index 3f6c48b5..32129534 100644 --- a/src/Core/Unix/OpenBSD/CoreOpenBSD.h +++ b/src/Core/Unix/OpenBSD/CoreOpenBSD.h @@ -9,3 +9,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/OpenBSD/System.h b/src/Core/Unix/OpenBSD/System.h index 90b24b2a..9c155a40 100644 --- a/src/Core/Unix/OpenBSD/System.h +++ b/src/Core/Unix/OpenBSD/System.h @@ -9,3 +9,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/Solaris/CoreSolaris.cpp b/src/Core/Unix/Solaris/CoreSolaris.cpp index 15a79c49..c436be8f 100644 --- a/src/Core/Unix/Solaris/CoreSolaris.cpp +++ b/src/Core/Unix/Solaris/CoreSolaris.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -37,3 +37,3 @@ namespace VeraCrypt - return StringConverter::Trim (Process::Execute ("lofiadm", args)); + return StringConverter::Trim (Process::Execute ("/usr/sbin/lofiadm", args)); } @@ -50,3 +50,3 @@ namespace VeraCrypt { - Process::Execute ("lofiadm", args); + Process::Execute ("/usr/sbin/lofiadm", args); break; diff --git a/src/Core/Unix/Solaris/CoreSolaris.h b/src/Core/Unix/Solaris/CoreSolaris.h index d36f03f9..6a55583a 100644 --- a/src/Core/Unix/Solaris/CoreSolaris.h +++ b/src/Core/Unix/Solaris/CoreSolaris.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/Solaris/System.h b/src/Core/Unix/Solaris/System.h index 73513467..7ee71da4 100644 --- a/src/Core/Unix/Solaris/System.h +++ b/src/Core/Unix/Solaris/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/Unix/System.h b/src/Core/Unix/System.h index 7225dae2..b6a6f092 100644 --- a/src/Core/Unix/System.h +++ b/src/Core/Unix/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/VolumeCreator.cpp b/src/Core/VolumeCreator.cpp index fefbddde..a60b12ba 100644 --- a/src/Core/VolumeCreator.cpp +++ b/src/Core/VolumeCreator.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Core/VolumeCreator.h b/src/Core/VolumeCreator.h index 781354b9..a25a9667 100644 --- a/src/Core/VolumeCreator.h +++ b/src/Core/VolumeCreator.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Crypto/Aes_hw_armv8.c b/src/Crypto/Aes_hw_armv8.c new file mode 100644 index 00000000..b67ed1a5 --- /dev/null +++ b/src/Crypto/Aes_hw_armv8.c @@ -0,0 +1,316 @@ +/* +* AES using ARMv8 +* Contributed by Jeffrey Walton +* +* Further changes +* (C) 2017,2018 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +/* Modified and adapted for VeraCrypt */ + +#include "Common/Tcdefs.h" +#include "Aes_hw_cpu.h" +#if !defined(_UEFI) +#include <memory.h> +#include <stdlib.h> +#endif +#include "cpu.h" +#include "misc.h" + +#if CRYPTOPP_ARM_AES_AVAILABLE + +#include <arm_neon.h> + +// Single block encryption operations +VC_INLINE void aes_enc_block(uint8x16_t* B, uint8x16_t K) +{ + *B = vaesmcq_u8(vaeseq_u8(*B, K)); +} + +VC_INLINE void aes_enc_block_last(uint8x16_t* B, uint8x16_t K, uint8x16_t K2) +{ + *B = veorq_u8(vaeseq_u8(*B, K), K2); +} + +// 4-block parallel encryption operations +VC_INLINE void aes_enc_4_blocks(uint8x16_t* B0, uint8x16_t* B1, + uint8x16_t* B2, uint8x16_t* B3, uint8x16_t K) +{ + *B0 = vaesmcq_u8(vaeseq_u8(*B0, K)); + *B1 = vaesmcq_u8(vaeseq_u8(*B1, K)); + *B2 = vaesmcq_u8(vaeseq_u8(*B2, K)); + *B3 = vaesmcq_u8(vaeseq_u8(*B3, K)); +} + +VC_INLINE void aes_enc_4_blocks_last(uint8x16_t* B0, uint8x16_t* B1, + uint8x16_t* B2, uint8x16_t* B3, + uint8x16_t K, uint8x16_t K2) +{ + *B0 = veorq_u8(vaeseq_u8(*B0, K), K2); + *B1 = veorq_u8(vaeseq_u8(*B1, K), K2); + *B2 = veorq_u8(vaeseq_u8(*B2, K), K2); + *B3 = veorq_u8(vaeseq_u8(*B3, K), K2); +} + +// Single block decryption operations +VC_INLINE void aes_dec_block(uint8x16_t* B, uint8x16_t K) +{ + *B = vaesimcq_u8(vaesdq_u8(*B, K)); +} + +VC_INLINE void aes_dec_block_last(uint8x16_t* B, uint8x16_t K, uint8x16_t K2) +{ + *B = veorq_u8(vaesdq_u8(*B, K), K2); +} + +// 4-block parallel decryption operations +VC_INLINE void aes_dec_4_blocks(uint8x16_t* B0, uint8x16_t* B1, + uint8x16_t* B2, uint8x16_t* B3, uint8x16_t K) +{ + *B0 = vaesimcq_u8(vaesdq_u8(*B0, K)); + *B1 = vaesimcq_u8(vaesdq_u8(*B1, K)); + *B2 = vaesimcq_u8(vaesdq_u8(*B2, K)); + *B3 = vaesimcq_u8(vaesdq_u8(*B3, K)); +} + +VC_INLINE void aes_dec_4_blocks_last(uint8x16_t* B0, uint8x16_t* B1, + uint8x16_t* B2, uint8x16_t* B3, + uint8x16_t K, uint8x16_t K2) +{ + *B0 = veorq_u8(vaesdq_u8(*B0, K), K2); + *B1 = veorq_u8(vaesdq_u8(*B1, K), K2); + *B2 = veorq_u8(vaesdq_u8(*B2, K), K2); + *B3 = veorq_u8(vaesdq_u8(*B3, K), K2); +} + +VC_INLINE void aes256_hw_encrypt_blocks(uint8 buffer[], size_t blocks, const uint8* ks) +{ + const uint8x16_t K0 = vld1q_u8(ks + 0 * 16); + const uint8x16_t K1 = vld1q_u8(ks + 1 * 16); + const uint8x16_t K2 = vld1q_u8(ks + 2 * 16); + const uint8x16_t K3 = vld1q_u8(ks + 3 * 16); + const uint8x16_t K4 = vld1q_u8(ks + 4 * 16); + const uint8x16_t K5 = vld1q_u8(ks + 5 * 16); + const uint8x16_t K6 = vld1q_u8(ks + 6 * 16); + const uint8x16_t K7 = vld1q_u8(ks + 7 * 16); + const uint8x16_t K8 = vld1q_u8(ks + 8 * 16); + const uint8x16_t K9 = vld1q_u8(ks + 9 * 16); + const uint8x16_t K10 = vld1q_u8(ks + 10 * 16); + const uint8x16_t K11 = vld1q_u8(ks + 11 * 16); + const uint8x16_t K12 = vld1q_u8(ks + 12 * 16); + const uint8x16_t K13 = vld1q_u8(ks + 13 * 16); + const uint8x16_t K14 = vld1q_u8(ks + 14 * 16); + + while(blocks >= 4) { + uint8x16_t B0 = vld1q_u8(buffer); + uint8x16_t B1 = vld1q_u8(buffer + 16); + uint8x16_t B2 = vld1q_u8(buffer + 32); + uint8x16_t B3 = vld1q_u8(buffer + 48); + + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K0); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K1); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K2); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K3); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K4); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K5); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K6); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K7); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K8); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K9); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K10); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K11); + aes_enc_4_blocks(&B0, &B1, &B2, &B3, K12); + aes_enc_4_blocks_last(&B0, &B1, &B2, &B3, K13, K14); + + vst1q_u8(buffer, B0); + vst1q_u8(buffer + 16, B1); + vst1q_u8(buffer + 32, B2); + vst1q_u8(buffer + 48, B3); + + buffer += 16 * 4; + blocks -= 4; + } + + for(size_t i = 0; i != blocks; ++i) { + uint8x16_t B = vld1q_u8(buffer + 16 * i); + aes_enc_block(&B, K0); + aes_enc_block(&B, K1); + aes_enc_block(&B, K2); + aes_enc_block(&B, K3); + aes_enc_block(&B, K4); + aes_enc_block(&B, K5); + aes_enc_block(&B, K6); + aes_enc_block(&B, K7); + aes_enc_block(&B, K8); + aes_enc_block(&B, K9); + aes_enc_block(&B, K10); + aes_enc_block(&B, K11); + aes_enc_block(&B, K12); + aes_enc_block_last(&B, K13, K14); + vst1q_u8(buffer + 16 * i, B); + } +} + +VC_INLINE void aes256_hw_encrypt_block(uint8 buffer[], const uint8* ks) +{ + const uint8x16_t K0 = vld1q_u8(ks + 0 * 16); + const uint8x16_t K1 = vld1q_u8(ks + 1 * 16); + const uint8x16_t K2 = vld1q_u8(ks + 2 * 16); + const uint8x16_t K3 = vld1q_u8(ks + 3 * 16); + const uint8x16_t K4 = vld1q_u8(ks + 4 * 16); + const uint8x16_t K5 = vld1q_u8(ks + 5 * 16); + const uint8x16_t K6 = vld1q_u8(ks + 6 * 16); + const uint8x16_t K7 = vld1q_u8(ks + 7 * 16); + const uint8x16_t K8 = vld1q_u8(ks + 8 * 16); + const uint8x16_t K9 = vld1q_u8(ks + 9 * 16); + const uint8x16_t K10 = vld1q_u8(ks + 10 * 16); + const uint8x16_t K11 = vld1q_u8(ks + 11 * 16); + const uint8x16_t K12 = vld1q_u8(ks + 12 * 16); + const uint8x16_t K13 = vld1q_u8(ks + 13 * 16); + const uint8x16_t K14 = vld1q_u8(ks + 14 * 16); + + uint8x16_t B = vld1q_u8(buffer); + aes_enc_block(&B, K0); + aes_enc_block(&B, K1); + aes_enc_block(&B, K2); + aes_enc_block(&B, K3); + aes_enc_block(&B, K4); + aes_enc_block(&B, K5); + aes_enc_block(&B, K6); + aes_enc_block(&B, K7); + aes_enc_block(&B, K8); + aes_enc_block(&B, K9); + aes_enc_block(&B, K10); + aes_enc_block(&B, K11); + aes_enc_block(&B, K12); + aes_enc_block_last(&B, K13, K14); + vst1q_u8(buffer, B); +} + +VC_INLINE void aes256_hw_decrypt_blocks(uint8 buffer[], size_t blocks, const uint8* ks) +{ + const uint8x16_t K0 = vld1q_u8(ks + 0 * 16); + const uint8x16_t K1 = vld1q_u8(ks + 1 * 16); + const uint8x16_t K2 = vld1q_u8(ks + 2 * 16); + const uint8x16_t K3 = vld1q_u8(ks + 3 * 16); + const uint8x16_t K4 = vld1q_u8(ks + 4 * 16); + const uint8x16_t K5 = vld1q_u8(ks + 5 * 16); + const uint8x16_t K6 = vld1q_u8(ks + 6 * 16); + const uint8x16_t K7 = vld1q_u8(ks + 7 * 16); + const uint8x16_t K8 = vld1q_u8(ks + 8 * 16); + const uint8x16_t K9 = vld1q_u8(ks + 9 * 16); + const uint8x16_t K10 = vld1q_u8(ks + 10 * 16); + const uint8x16_t K11 = vld1q_u8(ks + 11 * 16); + const uint8x16_t K12 = vld1q_u8(ks + 12 * 16); + const uint8x16_t K13 = vld1q_u8(ks + 13 * 16); + const uint8x16_t K14 = vld1q_u8(ks + 14 * 16); + + while(blocks >= 4) { + uint8x16_t B0 = vld1q_u8(buffer); + uint8x16_t B1 = vld1q_u8(buffer + 16); + uint8x16_t B2 = vld1q_u8(buffer + 32); + uint8x16_t B3 = vld1q_u8(buffer + 48); + + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K0); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K1); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K2); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K3); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K4); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K5); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K6); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K7); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K8); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K9); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K10); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K11); + aes_dec_4_blocks(&B0, &B1, &B2, &B3, K12); + aes_dec_4_blocks_last(&B0, &B1, &B2, &B3, K13, K14); + + vst1q_u8(buffer, B0); + vst1q_u8(buffer + 16, B1); + vst1q_u8(buffer + 32, B2); + vst1q_u8(buffer + 48, B3); + + buffer += 16 * 4; + blocks -= 4; + } + + for(size_t i = 0; i != blocks; ++i) { + uint8x16_t B = vld1q_u8(buffer + 16 * i); + aes_dec_block(&B, K0); + aes_dec_block(&B, K1); + aes_dec_block(&B, K2); + aes_dec_block(&B, K3); + aes_dec_block(&B, K4); + aes_dec_block(&B, K5); + aes_dec_block(&B, K6); + aes_dec_block(&B, K7); + aes_dec_block(&B, K8); + aes_dec_block(&B, K9); + aes_dec_block(&B, K10); + aes_dec_block(&B, K11); + aes_dec_block(&B, K12); + aes_dec_block_last(&B, K13, K14); + vst1q_u8(buffer + 16 * i, B); + } +} + +VC_INLINE void aes256_hw_decrypt_block(uint8 buffer[], const uint8* ks) +{ + const uint8x16_t K0 = vld1q_u8(ks + 0 * 16); + const uint8x16_t K1 = vld1q_u8(ks + 1 * 16); + const uint8x16_t K2 = vld1q_u8(ks + 2 * 16); + const uint8x16_t K3 = vld1q_u8(ks + 3 * 16); + const uint8x16_t K4 = vld1q_u8(ks + 4 * 16); + const uint8x16_t K5 = vld1q_u8(ks + 5 * 16); + const uint8x16_t K6 = vld1q_u8(ks + 6 * 16); + const uint8x16_t K7 = vld1q_u8(ks + 7 * 16); + const uint8x16_t K8 = vld1q_u8(ks + 8 * 16); + const uint8x16_t K9 = vld1q_u8(ks + 9 * 16); + const uint8x16_t K10 = vld1q_u8(ks + 10 * 16); + const uint8x16_t K11 = vld1q_u8(ks + 11 * 16); + const uint8x16_t K12 = vld1q_u8(ks + 12 * 16); + const uint8x16_t K13 = vld1q_u8(ks + 13 * 16); + const uint8x16_t K14 = vld1q_u8(ks + 14 * 16); + + uint8x16_t B = vld1q_u8(buffer); + aes_dec_block(&B, K0); + aes_dec_block(&B, K1); + aes_dec_block(&B, K2); + aes_dec_block(&B, K3); + aes_dec_block(&B, K4); + aes_dec_block(&B, K5); + aes_dec_block(&B, K6); + aes_dec_block(&B, K7); + aes_dec_block(&B, K8); + aes_dec_block(&B, K9); + aes_dec_block(&B, K10); + aes_dec_block(&B, K11); + aes_dec_block(&B, K12); + aes_dec_block_last(&B, K13, K14); + vst1q_u8(buffer, B); +} + +void aes_hw_cpu_decrypt (const uint8 *ks, uint8 *data) +{ + aes256_hw_decrypt_block(data, ks); +} + +void aes_hw_cpu_decrypt_32_blocks (const uint8 *ks, uint8 *data) +{ + aes256_hw_decrypt_blocks(data, 32, ks); +} + +void aes_hw_cpu_encrypt (const uint8 *ks, uint8 *data) +{ + aes256_hw_encrypt_block(data, ks); +} + +void aes_hw_cpu_encrypt_32_blocks (const uint8 *ks, uint8 *data) +{ + aes256_hw_encrypt_blocks(data, 32, ks); +} + +#endif diff --git a/src/Crypto/Aes_hw_cpu.h b/src/Crypto/Aes_hw_cpu.h index face0a0c..d9dda1af 100644 --- a/src/Crypto/Aes_hw_cpu.h +++ b/src/Crypto/Aes_hw_cpu.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -24,4 +24,4 @@ extern "C" uint8 is_aes_hw_cpu_supported (); -#endif void aes_hw_cpu_enable_sse (); +#endif void aes_hw_cpu_decrypt (const uint8 *ks, uint8 *data); diff --git a/src/Crypto/Crypto.vcxproj b/src/Crypto/Crypto.vcxproj index 4aebc084..cad50c06 100644 --- a/src/Crypto/Crypto.vcxproj +++ b/src/Crypto/Crypto.vcxproj @@ -228,2 +228,6 @@ <ClCompile Include="Aestab.c" /> + <ClCompile Include="Aes_hw_armv8.c"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> + </ClCompile> <ClCompile Include="blake2s.c" /> @@ -253,2 +257,6 @@ <ClCompile Include="Sha2.c" /> + <ClCompile Include="sha256_armv8.c"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> + </ClCompile> <ClCompile Include="Sha2Intel.c" /> diff --git a/src/Crypto/Crypto.vcxproj.filters b/src/Crypto/Crypto.vcxproj.filters index 3d384f97..099c3ce4 100644 --- a/src/Crypto/Crypto.vcxproj.filters +++ b/src/Crypto/Crypto.vcxproj.filters @@ -92,2 +92,11 @@ </ClCompile> + <ClCompile Include="Aescrypt.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Aes_hw_armv8.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="sha256_armv8.c"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> @@ -169,11 +178,2 @@ </ClInclude> - <ClInclude Include="blake2s-load-sse2.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="blake2s-load-sse41.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="blake2s-round.h"> - <Filter>Header Files</Filter> - </ClInclude> </ItemGroup> diff --git a/src/Crypto/Sha2.c b/src/Crypto/Sha2.c index 5ae9cae2..27e61c3d 100644 --- a/src/Crypto/Sha2.c +++ b/src/Crypto/Sha2.c @@ -317,2 +317,6 @@ extern "C" +#if CRYPTOPP_ARM_SHA2_AVAILABLE + void sha256_compress_digest_armv8(const void* input_data, uint_32t digest[8], uint_64t num_blks); +#endif + #if defined(__cplusplus) @@ -759,2 +763,9 @@ void SSE2Sha256Transform(sha256_ctx* ctx, void* mp, uint_64t num_blks) +#if CRYPTOPP_ARM_SHA2_AVAILABLE +void ArmSha256Transform(sha256_ctx* ctx, void* mp, uint_64t num_blks) +{ + sha256_compress_digest_armv8(mp, ctx->hash, num_blks); +} +#endif + #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 @@ -807,2 +818,8 @@ void sha256_begin(sha256_ctx* ctx) +#if CRYPTOPP_ARM_SHA2_AVAILABLE + if (HasSHA256()) + sha256transfunc = ArmSha256Transform; + else +#endif + #if CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X32 diff --git a/src/Crypto/Sha2.h b/src/Crypto/Sha2.h index 1fbcb8d1..42d067fa 100644 --- a/src/Crypto/Sha2.h +++ b/src/Crypto/Sha2.h @@ -1,3 +1,3 @@ /* - * Copyright (c) 2013-2017 IDRIX + * Copyright (c) 2013-2025 IDRIX * Governed by the Apache License 2.0 the full text of which is contained diff --git a/src/Crypto/config.h b/src/Crypto/config.h index 1c2aff72..841d6ead 100644 --- a/src/Crypto/config.h +++ b/src/Crypto/config.h @@ -31,2 +31,7 @@ +#if defined(_MSC_VER) && !defined(__clang__) +# undef CRYPTOPP_LLVM_CLANG_VERSION +# define CRYPTOPP_MSC_VERSION (_MSC_VER) +#endif + // Clang due to "Inline assembly operands don't work with .intel_syntax", http://llvm.org/bugs/show_bug.cgi?id=24232 @@ -154,11 +159,2 @@ -#if !defined(CRYPTOPP_DISABLE_SHANI) && !defined(_M_ARM) && !defined(_M_ARM64) && !defined(__arm__) && !defined(__aarch64__) && !defined(__arm64__) && defined(CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE) && \ - (defined(__SHA__) || (_MSC_VER >= 1900) || (__SUNPRO_CC >= 0x5160) || \ - (CRYPTOPP_GCC_VERSION >= 40900) || (__INTEL_COMPILER >= 1600) || \ - (CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50100)) - #define CRYPTOPP_SHANI_AVAILABLE 1 -#else - #define CRYPTOPP_SHANI_AVAILABLE 0 -#endif - // how to allocate 16-byte aligned memory (for SSE2) @@ -203,2 +199,60 @@ +#if !defined(CRYPTOPP_DISABLE_SHANI) && \ + (CRYPTOPP_BOOL_X32 || CRYPTOPP_BOOL_X86 || CRYPTOPP_BOOL_X64) && \ + defined(CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE) && \ + (defined(__SHA__) || (_MSC_VER >= 1900) || (__SUNPRO_CC >= 0x5160) || \ + (CRYPTOPP_GCC_VERSION >= 40900) || (__INTEL_COMPILER >= 1600) || \ + (CRYPTOPP_LLVM_CLANG_VERSION >= 30400) || (CRYPTOPP_APPLE_CLANG_VERSION >= 50100)) + #define CRYPTOPP_SHANI_AVAILABLE 1 +#else + #define CRYPTOPP_SHANI_AVAILABLE 0 +#endif + +#if defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) + #define CRYPTOPP_BOOL_ARMV8 1 + #define CRYPTOPP_BOOL_ARM64 1 +#else + #define CRYPTOPP_BOOL_ARMV8 0 + #define CRYPTOPP_BOOL_ARM64 0 +#endif + +// ARMv8 and ASIMD. -march=armv8-a or above must be present +// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017 +// Do not use APPLE_CLANG_VERSION; use __ARM_FEATURE_XXX instead. +#if !defined(CRYPTOPP_ARM_ASIMD_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_ASIMD) +# if defined(__aarch32__) || defined(__aarch64__) || defined(__arm64__) || defined(_M_ARM64) +# if defined(__ARM_NEON) || defined(__ARM_ASIMD) || defined(__ARM_FEATURE_NEON) || defined(__ARM_FEATURE_ASIMD) || \ + (CRYPTOPP_GCC_VERSION >= 40800) || (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || \ + (CRYPTOPP_APPLE_CLANG_VERSION >= 40000) || (CRYPTOPP_MSC_VERSION >= 1916) +# define CRYPTOPP_ARM_NEON_AVAILABLE 1 +# define CRYPTOPP_ARM_ASIMD_AVAILABLE 1 +# endif // Compilers +# endif // Platforms +#endif + +// ARMv8 and AES. -march=armv8-a+crypto or above must be present +// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017 +#if !defined(CRYPTOPP_ARM_AES_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_AES) +# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64) +# if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_GCC_VERSION >= 40800) || \ + (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300) || \ + (CRYPTOPP_MSC_VERSION >= 1916) +# define CRYPTOPP_ARM_AES_AVAILABLE 1 +# endif // Compilers +# endif // Platforms +#endif + +// ARMv8 and SHA-1, SHA-256. -march=armv8-a+crypto or above must be present +// Requires GCC 4.8, Clang 3.3 or Visual Studio 2017 +#if !defined(CRYPTOPP_ARM_SHA_AVAILABLE) && !defined(CRYPTOPP_DISABLE_ARM_SHA) +# if defined(__aarch32__) || defined(__aarch64__) || defined(_M_ARM64) +# if defined(__ARM_FEATURE_CRYPTO) || (CRYPTOPP_GCC_VERSION >= 40800) || \ + (CRYPTOPP_LLVM_CLANG_VERSION >= 30300) || (CRYPTOPP_APPLE_CLANG_VERSION >= 40300) || \ + (CRYPTOPP_MSC_VERSION >= 1916) +# define CRYPTOPP_ARM_SHA1_AVAILABLE 1 +# define CRYPTOPP_ARM_SHA2_AVAILABLE 1 +# endif // Compilers +# endif // Platforms +#endif + // Undo the ASM and Intrinsic related defines due to X32. diff --git a/src/Crypto/cpu.c b/src/Crypto/cpu.c index e611e9bb..a5b5bb19 100644 --- a/src/Crypto/cpu.c +++ b/src/Crypto/cpu.c @@ -471 +471,70 @@ void DisableCPUExtendedFeatures () +#if CRYPTOPP_BOOL_ARMV8 +#if defined(__linux__) && defined(__aarch64__) +#include <sys/auxv.h> +#ifndef HWCAP_AES +# define HWCAP_AES (1 << 3) +#endif +#ifndef HWCAP_SHA2 +# define HWCAP_SHA2 (1 << 6) +#endif +#endif + +volatile int g_hasAESARM = 0; +volatile int g_hasSHA256ARM = 0; + +inline int CPU_QueryAES() +{ +#if defined(CRYPTOPP_ARM_AES_AVAILABLE) +#if defined(__linux__) && defined(__aarch64__) + if ((getauxval(AT_HWCAP) & HWCAP_AES) != 0) + return 1; +#elif defined(__APPLE__) && defined(__aarch64__) + // Apple Sillcon (M1) and later + return 1; +#elif defined(_WIN32) && defined(_M_ARM64) +#ifdef TC_WINDOWS_DRIVER + if (ExIsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) != 0) + return 1; +#else + if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) != 0) + return 1; +#endif +#endif + return 0; +#else + return 0; +#endif +} + +inline int CPU_QuerySHA2() +{ +#if defined(CRYPTOPP_ARM_SHA2_AVAILABLE) +#if defined(__linux__) && defined(__aarch64__) + if ((getauxval(AT_HWCAP) & HWCAP_SHA2) != 0) + return 1; +#elif defined(__APPLE__) && defined(__aarch64__) + // Apple Sillcon (M1) and later + return 1; +#elif defined(_WIN32) && defined(_M_ARM64) +#ifdef TC_WINDOWS_DRIVER + if (ExIsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) != 0) + return 1; +#else + if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) != 0) + return 1; +#endif +#endif + return 0; +#else + return 0; +#endif +} + +void DetectArmFeatures() +{ + g_hasAESARM = CPU_QueryAES(); + g_hasSHA256ARM = CPU_QuerySHA2(); +} + +#endif
\ No newline at end of file diff --git a/src/Crypto/cpu.h b/src/Crypto/cpu.h index b0df6462..cb34ad1f 100644 --- a/src/Crypto/cpu.h +++ b/src/Crypto/cpu.h @@ -290,2 +290,22 @@ void DisableCPUExtendedFeatures (); +#elif CRYPTOPP_BOOL_ARMV8 +#if defined(__cplusplus) +extern "C" { +#endif + +#if !defined(CRYPTOPP_DISABLE_AESNI) && !defined(WOLFCRYPT_BACKEND) +#define TC_AES_HW_CPU +#endif + +extern volatile int g_hasAESARM; +extern volatile int g_hasSHA256ARM; +void DetectArmFeatures(); + +#define HasAESNI() g_hasAESARM +#define HasSHA256() g_hasSHA256ARM + +#if defined(__cplusplus) +} +#endif + #else diff --git a/src/Crypto/sha256_armv8.c b/src/Crypto/sha256_armv8.c new file mode 100644 index 00000000..1599350a --- /dev/null +++ b/src/Crypto/sha256_armv8.c @@ -0,0 +1,184 @@ +/* +* SHA-256 using CPU instructions in ARMv8 +* +* Contributed by Jeffrey Walton. Based on public domain code by +* Johannes Schneiders, Skip Hovsmith and Barry O'Rourke. +* +* Further changes (C) 2020 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +/* Modified and adapted for VeraCrypt */ + +#include "Common/Tcdefs.h" +#if !defined(_UEFI) +#include <memory.h> +#include <stdlib.h> +#endif +#include "cpu.h" +#include "misc.h" + +#if CRYPTOPP_ARM_SHA2_AVAILABLE + +#include <arm_neon.h> + +CRYPTOPP_ALIGN_DATA(64) static const uint32 K[] = { + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2, +}; + +void sha256_compress_digest_armv8(void* input_data, uint32 digest[8], uint64 num_blks) { + + + // Load initial values + uint32x4_t STATE0 = vld1q_u32(&digest[0]); + uint32x4_t STATE1 = vld1q_u32(&digest[4]); + + // Intermediate void* cast due to https://llvm.org/bugs/show_bug.cgi?id=20670 + const uint32* input32 = (const uint32*)(const void*)input_data; + + while (num_blks > 0) { + // Save current state + const uint32x4_t ABCD_SAVE = STATE0; + const uint32x4_t EFGH_SAVE = STATE1; + + uint32x4_t MSG0 = vld1q_u32(input32 + 0); + uint32x4_t MSG1 = vld1q_u32(input32 + 4); + uint32x4_t MSG2 = vld1q_u32(input32 + 8); + uint32x4_t MSG3 = vld1q_u32(input32 + 12); + + MSG0 = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(MSG0))); + MSG1 = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(MSG1))); + MSG2 = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(MSG2))); + MSG3 = vreinterpretq_u32_u8(vrev32q_u8(vreinterpretq_u8_u32(MSG3))); + + uint32x4_t MSG_K, TSTATE; + + // Rounds 0-3 + MSG_K = vaddq_u32(MSG0, vld1q_u32(&K[4 * 0])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG0 = vsha256su1q_u32(vsha256su0q_u32(MSG0, MSG1), MSG2, MSG3); + + // Rounds 4-7 + MSG_K = vaddq_u32(MSG1, vld1q_u32(&K[4 * 1])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG1 = vsha256su1q_u32(vsha256su0q_u32(MSG1, MSG2), MSG3, MSG0); + + // Rounds 8-11 + MSG_K = vaddq_u32(MSG2, vld1q_u32(&K[4 * 2])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG2 = vsha256su1q_u32(vsha256su0q_u32(MSG2, MSG3), MSG0, MSG1); + + // Rounds 12-15 + MSG_K = vaddq_u32(MSG3, vld1q_u32(&K[4 * 3])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG3 = vsha256su1q_u32(vsha256su0q_u32(MSG3, MSG0), MSG1, MSG2); + + // Rounds 16-19 + MSG_K = vaddq_u32(MSG0, vld1q_u32(&K[4 * 4])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG0 = vsha256su1q_u32(vsha256su0q_u32(MSG0, MSG1), MSG2, MSG3); + + // Rounds 20-23 + MSG_K = vaddq_u32(MSG1, vld1q_u32(&K[4 * 5])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG1 = vsha256su1q_u32(vsha256su0q_u32(MSG1, MSG2), MSG3, MSG0); + + // Rounds 24-27 + MSG_K = vaddq_u32(MSG2, vld1q_u32(&K[4 * 6])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG2 = vsha256su1q_u32(vsha256su0q_u32(MSG2, MSG3), MSG0, MSG1); + + // Rounds 28-31 + MSG_K = vaddq_u32(MSG3, vld1q_u32(&K[4 * 7])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG3 = vsha256su1q_u32(vsha256su0q_u32(MSG3, MSG0), MSG1, MSG2); + + // Rounds 32-35 + MSG_K = vaddq_u32(MSG0, vld1q_u32(&K[4 * 8])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG0 = vsha256su1q_u32(vsha256su0q_u32(MSG0, MSG1), MSG2, MSG3); + + // Rounds 36-39 + MSG_K = vaddq_u32(MSG1, vld1q_u32(&K[4 * 9])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG1 = vsha256su1q_u32(vsha256su0q_u32(MSG1, MSG2), MSG3, MSG0); + + // Rounds 40-43 + MSG_K = vaddq_u32(MSG2, vld1q_u32(&K[4 * 10])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG2 = vsha256su1q_u32(vsha256su0q_u32(MSG2, MSG3), MSG0, MSG1); + + // Rounds 44-47 + MSG_K = vaddq_u32(MSG3, vld1q_u32(&K[4 * 11])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + MSG3 = vsha256su1q_u32(vsha256su0q_u32(MSG3, MSG0), MSG1, MSG2); + + // Rounds 48-51 + MSG_K = vaddq_u32(MSG0, vld1q_u32(&K[4 * 12])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + + // Rounds 52-55 + MSG_K = vaddq_u32(MSG1, vld1q_u32(&K[4 * 13])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + + // Rounds 56-59 + MSG_K = vaddq_u32(MSG2, vld1q_u32(&K[4 * 14])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + + // Rounds 60-63 + MSG_K = vaddq_u32(MSG3, vld1q_u32(&K[4 * 15])); + TSTATE = vsha256hq_u32(STATE0, STATE1, MSG_K); + STATE1 = vsha256h2q_u32(STATE1, STATE0, MSG_K); + STATE0 = TSTATE; + + // Add back to state + STATE0 = vaddq_u32(STATE0, ABCD_SAVE); + STATE1 = vaddq_u32(STATE1, EFGH_SAVE); + + input32 += 64 / 4; + num_blks--; + } + + // Save state + vst1q_u32(&digest[0], STATE0); + vst1q_u32(&digest[4], STATE1); +} +#endif diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c index a280d20e..f8f06b37 100644 --- a/src/Driver/DriveFilter.c +++ b/src/Driver/DriveFilter.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -289,3 +289,3 @@ static void DismountDrive (DriveFilterExtension *Extension, BOOL stopIoQueue) { - Dump ("Dismounting drive\n"); + Dump ("Unmounting drive\n"); ASSERT (Extension->DriveMounted); @@ -303,3 +303,3 @@ static void DismountDrive (DriveFilterExtension *Extension, BOOL stopIoQueue) - Dump ("Drive dismount done!\n"); + Dump ("Drive unmount done!\n"); } diff --git a/src/Driver/DriveFilter.h b/src/Driver/DriveFilter.h index 307880fb..60ec9a05 100644 --- a/src/Driver/DriveFilter.h +++ b/src/Driver/DriveFilter.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/Driver.rc b/src/Driver/Driver.rc index 6d9bad20..928ce1c3 100644 --- a/src/Driver/Driver.rc +++ b/src/Driver/Driver.rc @@ -29,4 +29,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,20,0 + PRODUCTVERSION 1,26,20,0 FILEFLAGSMASK 0x17L @@ -47,3 +47,3 @@ BEGIN VALUE "FileDescription", "VeraCrypt Driver" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -51,3 +51,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END diff --git a/src/Driver/Driver.vcxproj b/src/Driver/Driver.vcxproj index 7f135b35..17fbfa43 100644 --- a/src/Driver/Driver.vcxproj +++ b/src/Driver/Driver.vcxproj @@ -39,3 +39,3 @@ <DriverTargetPlatform>Universal</DriverTargetPlatform> - <_NT_TARGET_VERSION>0xA000008</_NT_TARGET_VERSION> + <_NT_TARGET_VERSION>0xA000006</_NT_TARGET_VERSION> </PropertyGroup> @@ -48,3 +48,3 @@ <DriverTargetPlatform>Universal</DriverTargetPlatform> - <_NT_TARGET_VERSION>0xA000008</_NT_TARGET_VERSION> + <_NT_TARGET_VERSION>0xA000006</_NT_TARGET_VERSION> </PropertyGroup> @@ -57,3 +57,3 @@ <DriverTargetPlatform>Universal</DriverTargetPlatform> - <_NT_TARGET_VERSION>0xA000008</_NT_TARGET_VERSION> + <_NT_TARGET_VERSION>0xA000006</_NT_TARGET_VERSION> </PropertyGroup> @@ -66,3 +66,3 @@ <DriverTargetPlatform>Universal</DriverTargetPlatform> - <_NT_TARGET_VERSION>0xA000008</_NT_TARGET_VERSION> + <_NT_TARGET_VERSION>0xA000006</_NT_TARGET_VERSION> </PropertyGroup> @@ -112,3 +112,4 @@ </ProviderName> - <TimeStamp>1.26.17.2</TimeStamp> + <TimeStamp>1.26.20.0</TimeStamp> + <DateStamp>02/03/2025</DateStamp> </Inf> @@ -138,3 +139,4 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Debug\Setup Files\veracrypt.inf"</Com </ProviderName> - <TimeStamp>1.26.17.2</TimeStamp> + <TimeStamp>1.26.20.0</TimeStamp> + <DateStamp>02/03/2025</DateStamp> </Inf> @@ -164,3 +166,4 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Release\Setup Files\veracrypt.inf"</C </ProviderName> - <TimeStamp>1.26.17.2</TimeStamp> + <TimeStamp>1.26.20.0</TimeStamp> + <DateStamp>02/03/2025</DateStamp> </Inf> @@ -190,3 +193,4 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Release\Setup Files\veracrypt.inf"</C </ProviderName> - <TimeStamp>1.26.17.2</TimeStamp> + <TimeStamp>1.26.20.0</TimeStamp> + <DateStamp>02/03/2025</DateStamp> </Inf> @@ -226,2 +230,6 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Debug\Setup Files\veracrypt.inf"</Com <ClCompile Include="..\Crypto\Aestab.c" /> + <ClCompile Include="..\Crypto\Aes_hw_armv8.c"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> + </ClCompile> <ClCompile Include="..\Crypto\blake2s.c" /> @@ -266,2 +274,6 @@ copy $(OutDir)veracrypt.inf "$(SolutionDir)Debug\Setup Files\veracrypt.inf"</Com <ClCompile Include="..\Crypto\Sha2.c" /> + <ClCompile Include="..\Crypto\sha256_armv8.c"> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> + <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> + </ClCompile> <ClCompile Include="..\Crypto\Sha2Intel.c" /> diff --git a/src/Driver/Driver.vcxproj.filters b/src/Driver/Driver.vcxproj.filters index 478432fa..3c427dad 100644 --- a/src/Driver/Driver.vcxproj.filters +++ b/src/Driver/Driver.vcxproj.filters @@ -167,2 +167,8 @@ </ClCompile> + <ClCompile Include="..\Crypto\Aes_hw_armv8.c"> + <Filter>Crypto\Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Crypto\sha256_armv8.c"> + <Filter>Crypto\Source Files</Filter> + </ClCompile> </ItemGroup> diff --git a/src/Driver/Driver.vcxproj.user b/src/Driver/Driver.vcxproj.user index 9724a753..f5bd9cdc 100644 --- a/src/Driver/Driver.vcxproj.user +++ b/src/Driver/Driver.vcxproj.user @@ -18,2 +18,5 @@ </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor> + </PropertyGroup> </Project>
\ No newline at end of file diff --git a/src/Driver/DumpFilter.c b/src/Driver/DumpFilter.c index f858bb7c..4105b116 100644 --- a/src/Driver/DumpFilter.c +++ b/src/Driver/DumpFilter.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/DumpFilter.h b/src/Driver/DumpFilter.h index c72115a2..88091bd4 100644 --- a/src/Driver/DumpFilter.h +++ b/src/Driver/DumpFilter.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/EncryptedIoQueue.c b/src/Driver/EncryptedIoQueue.c index 91399c47..c39941e6 100644 --- a/src/Driver/EncryptedIoQueue.c +++ b/src/Driver/EncryptedIoQueue.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -227,10 +227,11 @@ static void ReleaseFragmentBuffer (EncryptedIoQueue *queue, uint8 *buffer) -BOOL +BOOL UpdateBuffer( - uint8* buffer, - uint8* secRegion, - uint64 bufferDiskOffset, - uint32 bufferLength, - BOOL doUpadte - ) + uint8* buffer, + uint8* secRegion, + SIZE_T secRegionSize, + uint64 bufferDiskOffset, + uint32 bufferLength, + BOOL doUpadte +) { @@ -239,23 +240,62 @@ UpdateBuffer( uint32 i; - DCS_DISK_ENTRY_LIST *DeList = (DCS_DISK_ENTRY_LIST*)(secRegion + 512); + DCS_DISK_ENTRY_LIST *DeList = NULL; BOOL updated = FALSE; - if (secRegion == NULL) return FALSE; + if (secRegion == NULL) + return FALSE; + + // Check if secRegion is large enough to hold the DCS_DISK_ENTRY_LIST structure + // starting at offset 512 + if (secRegionSize < (512 + sizeof(DCS_DISK_ENTRY_LIST))) + return FALSE; + + DeList = (DCS_DISK_ENTRY_LIST*)(secRegion + 512); + + // Ensure Count doesn't exceed the fixed array size + if (DeList->Count > 15) + return FALSE; + for (i = 0; i < DeList->Count; ++i) { if (DeList->DE[i].Type == DE_Sectors) { + uint64 sectorStart = DeList->DE[i].Sectors.Start; + uint64 sectorLength = DeList->DE[i].Sectors.Length; + uint64 sectorOffset = DeList->DE[i].Sectors.Offset; + + // Check that sectorOffset and sectorLength are valid within secRegion + if (sectorOffset > secRegionSize || + sectorLength == 0 || + (sectorOffset + sectorLength) > secRegionSize) + { + // Invalid entry - skip + continue; + } + GetIntersection( bufferDiskOffset, bufferLength, - DeList->DE[i].Sectors.Start, DeList->DE[i].Sectors.Start + DeList->DE[i].Sectors.Length - 1, + sectorStart, sectorStart + sectorLength - 1, &intersectStart, &intersectLength - ); + ); + if (intersectLength != 0) { + uint64 bufferPos = intersectStart - bufferDiskOffset; + uint64 regionPos = sectorOffset + (intersectStart - sectorStart); + + // Check buffer boundaries + if (bufferPos + intersectLength > bufferLength) + continue; // Intersection out of buffer range + + // Check secRegion boundaries + if (regionPos + intersectLength > secRegionSize) + continue; // Intersection out of secRegion range + updated = TRUE; - if(doUpadte && buffer != NULL) { -// Dump("Subst data\n"); + if (doUpadte && buffer != NULL) { memcpy( - buffer + (intersectStart - bufferDiskOffset), - secRegion + DeList->DE[i].Sectors.Offset + (intersectStart - DeList->DE[i].Sectors.Start), + buffer + bufferPos, + secRegion + regionPos, intersectLength - ); - } else { + ); + } + else { + // If no update is needed but intersection found return TRUE; @@ -289,3 +329,3 @@ static VOID CompleteIrpWorkItemRoutine(PDEVICE_OBJECT DeviceObject, PVOID Contex { - KeSetEvent(&queue->NoActiveWorkItemsEvent, IO_NO_INCREMENT, FALSE); + KeSetEvent(&queue->NoActiveWorkItemsEvent, IO_DISK_INCREMENT, FALSE); } @@ -298,3 +338,3 @@ static VOID CompleteIrpWorkItemRoutine(PDEVICE_OBJECT DeviceObject, PVOID Contex // Release the semaphore to signal that a work item is available - KeReleaseSemaphore(&queue->WorkItemSemaphore, IO_NO_INCREMENT, 1, FALSE); + KeReleaseSemaphore(&queue->WorkItemSemaphore, IO_DISK_INCREMENT, 1, FALSE); @@ -380,3 +420,3 @@ static VOID CompletionThreadProc(PVOID threadArg) if((queue->SecRegionData != NULL) && (queue->SecRegionSize > 512)) { - UpdateBuffer(request->Data, queue->SecRegionData, request->Offset.QuadPart, request->Length, TRUE); + UpdateBuffer(request->Data, queue->SecRegionData, queue->SecRegionSize, request->Offset.QuadPart, request->Length, TRUE); } @@ -733,3 +773,3 @@ static VOID MainThreadProc (PVOID threadArg) if((queue->SecRegionData != NULL) && (queue->SecRegionSize > 512)) { - UpdateBuffer(buffer, queue->SecRegionData, alignedOffset.QuadPart, alignedLength, TRUE); + UpdateBuffer(buffer, queue->SecRegionData, queue->SecRegionSize, alignedOffset.QuadPart, alignedLength, TRUE); } @@ -826,3 +866,3 @@ static VOID MainThreadProc (PVOID threadArg) && (queue->SecRegionData != NULL) && (queue->SecRegionSize > 512) - && UpdateBuffer (NULL, queue->SecRegionData, item->OriginalOffset.QuadPart, (uint32)(item->OriginalOffset.QuadPart + item->OriginalLength - 1), FALSE)) + && UpdateBuffer (NULL, queue->SecRegionData, queue->SecRegionSize, item->OriginalOffset.QuadPart, (uint32)(item->OriginalOffset.QuadPart + item->OriginalLength - 1), FALSE)) { diff --git a/src/Driver/EncryptedIoQueue.h b/src/Driver/EncryptedIoQueue.h index 3738065a..82cc76cd 100644 --- a/src/Driver/EncryptedIoQueue.h +++ b/src/Driver/EncryptedIoQueue.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/Fuse/FuseService.cpp b/src/Driver/Fuse/FuseService.cpp index 5b12ba4d..5fe9f6fe 100644 --- a/src/Driver/Fuse/FuseService.cpp +++ b/src/Driver/Fuse/FuseService.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/Fuse/FuseService.h b/src/Driver/Fuse/FuseService.h index d09a40db..1e4ffc6c 100644 --- a/src/Driver/Fuse/FuseService.h +++ b/src/Driver/Fuse/FuseService.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c index 12943dc8..148f88b8 100644 --- a/src/Driver/Ntdriver.c +++ b/src/Driver/Ntdriver.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -234,3 +234,3 @@ void GetDriverRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed) } - +#ifndef _M_ARM64 // use RDSEED or RDRAND from CPU as source of entropy if enabled @@ -243,2 +243,3 @@ void GetDriverRandomSeed (unsigned char* pbRandSeed, size_t cbRandSeed) } +#endif WHIRLPOOL_finalize (&tctx, digest); @@ -268,3 +269,7 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) +#ifndef _M_ARM64 DetectX86Features(); +#else + DetectArmFeatures(); +#endif @@ -295,3 +300,7 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) // features and try again in order to workaround faulty configurations +#ifndef _M_ARM64 DisableCPUExtendedFeatures(); +#else + EnableHwEncryption(FALSE); +#endif SelfTestsPassed = AutoTestAlgorithms(); @@ -1221,3 +1230,3 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION outputBuffer->PartitionNumber = 1; - outputBuffer->HiddenSectors = 0; + outputBuffer->HiddenSectors = BYTES_PER_MB / Extension->BytesPerSector; Irp->IoStatus.Status = STATUS_SUCCESS; @@ -1241,3 +1250,3 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION outputBuffer->Mbr.RecognizedPartition = TRUE; - outputBuffer->Mbr.HiddenSectors = 0; + outputBuffer->Mbr.HiddenSectors = BYTES_PER_MB / Extension->BytesPerSector; Irp->IoStatus.Status = STATUS_SUCCESS; @@ -1265,3 +1274,3 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION outputBuffer->PartitionEntry->PartitionNumber = 1; - outputBuffer->PartitionEntry->HiddenSectors = 0; + outputBuffer->PartitionEntry->HiddenSectors = BYTES_PER_MB / Extension->BytesPerSector; @@ -1300,3 +1309,3 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION outputBuffer->PartitionEntry->PartitionNumber = 1; - outputBuffer->PartitionEntry->Mbr.HiddenSectors = 0; + outputBuffer->PartitionEntry->Mbr.HiddenSectors = BYTES_PER_MB / Extension->BytesPerSector; outputBuffer->PartitionEntry->Mbr.PartitionType = Extension->PartitionType; @@ -1439,3 +1448,8 @@ NTSTATUS ProcessVolumeDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION // Vista's, Windows 8.1 and later filesystem defragmenter fails if IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS does not succeed. - if (ValidateIOBufferSize(Irp, sizeof(VOLUME_DISK_EXTENTS), ValidateOutput)) + if (!AllowWindowsDefrag || !Extension->bRawDevice) // We don't support defragmentation for file-hosted volumes + { + Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; + Irp->IoStatus.Information = 0; + } + else if (ValidateIOBufferSize(Irp, sizeof(VOLUME_DISK_EXTENTS), ValidateOutput)) { @@ -2588,3 +2602,3 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex - case TC_IOCTL_DISMOUNT_VOLUME: + case TC_IOCTL_UNMOUNT_VOLUME: if (ValidateIOBufferSize (Irp, sizeof (UNMOUNT_STRUCT), ValidateInputOutput)) @@ -2616,3 +2630,3 @@ NTSTATUS ProcessMainDeviceControlIrp (PDEVICE_OBJECT DeviceObject, PEXTENSION Ex - case TC_IOCTL_DISMOUNT_ALL_VOLUMES: + case TC_IOCTL_UNMOUNT_ALL_VOLUMES: if (ValidateIOBufferSize (Irp, sizeof (UNMOUNT_STRUCT), ValidateInputOutput)) @@ -3175,4 +3189,4 @@ LPWSTR TCTranslateCode (ULONG ulCode) TC_CASE_RET_NAME (TC_IOCTL_BOOT_ENCRYPTION_SETUP); - TC_CASE_RET_NAME (TC_IOCTL_DISMOUNT_ALL_VOLUMES); - TC_CASE_RET_NAME (TC_IOCTL_DISMOUNT_VOLUME); + TC_CASE_RET_NAME (TC_IOCTL_UNMOUNT_ALL_VOLUMES); + TC_CASE_RET_NAME (TC_IOCTL_UNMOUNT_VOLUME); TC_CASE_RET_NAME (TC_IOCTL_GET_BOOT_DRIVE_VOLUME_PROPERTIES); @@ -3373,3 +3387,3 @@ void OnShutdownPending () - while (SendDeviceIoControlRequest (RootDeviceObject, TC_IOCTL_DISMOUNT_ALL_VOLUMES, &unmount, sizeof (unmount), &unmount, sizeof (unmount)) == STATUS_INSUFFICIENT_RESOURCES || unmount.HiddenVolumeProtectionTriggered) + while (SendDeviceIoControlRequest (RootDeviceObject, TC_IOCTL_UNMOUNT_ALL_VOLUMES, &unmount, sizeof (unmount), &unmount, sizeof (unmount)) == STATUS_INSUFFICIENT_RESOURCES || unmount.HiddenVolumeProtectionTriggered) unmount.HiddenVolumeProtectionTriggered = FALSE; diff --git a/src/Driver/Ntdriver.h b/src/Driver/Ntdriver.h index b03b5e93..c23bbfe3 100644 --- a/src/Driver/Ntdriver.h +++ b/src/Driver/Ntdriver.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c index 0376033f..9856fc2b 100644 --- a/src/Driver/Ntvol.c +++ b/src/Driver/Ntvol.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/Ntvol.h b/src/Driver/Ntvol.h index 1d80b7de..a1051e94 100644 --- a/src/Driver/Ntvol.h +++ b/src/Driver/Ntvol.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/VolumeFilter.c b/src/Driver/VolumeFilter.c index b4bc8d2e..f4fc9610 100644 --- a/src/Driver/VolumeFilter.c +++ b/src/Driver/VolumeFilter.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/VolumeFilter.h b/src/Driver/VolumeFilter.h index f3e53237..e318e99d 100644 --- a/src/Driver/VolumeFilter.h +++ b/src/Driver/VolumeFilter.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Driver/veracrypt.Inf b/src/Driver/veracrypt.Inf index d2cef1b4..c5751ac2 100644 --- a/src/Driver/veracrypt.Inf +++ b/src/Driver/veracrypt.Inf @@ -4,3 +4,3 @@ ;;; -;;; Copyright (c) 2024, IDRIX +;;; Copyright (c) 2025, IDRIX ;;; diff --git a/src/ExpandVolume/DlgExpandVolume.cpp b/src/ExpandVolume/DlgExpandVolume.cpp index 0d803511..8124e19a 100644 --- a/src/ExpandVolume/DlgExpandVolume.cpp +++ b/src/ExpandVolume/DlgExpandVolume.cpp @@ -11,3 +11,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -550,3 +550,3 @@ void ExpandVolumeWizard (HWND hwndDlg, wchar_t *lpszVolume) { - Warning ("DISMOUNT_FIRST", hwndDlg); + Warning ("UNMOUNT_FIRST", hwndDlg); goto ret; diff --git a/src/ExpandVolume/ExpandVolume.c b/src/ExpandVolume/ExpandVolume.c index 084de5f3..9a53bbde 100644 --- a/src/ExpandVolume/ExpandVolume.c +++ b/src/ExpandVolume/ExpandVolume.c @@ -11,3 +11,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/ExpandVolume/ExpandVolume.h b/src/ExpandVolume/ExpandVolume.h index 668eb79d..1aea9ea1 100644 --- a/src/ExpandVolume/ExpandVolume.h +++ b/src/ExpandVolume/ExpandVolume.h @@ -11,3 +11,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/ExpandVolume/ExpandVolume.rc b/src/ExpandVolume/ExpandVolume.rc index ee5efc41..a84a838d 100644 --- a/src/ExpandVolume/ExpandVolume.rc +++ b/src/ExpandVolume/ExpandVolume.rc @@ -194,4 +194,4 @@ IDR_MOUNT_RSRC_HEADER HEADER "resource.h" VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,20,0 + PRODUCTVERSION 1,26,20,0 FILEFLAGSMASK 0x17L @@ -212,3 +212,3 @@ BEGIN VALUE "FileDescription", "VeraCrypt Expander" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -216,3 +216,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END diff --git a/src/ExpandVolume/InitDataArea.c b/src/ExpandVolume/InitDataArea.c index d937e3fb..b85afad7 100644 --- a/src/ExpandVolume/InitDataArea.c +++ b/src/ExpandVolume/InitDataArea.c @@ -11,3 +11,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/ExpandVolume/InitDataArea.h b/src/ExpandVolume/InitDataArea.h index f8104150..e273cfaa 100644 --- a/src/ExpandVolume/InitDataArea.h +++ b/src/ExpandVolume/InitDataArea.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/ExpandVolume/WinMain.cpp b/src/ExpandVolume/WinMain.cpp index 37cd11c8..64fccd55 100644 --- a/src/ExpandVolume/WinMain.cpp +++ b/src/ExpandVolume/WinMain.cpp @@ -11,3 +11,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -1095,3 +1095,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz - DetectX86Features (); +#ifndef _M_ARM64 + DetectX86Features(); +#else + DetectArmFeatures(); +#endif diff --git a/src/Format/Format.rc b/src/Format/Format.rc index 0f908e2c..057fd837 100644 --- a/src/Format/Format.rc +++ b/src/Format/Format.rc @@ -30,4 +30,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,20,0 + PRODUCTVERSION 1,26,20,0 FILEFLAGSMASK 0x17L @@ -48,3 +48,3 @@ BEGIN VALUE "FileDescription", "VeraCrypt Format" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -52,3 +52,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END diff --git a/src/Format/FormatCom.cpp b/src/Format/FormatCom.cpp index 90333f23..904128c3 100644 --- a/src/Format/FormatCom.cpp +++ b/src/Format/FormatCom.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Format/FormatCom.h b/src/Format/FormatCom.h index e474608d..17eff52e 100644 --- a/src/Format/FormatCom.h +++ b/src/Format/FormatCom.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Format/InPlace.c b/src/Format/InPlace.c index 873ae067..0c35ccce 100644 --- a/src/Format/InPlace.c +++ b/src/Format/InPlace.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -1363,3 +1363,3 @@ int DecryptPartitionInPlace (volatile FORMAT_VOL_PARAMETERS *volParams, volatile handleWin32Error (hwndDlg, SRC_POS); - AbortProcess ("CANT_DISMOUNT_VOLUME"); + AbortProcess ("CANT_UNMOUNT_VOLUME"); } @@ -2023,3 +2023,3 @@ static int DismountFileSystem (HWND hwndDlg, HANDLE dev, if (!bSilent) - ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_LOCK_OR_DISMOUNT_FILESYS", TRUE); + ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_LOCK_OR_UNMOUNT_FILESYS", TRUE); @@ -2030,3 +2030,3 @@ static int DismountFileSystem (HWND hwndDlg, HANDLE dev, && !bSilent - && AskWarnYesNo ("VOL_LOCK_FAILED_OFFER_FORCED_DISMOUNT", hwndDlg) == IDNO) + && AskWarnYesNo ("VOL_LOCK_FAILED_OFFER_FORCED_UNMOUNT", hwndDlg) == IDNO) { @@ -2050,3 +2050,3 @@ static int DismountFileSystem (HWND hwndDlg, HANDLE dev, if (!bSilent) - ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_LOCK_OR_DISMOUNT_FILESYS", TRUE); + ShowInPlaceEncErrMsgWAltSteps (hwndDlg, "INPLACE_ENC_CANT_LOCK_OR_UNMOUNT_FILESYS", TRUE); diff --git a/src/Format/InPlace.h b/src/Format/InPlace.h index 717a8ed3..30c59b7e 100644 --- a/src/Format/InPlace.h +++ b/src/Format/InPlace.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index dd7ff18b..d26564fc 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -7856,3 +7856,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa { - if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY) + if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY) { @@ -7934,3 +7934,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa { - if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY) + if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY) { @@ -8025,3 +8025,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa handleWin32Error (MainDlg, SRC_POS); - AbortProcess ("CANT_DISMOUNT_VOLUME"); + AbortProcess ("CANT_UNMOUNT_VOLUME"); } @@ -8080,3 +8080,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa handleWin32Error (MainDlg, SRC_POS); - AbortProcess ("CANT_DISMOUNT_VOLUME"); + AbortProcess ("CANT_UNMOUNT_VOLUME"); } @@ -8094,3 +8094,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa handleWin32Error (MainDlg, SRC_POS); - AbortProcess ("CANT_DISMOUNT_VOLUME"); + AbortProcess ("CANT_UNMOUNT_VOLUME"); } @@ -8717,3 +8717,3 @@ retryCDDriveCheck: { - if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL | MB_ICONERROR | MB_SETFOREGROUND) != IDRETRY) + if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL | MB_ICONERROR | MB_SETFOREGROUND) != IDRETRY) { @@ -8786,3 +8786,3 @@ retryCDDriveCheck: { - if (MessageBoxW (hwndDlg, GetString ("CANT_DISMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY) + if (MessageBoxW (hwndDlg, GetString ("CANT_UNMOUNT_OUTER_VOL"), lpszTitle, MB_RETRYCANCEL) != IDRETRY) { @@ -10590,3 +10590,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz - DetectX86Features (); +#ifndef _M_ARM64 + DetectX86Features(); +#else + DetectArmFeatures(); +#endif diff --git a/src/Format/Tcformat.h b/src/Format/Tcformat.h index f9328afd..dd8bf793 100644 --- a/src/Format/Tcformat.h +++ b/src/Format/Tcformat.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/LICENSE b/src/LICENSE index 2e1779a0..0872b542 100644 --- a/src/LICENSE +++ b/src/LICENSE @@ -177,3 +177,3 @@ END OF TERMS AND CONDITIONS -Copyright 2013-2024 IDRIX +Copyright 2013-2025 IDRIX diff --git a/src/Main/Application.cpp b/src/Main/Application.cpp index 27b8f55a..7948235e 100644 --- a/src/Main/Application.cpp +++ b/src/Main/Application.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Application.h b/src/Main/Application.h index 82c6b00e..4bc9c199 100644 --- a/src/Main/Application.h +++ b/src/Main/Application.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/CommandLineInterface.cpp b/src/Main/CommandLineInterface.cpp index 735cbeef..2d38a5bd 100644 --- a/src/Main/CommandLineInterface.cpp +++ b/src/Main/CommandLineInterface.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -34,5 +34,6 @@ namespace VeraCrypt ArgUseLegacyPassword (false), -#if defined(TC_LINUX ) || defined (TC_FREEBSD) ArgUseDummySudoPassword (false), -#endif +#if defined(TC_UNIX) + ArgAllowInsecureMount (false), + #endif StartBackgroundTask (false) @@ -57,3 +58,4 @@ namespace VeraCrypt parser.AddSwitch (L"", L"delete-token-keyfiles", _("Delete security token keyfiles")); - parser.AddSwitch (L"d", L"dismount", _("Dismount volume")); + parser.AddSwitch (L"d", L"dismount", _("Unmount volume (deprecated: use 'unmount')")); + parser.AddSwitch (L"u", L"unmount", _("Unmount volume")); parser.AddSwitch (L"", L"display-password", _("Display password while typing")); @@ -63,3 +65,3 @@ namespace VeraCrypt parser.AddOption (L"", L"filesystem", _("Filesystem type")); - parser.AddSwitch (L"f", L"force", _("Force mount/dismount/overwrite")); + parser.AddSwitch (L"f", L"force", _("Force mount/unmount/overwrite")); #if !defined(TC_WINDOWS) && !defined(TC_MACOSX) @@ -112,2 +114,5 @@ namespace VeraCrypt #endif +#if defined(TC_UNIX) + parser.AddSwitch (L"", L"allow-insecure-mount", _("Allow mounting volumes on mount points that are in the user's PATH")); +#endif wxString str; @@ -220,3 +225,3 @@ namespace VeraCrypt - if (parser.Found (L"dismount")) + if (parser.Found (L"unmount") || parser.Found (L"dismount")) { @@ -377,3 +382,3 @@ namespace VeraCrypt ArgDisableFileSizeCheck = parser.Found (L"no-size-check"); - ArgUseLegacyPassword = parser.Found (L"legacy-password-maxlength"); + ArgUseLegacyPassword = parser.Found (L"legacy-password-maxlength"); #if defined(TC_LINUX ) || defined (TC_FREEBSD) @@ -382,2 +387,6 @@ namespace VeraCrypt +#if defined(TC_UNIX) + ArgAllowInsecureMount = parser.Found (L"allow-insecure-mount"); +#endif + #if !defined(TC_WINDOWS) && !defined(TC_MACOSX) diff --git a/src/Main/CommandLineInterface.h b/src/Main/CommandLineInterface.h index f773ca6f..c255feb0 100644 --- a/src/Main/CommandLineInterface.h +++ b/src/Main/CommandLineInterface.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -89,4 +89,6 @@ namespace VeraCrypt bool ArgUseLegacyPassword; -#if defined(TC_LINUX ) || defined (TC_FREEBSD) bool ArgUseDummySudoPassword; + +#if defined(TC_UNIX) + bool ArgAllowInsecureMount; #endif diff --git a/src/Main/FatalErrorHandler.cpp b/src/Main/FatalErrorHandler.cpp index 5e391698..092a65dc 100644 --- a/src/Main/FatalErrorHandler.cpp +++ b/src/Main/FatalErrorHandler.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/FatalErrorHandler.h b/src/Main/FatalErrorHandler.h index d787cdd7..c037d80f 100644 --- a/src/Main/FatalErrorHandler.h +++ b/src/Main/FatalErrorHandler.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/FavoriteVolume.cpp b/src/Main/FavoriteVolume.cpp index 0b6ff146..e804e15b 100644 --- a/src/Main/FavoriteVolume.cpp +++ b/src/Main/FavoriteVolume.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/FavoriteVolume.h b/src/Main/FavoriteVolume.h index 7bc6a430..f59a10f1 100644 --- a/src/Main/FavoriteVolume.h +++ b/src/Main/FavoriteVolume.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/AboutDialog.cpp b/src/Main/Forms/AboutDialog.cpp index 01c579d5..9b92ed0b 100644 --- a/src/Main/Forms/AboutDialog.cpp +++ b/src/Main/Forms/AboutDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -63,3 +63,3 @@ namespace VeraCrypt L"Portions of this software:\n" - L"Copyright \xA9 2013-2024 IDRIX. All rights reserved.\n" + L"Copyright \xA9 2013-2025 IDRIX. All rights reserved.\n" L"Copyright \xA9 2003-2012 TrueCrypt Developers Association. All Rights Reserved.\n" @@ -76,3 +76,3 @@ namespace VeraCrypt L"\nThis software as a whole:\n" - L"Copyright \xA9 2013-2024 IDRIX. All rights reserved.\n\n" + L"Copyright \xA9 2013-2025 IDRIX. All rights reserved.\n\n" diff --git a/src/Main/Forms/AboutDialog.h b/src/Main/Forms/AboutDialog.h index 7ce64b98..01cf5e90 100644 --- a/src/Main/Forms/AboutDialog.h +++ b/src/Main/Forms/AboutDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/BenchmarkDialog.cpp b/src/Main/Forms/BenchmarkDialog.cpp index 6e2cff64..168630fa 100644 --- a/src/Main/Forms/BenchmarkDialog.cpp +++ b/src/Main/Forms/BenchmarkDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/BenchmarkDialog.h b/src/Main/Forms/BenchmarkDialog.h index 16a5446b..3b17e20b 100644 --- a/src/Main/Forms/BenchmarkDialog.h +++ b/src/Main/Forms/BenchmarkDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/ChangePasswordDialog.cpp b/src/Main/Forms/ChangePasswordDialog.cpp index 39da8e60..6b613b05 100644 --- a/src/Main/Forms/ChangePasswordDialog.cpp +++ b/src/Main/Forms/ChangePasswordDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/ChangePasswordDialog.h b/src/Main/Forms/ChangePasswordDialog.h index 66fbfecf..88ced0ae 100644 --- a/src/Main/Forms/ChangePasswordDialog.h +++ b/src/Main/Forms/ChangePasswordDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/DeviceSelectionDialog.cpp b/src/Main/Forms/DeviceSelectionDialog.cpp index df4292c9..9573414c 100644 --- a/src/Main/Forms/DeviceSelectionDialog.cpp +++ b/src/Main/Forms/DeviceSelectionDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/DeviceSelectionDialog.h b/src/Main/Forms/DeviceSelectionDialog.h index 2ab7a9ce..960d90af 100644 --- a/src/Main/Forms/DeviceSelectionDialog.h +++ b/src/Main/Forms/DeviceSelectionDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.cpp b/src/Main/Forms/EncryptionOptionsWizardPage.cpp index 663a6129..594c0c0a 100644 --- a/src/Main/Forms/EncryptionOptionsWizardPage.cpp +++ b/src/Main/Forms/EncryptionOptionsWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/EncryptionOptionsWizardPage.h b/src/Main/Forms/EncryptionOptionsWizardPage.h index fbc63f9e..07b357c1 100644 --- a/src/Main/Forms/EncryptionOptionsWizardPage.h +++ b/src/Main/Forms/EncryptionOptionsWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/EncryptionTestDialog.cpp b/src/Main/Forms/EncryptionTestDialog.cpp index af3f9833..47918532 100644 --- a/src/Main/Forms/EncryptionTestDialog.cpp +++ b/src/Main/Forms/EncryptionTestDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/EncryptionTestDialog.h b/src/Main/Forms/EncryptionTestDialog.h index 3ba7d5e3..67e033b9 100644 --- a/src/Main/Forms/EncryptionTestDialog.h +++ b/src/Main/Forms/EncryptionTestDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/FavoriteVolumesDialog.cpp b/src/Main/Forms/FavoriteVolumesDialog.cpp index a0c48f92..ee92a47a 100644 --- a/src/Main/Forms/FavoriteVolumesDialog.cpp +++ b/src/Main/Forms/FavoriteVolumesDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/FavoriteVolumesDialog.h b/src/Main/Forms/FavoriteVolumesDialog.h index adbf400d..3b5cd828 100644 --- a/src/Main/Forms/FavoriteVolumesDialog.h +++ b/src/Main/Forms/FavoriteVolumesDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/Forms.cpp b/src/Main/Forms/Forms.cpp index 9ffad555..6e1432a3 100644 --- a/src/Main/Forms/Forms.cpp +++ b/src/Main/Forms/Forms.cpp @@ -1823,11 +1823,11 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c - AutoDismountSizer = new wxStaticBoxSizer( new wxStaticBox( SecurityPage, wxID_ANY, _("IDT_AUTO_DISMOUNT") ), wxVERTICAL ); + AutoDismountSizer = new wxStaticBoxSizer( new wxStaticBox( SecurityPage, wxID_ANY, _("IDT_AUTO_UNMOUNT") ), wxVERTICAL ); wxStaticBoxSizer* sbSizer13; - sbSizer13 = new wxStaticBoxSizer( new wxStaticBox( AutoDismountSizer->GetStaticBox(), wxID_ANY, _("LINUX_DISMOUNT_ALL_WHEN") ), wxVERTICAL ); + sbSizer13 = new wxStaticBoxSizer( new wxStaticBox( AutoDismountSizer->GetStaticBox(), wxID_ANY, _("LINUX_UNMOUNT_ALL_WHEN") ), wxVERTICAL ); - DismountOnLogOffCheckBox = new wxCheckBox( sbSizer13->GetStaticBox(), wxID_ANY, _("IDC_PREF_DISMOUNT_LOGOFF"), wxDefaultPosition, wxDefaultSize, 0 ); + DismountOnLogOffCheckBox = new wxCheckBox( sbSizer13->GetStaticBox(), wxID_ANY, _("IDC_PREF_UNMOUNT_LOGOFF"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer13->Add( DismountOnLogOffCheckBox, 0, wxALL, 5 ); - DismountOnScreenSaverCheckBox = new wxCheckBox( sbSizer13->GetStaticBox(), wxID_ANY, _("IDC_PREF_DISMOUNT_SCREENSAVER"), wxDefaultPosition, wxDefaultSize, 0 ); + DismountOnScreenSaverCheckBox = new wxCheckBox( sbSizer13->GetStaticBox(), wxID_ANY, _("IDC_PREF_UNMOUNT_SCREENSAVER"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer13->Add( DismountOnScreenSaverCheckBox, 0, wxALL, 5 ); @@ -1843,3 +1843,3 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c - DismountOnInactivityCheckBox = new wxCheckBox( AutoDismountSizer->GetStaticBox(), wxID_ANY, _("IDC_PREF_DISMOUNT_INACTIVE"), wxDefaultPosition, wxDefaultSize, 0 ); + DismountOnInactivityCheckBox = new wxCheckBox( AutoDismountSizer->GetStaticBox(), wxID_ANY, _("IDC_PREF_UNMOUNT_INACTIVE"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer34->Add( DismountOnInactivityCheckBox, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); @@ -1859,3 +1859,3 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c - ForceAutoDismountCheckBox = new wxCheckBox( AutoDismountSizer->GetStaticBox(), wxID_ANY, _("IDC_PREF_FORCE_AUTO_DISMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); + ForceAutoDismountCheckBox = new wxCheckBox( AutoDismountSizer->GetStaticBox(), wxID_ANY, _("IDC_PREF_FORCE_AUTO_UNMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); AutoDismountSizer->Add( ForceAutoDismountCheckBox, 0, wxALL, 5 ); @@ -1879,3 +1879,3 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c - WipeCacheOnAutoDismountCheckBox = new wxCheckBox( sbSizer14->GetStaticBox(), wxID_ANY, _("IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); + WipeCacheOnAutoDismountCheckBox = new wxCheckBox( sbSizer14->GetStaticBox(), wxID_ANY, _("IDC_PREF_WIPE_CACHE_ON_AUTOUNMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer14->Add( WipeCacheOnAutoDismountCheckBox, 0, wxALL, 5 ); @@ -1985,3 +1985,3 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c - BackgroundTaskMenuDismountItemsEnabledCheckBox = new wxCheckBox( sbSizer26->GetStaticBox(), wxID_ANY, _("TASKICON_PREF_DISMOUNT_VOL"), wxDefaultPosition, wxDefaultSize, 0 ); + BackgroundTaskMenuDismountItemsEnabledCheckBox = new wxCheckBox( sbSizer26->GetStaticBox(), wxID_ANY, _("TASKICON_PREF_UNMOUNT_VOL"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer26->Add( BackgroundTaskMenuDismountItemsEnabledCheckBox, 0, wxALL, 5 ); @@ -2028,3 +2028,3 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c - CloseExplorerWindowsOnDismountCheckBox = new wxCheckBox( ExplorerSizer->GetStaticBox(), wxID_ANY, _("LINUX_CLOSE_EXPL_ON_DISMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); + CloseExplorerWindowsOnDismountCheckBox = new wxCheckBox( ExplorerSizer->GetStaticBox(), wxID_ANY, _("LINUX_CLOSE_EXPL_ON_UNMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); ExplorerSizer->Add( CloseExplorerWindowsOnDismountCheckBox, 0, wxALL, 5 ); @@ -2240,3 +2240,3 @@ PreferencesDialogBase::PreferencesDialogBase( wxWindow* parent, wxWindowID id, c - DisplayMessageAfterHotkeyDismountCheckBox = new wxCheckBox( sbSizer24->GetStaticBox(), wxID_ANY, _("LINUX_CONFIRM_AFTER_DISMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); + DisplayMessageAfterHotkeyDismountCheckBox = new wxCheckBox( sbSizer24->GetStaticBox(), wxID_ANY, _("LINUX_CONFIRM_AFTER_UNMOUNT"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer24->Add( DisplayMessageAfterHotkeyDismountCheckBox, 0, wxALL, 5 ); diff --git a/src/Main/Forms/InfoWizardPage.cpp b/src/Main/Forms/InfoWizardPage.cpp index 6d8cf926..465f1693 100644 --- a/src/Main/Forms/InfoWizardPage.cpp +++ b/src/Main/Forms/InfoWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/InfoWizardPage.h b/src/Main/Forms/InfoWizardPage.h index aa7da264..0a4c3324 100644 --- a/src/Main/Forms/InfoWizardPage.h +++ b/src/Main/Forms/InfoWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/KeyfileGeneratorDialog.cpp b/src/Main/Forms/KeyfileGeneratorDialog.cpp index 85443f45..58224e18 100644 --- a/src/Main/Forms/KeyfileGeneratorDialog.cpp +++ b/src/Main/Forms/KeyfileGeneratorDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/KeyfileGeneratorDialog.h b/src/Main/Forms/KeyfileGeneratorDialog.h index 7b8b2b29..de3a1287 100644 --- a/src/Main/Forms/KeyfileGeneratorDialog.h +++ b/src/Main/Forms/KeyfileGeneratorDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/KeyfilesDialog.cpp b/src/Main/Forms/KeyfilesDialog.cpp index c734b4d9..d81b101f 100644 --- a/src/Main/Forms/KeyfilesDialog.cpp +++ b/src/Main/Forms/KeyfilesDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/KeyfilesDialog.h b/src/Main/Forms/KeyfilesDialog.h index 2ee601e3..2abaf713 100644 --- a/src/Main/Forms/KeyfilesDialog.h +++ b/src/Main/Forms/KeyfilesDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/KeyfilesPanel.cpp b/src/Main/Forms/KeyfilesPanel.cpp index e3d086fc..4439ff36 100644 --- a/src/Main/Forms/KeyfilesPanel.cpp +++ b/src/Main/Forms/KeyfilesPanel.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/KeyfilesPanel.h b/src/Main/Forms/KeyfilesPanel.h index ef680d49..d22abb8b 100644 --- a/src/Main/Forms/KeyfilesPanel.h +++ b/src/Main/Forms/KeyfilesPanel.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/LegalNoticesDialog.cpp b/src/Main/Forms/LegalNoticesDialog.cpp index ce7e442c..0de62897 100644 --- a/src/Main/Forms/LegalNoticesDialog.cpp +++ b/src/Main/Forms/LegalNoticesDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/LegalNoticesDialog.h b/src/Main/Forms/LegalNoticesDialog.h index 31df666b..0769fdb7 100644 --- a/src/Main/Forms/LegalNoticesDialog.h +++ b/src/Main/Forms/LegalNoticesDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp index 77f371d8..59329e09 100644 --- a/src/Main/Forms/MainFrame.cpp +++ b/src/Main/Forms/MainFrame.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -527,3 +527,3 @@ namespace VeraCrypt Gui->AppendToMenu (*popup, LangString["IDM_MOUNT_FAVORITE_VOLUMES"], this, wxCommandEventHandler (TaskBarIcon::OnMountAllFavoritesMenuItemSelected))->Enable (!Busy); - Gui->AppendToMenu (*popup, LangString["HK_DISMOUNT_ALL"], this, wxCommandEventHandler (TaskBarIcon::OnDismountAllMenuItemSelected))->Enable (!Busy); + Gui->AppendToMenu (*popup, LangString["HK_UNMOUNT_ALL"], this, wxCommandEventHandler (TaskBarIcon::OnDismountAllMenuItemSelected))->Enable (!Busy); @@ -567,3 +567,3 @@ namespace VeraCrypt { - wxString label = LangString["DISMOUNT"] + L" "; + wxString label = LangString["UNMOUNT"] + L" "; @@ -1010,3 +1010,3 @@ namespace VeraCrypt if (newMountedCount == 0 && GetPreferences().DisplayMessageAfterHotkeyDismount) - Gui->ShowInfo ("MOUNTED_VOLUMES_DISMOUNTED"); + Gui->ShowInfo ("MOUNTED_VOLUMES_UNMOUNTED"); else if (GetPreferences().BeepAfterHotkeyMountDismount) @@ -1026,3 +1026,3 @@ namespace VeraCrypt if (mounted && GetPreferences().DisplayMessageAfterHotkeyDismount) - Gui->ShowInfo ("VOLUMES_DISMOUNTED_CACHE_WIPED"); + Gui->ShowInfo ("VOLUMES_UNMOUNTED_CACHE_WIPED"); else if (mounted && GetPreferences().BeepAfterHotkeyMountDismount) @@ -1151,3 +1151,3 @@ namespace VeraCrypt { - Gui->AppendToMenu (popup, LangString["DISMOUNT"], this, wxCommandEventHandler (MainFrame::OnDismountVolumeMenuItemSelected)); + Gui->AppendToMenu (popup, LangString["UNMOUNT"], this, wxCommandEventHandler (MainFrame::OnDismountVolumeMenuItemSelected)); Gui->AppendToMenu (popup, LangString["OPEN"], this, wxCommandEventHandler (MainFrame::OnOpenVolumeMenuItemSelected)); @@ -1623,3 +1623,3 @@ namespace VeraCrypt - indicator_item_dismountall = gtk_menu_item_new_with_label (LangString["HK_DISMOUNT_ALL"]); + indicator_item_dismountall = gtk_menu_item_new_with_label (LangString["HK_UNMOUNT_ALL"]); gtk_menu_shell_append (GTK_MENU_SHELL (menu), indicator_item_dismountall); diff --git a/src/Main/Forms/MainFrame.h b/src/Main/Forms/MainFrame.h index ed1c44f7..9b2b4eb0 100644 --- a/src/Main/Forms/MainFrame.h +++ b/src/Main/Forms/MainFrame.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/MountOptionsDialog.cpp b/src/Main/Forms/MountOptionsDialog.cpp index 85a06d1e..32b7ae57 100644 --- a/src/Main/Forms/MountOptionsDialog.cpp +++ b/src/Main/Forms/MountOptionsDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -36,2 +36,5 @@ namespace VeraCrypt ), Options (options) +#ifdef TC_UNIX + , m_showRedBorder(false) +#endif { @@ -44,2 +47,12 @@ namespace VeraCrypt +#ifdef TC_UNIX + if (Gui->InsecureMountAllowed()) + { + this->SetTitle (LangString["INSECURE_MODE"] + L" - " + this->GetTitle()); + m_showRedBorder = true; + Bind(wxEVT_PAINT, &MountOptionsDialog::OnPaint, this); + Bind(wxEVT_SIZE, &MountOptionsDialog::OnSize, this); + } +#endif + if (disableMountOptions) @@ -232,2 +245,25 @@ namespace VeraCrypt } + +#ifdef TC_UNIX + void MountOptionsDialog::OnPaint(wxPaintEvent& event) + { + wxPaintDC dc(this); + if (m_showRedBorder) + { + wxSize size = GetClientSize(); + wxPen pen(*wxRED, 3); // 3 pixels width + dc.SetPen(pen); + dc.SetBrush(*wxTRANSPARENT_BRUSH); + dc.DrawRectangle(0, 0, size.GetWidth(), size.GetHeight()); + } + event.Skip(); + } + + void MountOptionsDialog::OnSize(wxSizeEvent& event) + { + event.Skip(); + if (m_showRedBorder) + Refresh(); + } +#endif } diff --git a/src/Main/Forms/MountOptionsDialog.h b/src/Main/Forms/MountOptionsDialog.h index 6366ce85..b9bf38ea 100644 --- a/src/Main/Forms/MountOptionsDialog.h +++ b/src/Main/Forms/MountOptionsDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -42,3 +42,12 @@ namespace VeraCrypt +#ifdef TC_UNIX + // Used for displaying a red border around the dialog window when insecure mode is enabled + void OnPaint(wxPaintEvent& event); + void OnSize(wxSizeEvent& event); +#endif + MountOptions &Options; +#ifdef TC_UNIX + bool m_showRedBorder; +#endif wxString OptionsButtonLabel; diff --git a/src/Main/Forms/NewSecurityTokenKeyfileDialog.cpp b/src/Main/Forms/NewSecurityTokenKeyfileDialog.cpp index e52d2f60..09dfe5d5 100644 --- a/src/Main/Forms/NewSecurityTokenKeyfileDialog.cpp +++ b/src/Main/Forms/NewSecurityTokenKeyfileDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/NewSecurityTokenKeyfileDialog.h b/src/Main/Forms/NewSecurityTokenKeyfileDialog.h index faa76283..f956462f 100644 --- a/src/Main/Forms/NewSecurityTokenKeyfileDialog.h +++ b/src/Main/Forms/NewSecurityTokenKeyfileDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/PreferencesDialog.cpp b/src/Main/Forms/PreferencesDialog.cpp index 4e7644b6..4a6eaec0 100644 --- a/src/Main/Forms/PreferencesDialog.cpp +++ b/src/Main/Forms/PreferencesDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -423,3 +423,3 @@ namespace VeraCrypt if (event.IsChecked() && !ForceAutoDismountCheckBox->IsChecked()) - Gui->ShowWarning ("WARN_PREF_AUTO_DISMOUNT"); + Gui->ShowWarning ("WARN_PREF_AUTO_UNMOUNT"); } @@ -429,3 +429,3 @@ namespace VeraCrypt if (event.IsChecked() && !ForceAutoDismountCheckBox->IsChecked()) - Gui->ShowWarning ("WARN_PREF_AUTO_DISMOUNT"); + Gui->ShowWarning ("WARN_PREF_AUTO_UNMOUNT"); } @@ -435,3 +435,3 @@ namespace VeraCrypt if (!event.IsChecked()) - ForceAutoDismountCheckBox->SetValue (!Gui->AskYesNo (LangString["CONFIRM_NO_FORCED_AUTODISMOUNT"], false, true)); + ForceAutoDismountCheckBox->SetValue (!Gui->AskYesNo (LangString["CONFIRM_NO_FORCED_AUTOUNMOUNT"], false, true)); } diff --git a/src/Main/Forms/PreferencesDialog.h b/src/Main/Forms/PreferencesDialog.h index 5e7f7e71..8e1e7363 100644 --- a/src/Main/Forms/PreferencesDialog.h +++ b/src/Main/Forms/PreferencesDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/ProgressWizardPage.cpp b/src/Main/Forms/ProgressWizardPage.cpp index a827b718..83c32ba9 100644 --- a/src/Main/Forms/ProgressWizardPage.cpp +++ b/src/Main/Forms/ProgressWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/ProgressWizardPage.h b/src/Main/Forms/ProgressWizardPage.h index 34f5cf4d..6a7a732c 100644 --- a/src/Main/Forms/ProgressWizardPage.h +++ b/src/Main/Forms/ProgressWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/RandomPoolEnrichmentDialog.cpp b/src/Main/Forms/RandomPoolEnrichmentDialog.cpp index b48d5af6..3fc2e113 100644 --- a/src/Main/Forms/RandomPoolEnrichmentDialog.cpp +++ b/src/Main/Forms/RandomPoolEnrichmentDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/RandomPoolEnrichmentDialog.h b/src/Main/Forms/RandomPoolEnrichmentDialog.h index a29109f1..2b2745e3 100644 --- a/src/Main/Forms/RandomPoolEnrichmentDialog.h +++ b/src/Main/Forms/RandomPoolEnrichmentDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp b/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp index bbbeff74..19eb196d 100644 --- a/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp +++ b/src/Main/Forms/SecurityTokenKeyfilesDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/SecurityTokenKeyfilesDialog.h b/src/Main/Forms/SecurityTokenKeyfilesDialog.h index 92119e1e..ec6bafdb 100644 --- a/src/Main/Forms/SecurityTokenKeyfilesDialog.h +++ b/src/Main/Forms/SecurityTokenKeyfilesDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/SelectDirectoryWizardPage.cpp b/src/Main/Forms/SelectDirectoryWizardPage.cpp index a81b9fea..1831996a 100644 --- a/src/Main/Forms/SelectDirectoryWizardPage.cpp +++ b/src/Main/Forms/SelectDirectoryWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/SelectDirectoryWizardPage.h b/src/Main/Forms/SelectDirectoryWizardPage.h index 39517c56..069fab5f 100644 --- a/src/Main/Forms/SelectDirectoryWizardPage.h +++ b/src/Main/Forms/SelectDirectoryWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/SingleChoiceWizardPage.h b/src/Main/Forms/SingleChoiceWizardPage.h index 2398672d..2f137583 100644 --- a/src/Main/Forms/SingleChoiceWizardPage.h +++ b/src/Main/Forms/SingleChoiceWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/TrueCrypt.fbp b/src/Main/Forms/TrueCrypt.fbp index 0b40a99e..3c911652 100644 --- a/src/Main/Forms/TrueCrypt.fbp +++ b/src/Main/Forms/TrueCrypt.fbp @@ -10956,3 +10956,3 @@ <property name="id">wxID_ANY</property> - <property name="label">IDT_AUTO_DISMOUNT</property> + <property name="label">IDT_AUTO_UNMOUNT</property> <property name="minimum_size"></property> @@ -10968,3 +10968,3 @@ <property name="id">wxID_ANY</property> - <property name="label">LINUX_DISMOUNT_ALL_WHEN</property> + <property name="label">LINUX_UNMOUNT_ALL_WHEN</property> <property name="minimum_size"></property> @@ -11007,3 +11007,3 @@ <property name="id">wxID_ANY</property> - <property name="label">IDC_PREF_DISMOUNT_LOGOFF</property> + <property name="label">IDC_PREF_UNMOUNT_LOGOFF</property> <property name="max_size"></property> @@ -11071,3 +11071,3 @@ <property name="id">wxID_ANY</property> - <property name="label">IDC_PREF_DISMOUNT_SCREENSAVER</property> + <property name="label">IDC_PREF_UNMOUNT_SCREENSAVER</property> <property name="max_size"></property> @@ -11212,3 +11212,3 @@ <property name="id">wxID_ANY</property> - <property name="label">IDC_PREF_DISMOUNT_INACTIVE</property> + <property name="label">IDC_PREF_UNMOUNT_INACTIVE</property> <property name="max_size"></property> @@ -11401,3 +11401,3 @@ <property name="id">wxID_ANY</property> - <property name="label">IDC_PREF_FORCE_AUTO_DISMOUNT</property> + <property name="label">IDC_PREF_FORCE_AUTO_UNMOUNT</property> <property name="max_size"></property> @@ -11623,3 +11623,3 @@ <property name="id">wxID_ANY</property> - <property name="label">IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT</property> + <property name="label">IDC_PREF_WIPE_CACHE_ON_AUTOUNMOUNT</property> <property name="max_size"></property> @@ -12617,3 +12617,3 @@ <property name="id">wxID_ANY</property> - <property name="label">TASKICON_PREF_DISMOUNT_VOL</property> + <property name="label">TASKICON_PREF_UNMOUNT_VOL</property> <property name="max_size"></property> @@ -13041,3 +13041,3 @@ <property name="id">wxID_ANY</property> - <property name="label">LINUX_CLOSE_EXPL_ON_DISMOUNT</property> + <property name="label">LINUX_CLOSE_EXPL_ON_UNMOUNT</property> <property name="max_size"></property> @@ -14849,3 +14849,3 @@ <property name="id">wxID_ANY</property> - <property name="label">LINUX_CONFIRM_AFTER_DISMOUNT</property> + <property name="label">LINUX_CONFIRM_AFTER_UNMOUNT</property> <property name="max_size"></property> diff --git a/src/Main/Forms/VolumeCreationProgressWizardPage.cpp b/src/Main/Forms/VolumeCreationProgressWizardPage.cpp index 5739949c..9afb19c7 100644 --- a/src/Main/Forms/VolumeCreationProgressWizardPage.cpp +++ b/src/Main/Forms/VolumeCreationProgressWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeCreationProgressWizardPage.h b/src/Main/Forms/VolumeCreationProgressWizardPage.h index fad4ac93..d3484aef 100644 --- a/src/Main/Forms/VolumeCreationProgressWizardPage.h +++ b/src/Main/Forms/VolumeCreationProgressWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeCreationWizard.cpp b/src/Main/Forms/VolumeCreationWizard.cpp index 311738ca..bbf9fe0d 100644 --- a/src/Main/Forms/VolumeCreationWizard.cpp +++ b/src/Main/Forms/VolumeCreationWizard.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -624,3 +624,3 @@ namespace VeraCrypt { - Gui->ShowInfo ("DISMOUNT_FIRST"); + Gui->ShowInfo ("UNMOUNT_FIRST"); return GetCurrentStep(); diff --git a/src/Main/Forms/VolumeCreationWizard.h b/src/Main/Forms/VolumeCreationWizard.h index fd4b3e06..9cae5899 100644 --- a/src/Main/Forms/VolumeCreationWizard.h +++ b/src/Main/Forms/VolumeCreationWizard.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp b/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp index 8d632059..5c2a087f 100644 --- a/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp +++ b/src/Main/Forms/VolumeFormatOptionsWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeFormatOptionsWizardPage.h b/src/Main/Forms/VolumeFormatOptionsWizardPage.h index b38f6e99..b9c21882 100644 --- a/src/Main/Forms/VolumeFormatOptionsWizardPage.h +++ b/src/Main/Forms/VolumeFormatOptionsWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeLocationWizardPage.cpp b/src/Main/Forms/VolumeLocationWizardPage.cpp index 313d7fee..f1a6eb43 100644 --- a/src/Main/Forms/VolumeLocationWizardPage.cpp +++ b/src/Main/Forms/VolumeLocationWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeLocationWizardPage.h b/src/Main/Forms/VolumeLocationWizardPage.h index 17ed39c2..709ab0b4 100644 --- a/src/Main/Forms/VolumeLocationWizardPage.h +++ b/src/Main/Forms/VolumeLocationWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp index 0555f339..7247c3ed 100644 --- a/src/Main/Forms/VolumePasswordPanel.cpp +++ b/src/Main/Forms/VolumePasswordPanel.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumePasswordPanel.h b/src/Main/Forms/VolumePasswordPanel.h index 7019e8fd..23180399 100644 --- a/src/Main/Forms/VolumePasswordPanel.h +++ b/src/Main/Forms/VolumePasswordPanel.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumePasswordWizardPage.cpp b/src/Main/Forms/VolumePasswordWizardPage.cpp index 859a613a..4f848896 100644 --- a/src/Main/Forms/VolumePasswordWizardPage.cpp +++ b/src/Main/Forms/VolumePasswordWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumePasswordWizardPage.h b/src/Main/Forms/VolumePasswordWizardPage.h index 525db216..128b76a3 100644 --- a/src/Main/Forms/VolumePasswordWizardPage.h +++ b/src/Main/Forms/VolumePasswordWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumePropertiesDialog.cpp b/src/Main/Forms/VolumePropertiesDialog.cpp index 3bba33bc..c0c944ae 100644 --- a/src/Main/Forms/VolumePropertiesDialog.cpp +++ b/src/Main/Forms/VolumePropertiesDialog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumePropertiesDialog.h b/src/Main/Forms/VolumePropertiesDialog.h index 277c8290..05dc490a 100644 --- a/src/Main/Forms/VolumePropertiesDialog.h +++ b/src/Main/Forms/VolumePropertiesDialog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeSizeWizardPage.cpp b/src/Main/Forms/VolumeSizeWizardPage.cpp index 08aa7052..5d4f5e82 100644 --- a/src/Main/Forms/VolumeSizeWizardPage.cpp +++ b/src/Main/Forms/VolumeSizeWizardPage.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/VolumeSizeWizardPage.h b/src/Main/Forms/VolumeSizeWizardPage.h index 754bd691..e2d928e6 100644 --- a/src/Main/Forms/VolumeSizeWizardPage.h +++ b/src/Main/Forms/VolumeSizeWizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/WaitDialog.cpp b/src/Main/Forms/WaitDialog.cpp index 102d479a..2489a17b 100644 --- a/src/Main/Forms/WaitDialog.cpp +++ b/src/Main/Forms/WaitDialog.cpp @@ -1,3 +1,3 @@ /* - Copyright (c) 2013-2017 IDRIX. All rights reserved. + Copyright (c) 2013-2025 IDRIX. All rights reserved. @@ -119,2 +119,5 @@ namespace VeraCrypt + VC_CONVERT_EXCEPTION (MountPointBlocked); + VC_CONVERT_EXCEPTION (MountPointNotAllowed); + throw *ex; diff --git a/src/Main/Forms/WaitDialog.h b/src/Main/Forms/WaitDialog.h index 53f5048b..fd3a80be 100644 --- a/src/Main/Forms/WaitDialog.h +++ b/src/Main/Forms/WaitDialog.h @@ -1,3 +1,3 @@ /* - Copyright (c) 2013-2018 IDRIX. All rights reserved. + Copyright (c) 2013-2025 IDRIX. All rights reserved. diff --git a/src/Main/Forms/WizardFrame.cpp b/src/Main/Forms/WizardFrame.cpp index 1a6d1eea..298de6ae 100644 --- a/src/Main/Forms/WizardFrame.cpp +++ b/src/Main/Forms/WizardFrame.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/WizardFrame.h b/src/Main/Forms/WizardFrame.h index 86a53957..c5ea5950 100644 --- a/src/Main/Forms/WizardFrame.h +++ b/src/Main/Forms/WizardFrame.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Forms/WizardPage.h b/src/Main/Forms/WizardPage.h index 1bc5b82e..b6b1ca81 100644 --- a/src/Main/Forms/WizardPage.h +++ b/src/Main/Forms/WizardPage.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/GraphicUserInterface.cpp b/src/Main/GraphicUserInterface.cpp index b8098e95..75b326e5 100644 --- a/src/Main/GraphicUserInterface.cpp +++ b/src/Main/GraphicUserInterface.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -159,3 +159,3 @@ namespace VeraCrypt { - ShowInfo ("DISMOUNT_FIRST"); + ShowInfo ("UNMOUNT_FIRST"); return; @@ -1084,3 +1084,8 @@ namespace VeraCrypt mMainFrame = new MainFrame (nullptr); - +#if defined(TC_UNIX) + if (CmdLine->ArgAllowInsecureMount) + { + mMainFrame->SetTitle (mMainFrame->GetTitle() + wxT(" ") + LangString["INSECURE_MODE"]); + } +#endif if (CmdLine->StartBackgroundTask) @@ -1153,3 +1158,3 @@ namespace VeraCrypt if (Core->GetMountedVolumes().size() < volumeCount) - ShowInfoTopMost (LangString["MOUNTED_VOLUMES_AUTO_DISMOUNTED"]); + ShowInfoTopMost (LangString["MOUNTED_VOLUMES_AUTO_UNMOUNTED"]); } @@ -1415,3 +1420,3 @@ namespace VeraCrypt { - ShowInfo ("DISMOUNT_FIRST"); + ShowInfo ("UNMOUNT_FIRST"); return; diff --git a/src/Main/GraphicUserInterface.h b/src/Main/GraphicUserInterface.h index d333551c..9b6d3cb8 100644 --- a/src/Main/GraphicUserInterface.h +++ b/src/Main/GraphicUserInterface.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Hotkey.cpp b/src/Main/Hotkey.cpp index 8715dc01..ed6a2aff 100644 --- a/src/Main/Hotkey.cpp +++ b/src/Main/Hotkey.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -29,6 +29,6 @@ namespace VeraCrypt TC_HOTKEY (CloseAllSecurityTokenSessions, "IDM_CLOSE_ALL_TOKEN_SESSIONS"); - TC_HOTKEY (DismountAll, "HK_DISMOUNT_ALL"); - TC_HOTKEY (DismountAllWipeCache, "HK_DISMOUNT_ALL_AND_WIPE"); - TC_HOTKEY (ForceDismountAllWipeCache, "HK_FORCE_DISMOUNT_ALL_AND_WIPE"); - TC_HOTKEY (ForceDismountAllWipeCacheExit, "HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT"); + TC_HOTKEY (DismountAll, "HK_UNMOUNT_ALL"); + TC_HOTKEY (DismountAllWipeCache, "HK_UNMOUNT_ALL_AND_WIPE"); + TC_HOTKEY (ForceDismountAllWipeCache, "HK_FORCE_UNMOUNT_ALL_AND_WIPE"); + TC_HOTKEY (ForceDismountAllWipeCacheExit, "HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT"); TC_HOTKEY (MountAllDevices, "HK_AUTOMOUNT_DEVICES"); diff --git a/src/Main/Hotkey.h b/src/Main/Hotkey.h index 1ebd6bc7..b526da46 100644 --- a/src/Main/Hotkey.h +++ b/src/Main/Hotkey.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/LanguageStrings.cpp b/src/Main/LanguageStrings.cpp index 9a983712..24649ab7 100644 --- a/src/Main/LanguageStrings.cpp +++ b/src/Main/LanguageStrings.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/LanguageStrings.h b/src/Main/LanguageStrings.h index f69928c1..c2341158 100644 --- a/src/Main/LanguageStrings.h +++ b/src/Main/LanguageStrings.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Main.h b/src/Main/Main.h index f0dade49..87f88976 100644 --- a/src/Main/Main.h +++ b/src/Main/Main.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Resources.cpp b/src/Main/Resources.cpp index f00c14f7..5e5b68c8 100644 --- a/src/Main/Resources.cpp +++ b/src/Main/Resources.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Resources.h b/src/Main/Resources.h index 734c2ede..c2948618 100644 --- a/src/Main/Resources.h +++ b/src/Main/Resources.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/StringFormatter.cpp b/src/Main/StringFormatter.cpp index e64f85c3..2cae84bf 100644 --- a/src/Main/StringFormatter.cpp +++ b/src/Main/StringFormatter.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/StringFormatter.h b/src/Main/StringFormatter.h index d7f64dd0..7ffcf5da 100644 --- a/src/Main/StringFormatter.h +++ b/src/Main/StringFormatter.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/System.cpp b/src/Main/System.cpp index 3f2200dd..709101ad 100644 --- a/src/Main/System.cpp +++ b/src/Main/System.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/System.h b/src/Main/System.h index 9d7ebc91..1af8e1ae 100644 --- a/src/Main/System.h +++ b/src/Main/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/SystemPrecompiled.h b/src/Main/SystemPrecompiled.h index 07021786..1331d399 100644 --- a/src/Main/SystemPrecompiled.h +++ b/src/Main/SystemPrecompiled.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/TextUserInterface.cpp b/src/Main/TextUserInterface.cpp index 5dd778a0..5217199d 100644 --- a/src/Main/TextUserInterface.cpp +++ b/src/Main/TextUserInterface.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -292,3 +292,3 @@ namespace VeraCrypt if (Core->IsVolumeMounted (*volumePath)) - throw_err (LangString["DISMOUNT_FIRST"]); + throw_err (LangString["UNMOUNT_FIRST"]); #endif @@ -1539,3 +1539,3 @@ namespace VeraCrypt if (Core->IsVolumeMounted (*volumePath)) - throw_err (LangString["DISMOUNT_FIRST"]); + throw_err (LangString["UNMOUNT_FIRST"]); #endif diff --git a/src/Main/TextUserInterface.h b/src/Main/TextUserInterface.h index 34a7cb40..091e4cbd 100644 --- a/src/Main/TextUserInterface.h +++ b/src/Main/TextUserInterface.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Unix/Main.cpp b/src/Main/Unix/Main.cpp index ffc71a8d..4197dcaf 100644 --- a/src/Main/Unix/Main.cpp +++ b/src/Main/Unix/Main.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/UserInterface.cpp b/src/Main/UserInterface.cpp index b216101a..b507d9a3 100644 --- a/src/Main/UserInterface.cpp +++ b/src/Main/UserInterface.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -224,3 +224,3 @@ namespace VeraCrypt message += L'\n'; - message += StringFormatter (LangString["LINUX_VOL_DISMOUNTED"], wstring (volume->Path)); + message += StringFormatter (LangString["LINUX_VOL_UNMOUNTED"], wstring (volume->Path)); } @@ -498,4 +498,4 @@ namespace VeraCrypt EX2MSG (PasswordTooLong, StringFormatter (LangString["LINUX_EX2MSG_PASSWORDTOOLONG"], (int) VolumePassword::MaxSize)); - EX2MSG (PasswordUTF8TooLong, LangString["PASSWORD_UTF8_TOO_LONG"]); - EX2MSG (PasswordLegacyUTF8TooLong, LangString["LEGACY_PASSWORD_UTF8_TOO_LONG"]); + EX2MSG (PasswordUTF8TooLong, StringFormatter (LangString["PASSWORD_UTF8_TOO_LONG"], (int) VolumePassword::MaxSize)); + EX2MSG (PasswordLegacyUTF8TooLong, StringFormatter (LangString["LEGACY_PASSWORD_UTF8_TOO_LONG"], (int) VolumePassword::MaxLegacySize)); EX2MSG (PasswordUTF8Invalid, LangString["PASSWORD_UTF8_INVALID"]); @@ -543,2 +543,5 @@ namespace VeraCrypt + EX2MSG (MountPointBlocked, LangString["MOUNTPOINT_BLOCKED"]); + EX2MSG (MountPointNotAllowed, LangString["MOUNTPOINT_NOTALLOWED"]); + #undef EX2MSG @@ -555,2 +558,5 @@ namespace VeraCrypt #endif +#if CRYPTOPP_BOOL_ARMV8 + DetectArmFeatures(); +#endif LangString.Init(); @@ -562,2 +568,3 @@ namespace VeraCrypt Core->SetApplicationExecutablePath (Application::GetExecutablePath()); + Core->SetUserEnvPATH (getenv ("PATH")); @@ -572,4 +579,6 @@ namespace VeraCrypt -#if defined(TC_LINUX ) || defined (TC_FREEBSD) Core->ForceUseDummySudoPassword (CmdLine->ArgUseDummySudoPassword); + +#if defined(TC_UNIX) + Core->SetAllowInsecureMount (CmdLine->ArgAllowInsecureMount); #endif @@ -876,7 +885,26 @@ namespace VeraCrypt #if !defined(TC_WINDOWS) && !defined(TC_MACOSX) -// Function to check if a given executable exists and is executable -static bool IsExecutable(const string& exe) { - return wxFileName::IsFileExecutable("/usr/bin/" + exe) || - wxFileName::IsFileExecutable("/usr/local/bin/" + exe); -} +// Define file manager structures with their required parameters +struct FileManager { + const char* name; + const char* const* baseArgs; + size_t baseArgsCount; +}; + +// Array of supported file managers with their parameters +static const char* const gioArgs[] = {"open"}; +static const char* const kioclient5Args[] = {"exec"}; +static const char* const kfmclientArgs[] = {"openURL"}; +static const char* const exoOpenArgs[] = {"--launch", "FileManager"}; + +const FileManager fileManagers[] = { + {"gio", gioArgs, 1}, + {"kioclient5", kioclient5Args, 1}, + {"kfmclient", kfmclientArgs, 1}, + {"exo-open", exoOpenArgs, 2}, + {"nautilus", NULL, 0}, + {"dolphin", NULL, 0}, + {"caja", NULL, 0}, + {"thunar", NULL, 0}, + {"pcmanfm", NULL, 0} +}; #endif @@ -902,3 +930,3 @@ static bool IsExecutable(const string& exe) { { - Process::Execute ("open", args); + Process::Execute ("/usr/bin/open", args); } @@ -909,6 +937,10 @@ static bool IsExecutable(const string& exe) { // Primary attempt: Use xdg-open - if (IsExecutable("xdg-open")) { - try { + string errorMsg; + string binPath = Process::FindSystemBinary("xdg-open", errorMsg); + if (!binPath.empty()) + { + try + { args.push_back(directoryPath); - Process::Execute("xdg-open", args, 2000); + Process::Execute(binPath, args, 2000); return; @@ -920,32 +952,19 @@ static bool IsExecutable(const string& exe) { // Fallback attempts: Try known file managers - const char* fallbackFileManagers[] = { "gio", "kioclient5", "kfmclient", "exo-open", "nautilus", "dolphin", "caja", "thunar", "pcmanfm" }; - const size_t numFileManagers = sizeof(fallbackFileManagers) / sizeof(fallbackFileManagers[0]); - + const size_t numFileManagers = sizeof(fileManagers) / sizeof(fileManagers[0]); for (size_t i = 0; i < numFileManagers; ++i) { - const char* fm = fallbackFileManagers[i]; - if (IsExecutable(fm)) { + const FileManager& fm = fileManagers[i]; + string fmPath = Process::FindSystemBinary(fm.name, errorMsg); + if (!fmPath.empty()) { args.clear(); - if (strcmp(fm, "gio") == 0) { - args.push_back("open"); - args.push_back(directoryPath); - } - else if (strcmp(fm, "kioclient5") == 0) { - args.push_back("exec"); - args.push_back(directoryPath); - } - else if (strcmp(fm, "kfmclient") == 0) { - args.push_back("openURL"); - args.push_back(directoryPath); - } - else if (strcmp(fm, "exo-open") == 0) { - args.push_back("--launch"); - args.push_back("FileManager"); - args.push_back(directoryPath); - } - else { - args.push_back(directoryPath); + + // Add base arguments first + for (size_t j = 0; j < fm.baseArgsCount; ++j) { + args.push_back(fm.baseArgs[j]); } + + // Add path argument + args.push_back(directoryPath); try { - Process::Execute(fm, args, 2000); + Process::Execute(fmPath, args, 2000); return; // Success @@ -1159,3 +1178,3 @@ static bool IsExecutable(const string& exe) { " 5) Mount the new filesystem and fill it with data.\n" - " 6) Dismount the outer volume.\n" + " 6) Unmount the outer volume.\n" " If at any step the hidden volume protection is triggered, start again from 1).\n" @@ -1171,5 +1190,5 @@ static bool IsExecutable(const string& exe) { "\n" - "-d, --dismount[=MOUNTED_VOLUME]\n" - " Dismount a mounted volume. If MOUNTED_VOLUME is not specified, all\n" - " volumes are dismounted. See below for description of MOUNTED_VOLUME.\n" + "-u, --unmount[=MOUNTED_VOLUME]\n" + " Unmount a mounted volume. If MOUNTED_VOLUME is not specified, all\n" + " volumes are unmounted. See below for description of MOUNTED_VOLUME.\n" "\n" @@ -1244,3 +1263,3 @@ static bool IsExecutable(const string& exe) { "--force\n" - " Force mounting of a volume in use, dismounting of a volume in use, or\n" + " Force mounting of a volume in use, unmounting of a volume in use, or\n" " overwriting a file. Note that this option has no effect on some platforms.\n" @@ -1280,3 +1299,3 @@ static bool IsExecutable(const string& exe) { " timestamp|ts: Do not restore host-file modification timestamp when a volume\n" - " is dismounted (note that the operating system under certain circumstances\n" + " is unmounted (note that the operating system under certain circumstances\n" " does not alter host-file timestamps, which may be mistakenly interpreted\n" @@ -1315,3 +1334,3 @@ static bool IsExecutable(const string& exe) { " Warning message is displayed when a volume switched to read-only is being\n" - " dismounted.\n" + " unmounted.\n" "\n" @@ -1336,3 +1355,3 @@ static bool IsExecutable(const string& exe) { "--slot=SLOT\n" - " Use specified slot number when mounting, dismounting, or listing a volume.\n" + " Use specified slot number when mounting, unmounting, or listing a volume.\n" "\n" @@ -1381,7 +1400,7 @@ static bool IsExecutable(const string& exe) { "\n" - "Dismount a volume:\n" - "veracrypt -d volume.hc\n" + "Unmount a volume:\n" + "veracrypt -u volume.hc\n" "\n" - "Dismount all mounted volumes:\n" - "veracrypt -d\n" + "Unmount all mounted volumes:\n" + "veracrypt -u\n" ); @@ -1640,2 +1659,9 @@ static bool IsExecutable(const string& exe) { +#ifdef TC_UNIX + bool UserInterface::InsecureMountAllowed () const + { + return CmdLine->ArgAllowInsecureMount; + } +#endif + #define VC_CONVERT_EXCEPTION(NAME) if (dynamic_cast<NAME*> (ex)) throw (NAME&) *ex; @@ -1728,2 +1754,5 @@ static bool IsExecutable(const string& exe) { + VC_CONVERT_EXCEPTION (MountPointBlocked); + VC_CONVERT_EXCEPTION (MountPointNotAllowed); + throw *ex; diff --git a/src/Main/UserInterface.h b/src/Main/UserInterface.h index 41415e9d..d04f0214 100644 --- a/src/Main/UserInterface.h +++ b/src/Main/UserInterface.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -88,3 +88,5 @@ namespace VeraCrypt virtual wxString VolumeTypeToString (VolumeType::Enum type, VolumeProtection::Enum protection) const; - +#ifdef TC_UNIX + virtual bool InsecureMountAllowed () const; +#endif Event PreferencesUpdatedEvent; diff --git a/src/Main/UserInterfaceException.h b/src/Main/UserInterfaceException.h index 8a8c7a60..8886a655 100644 --- a/src/Main/UserInterfaceException.h +++ b/src/Main/UserInterfaceException.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/UserInterfaceType.h b/src/Main/UserInterfaceType.h index 41208ccb..0afa36a8 100644 --- a/src/Main/UserInterfaceType.h +++ b/src/Main/UserInterfaceType.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/UserPreferences.cpp b/src/Main/UserPreferences.cpp index 194cb6df..d9d07b6d 100644 --- a/src/Main/UserPreferences.cpp +++ b/src/Main/UserPreferences.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/UserPreferences.h b/src/Main/UserPreferences.h index 25621656..2c5cff9f 100644 --- a/src/Main/UserPreferences.h +++ b/src/Main/UserPreferences.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/VolumeHistory.cpp b/src/Main/VolumeHistory.cpp index ba33a04a..8b8c5f62 100644 --- a/src/Main/VolumeHistory.cpp +++ b/src/Main/VolumeHistory.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/VolumeHistory.h b/src/Main/VolumeHistory.h index fdbb099b..02d6bfe1 100644 --- a/src/Main/VolumeHistory.h +++ b/src/Main/VolumeHistory.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Xml.cpp b/src/Main/Xml.cpp index bf286a55..e7efc39e 100644 --- a/src/Main/Xml.cpp +++ b/src/Main/Xml.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Main/Xml.h b/src/Main/Xml.h index 27f0b828..3d6dea67 100644 --- a/src/Main/Xml.h +++ b/src/Main/Xml.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Makefile b/src/Makefile index b176975e..4f282e5a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -164,2 +164,5 @@ else ifneq (,$(filter armv7l,$(ARCH))) CPU_ARCH = armv7 +else ifneq (,$(filter aarch64 arm64 armv8l,$(ARCH))) + PLATFORM_ARCH := arm64 + CPU_ARCH = arm64 endif @@ -340,2 +343,5 @@ $(error Specified SDK version was not found, ensure your active developer direct + export CFLAGS_ARM64 := $(CFLAGS) $(C_CXX_FLAGS) -arch arm64 -march=armv8-a+crypto + export CFLAGS_X64 := $(CFLAGS) $(C_CXX_FLAGS) -arch x86_64 + # Set x86 assembly flags (-msse2, -mssse3, -msse4.1) diff --git a/src/Mount/Favorites.cpp b/src/Mount/Favorites.cpp index c829128f..5794f6cb 100644 --- a/src/Mount/Favorites.cpp +++ b/src/Mount/Favorites.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Mount/Favorites.h b/src/Mount/Favorites.h index 9384cbc8..534706b3 100644 --- a/src/Mount/Favorites.h +++ b/src/Mount/Favorites.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Mount/Hotkeys.c b/src/Mount/Hotkeys.c index 9af4c628..3ab0bd92 100644 --- a/src/Mount/Hotkeys.c +++ b/src/Mount/Hotkeys.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -256,4 +256,4 @@ static void DisplayHotkeyList (HWND hwndDlg) - case HK_DISMOUNT_ALL: - item.pszText = GetString ("HK_DISMOUNT_ALL"); + case HK_UNMOUNT_ALL: + item.pszText = GetString ("HK_UNMOUNT_ALL"); break; @@ -264,12 +264,12 @@ static void DisplayHotkeyList (HWND hwndDlg) - case HK_DISMOUNT_ALL_AND_WIPE: - item.pszText = GetString ("HK_DISMOUNT_ALL_AND_WIPE"); + case HK_UNMOUNT_ALL_AND_WIPE: + item.pszText = GetString ("HK_UNMOUNT_ALL_AND_WIPE"); break; - case HK_FORCE_DISMOUNT_ALL_AND_WIPE: - item.pszText = GetString ("HK_FORCE_DISMOUNT_ALL_AND_WIPE"); + case HK_FORCE_UNMOUNT_ALL_AND_WIPE: + item.pszText = GetString ("HK_FORCE_UNMOUNT_ALL_AND_WIPE"); break; - case HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT: - item.pszText = GetString ("HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT"); + case HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT: + item.pszText = GetString ("HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT"); break; @@ -380,4 +380,4 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar - SetCheckBox (hwndDlg, IDC_HK_DISMOUNT_PLAY_SOUND, bPlaySoundOnSuccessfulHkDismount); - SetCheckBox (hwndDlg, IDC_HK_DISMOUNT_BALLOON_TOOLTIP, bDisplayBalloonOnSuccessfulHkDismount); + SetCheckBox (hwndDlg, IDC_HK_UNMOUNT_PLAY_SOUND, bPlaySoundOnSuccessfulHkDismount); + SetCheckBox (hwndDlg, IDC_HK_UNMOUNT_BALLOON_TOOLTIP, bDisplayBalloonOnSuccessfulHkDismount); @@ -563,10 +563,10 @@ BOOL CALLBACK HotkeysDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar - if (lw == IDC_HK_DISMOUNT_PLAY_SOUND) + if (lw == IDC_HK_UNMOUNT_PLAY_SOUND) { - bTPlaySoundOnSuccessfulHkDismount = GetCheckBox (hwndDlg, IDC_HK_DISMOUNT_PLAY_SOUND); + bTPlaySoundOnSuccessfulHkDismount = GetCheckBox (hwndDlg, IDC_HK_UNMOUNT_PLAY_SOUND); } - if (lw == IDC_HK_DISMOUNT_BALLOON_TOOLTIP) + if (lw == IDC_HK_UNMOUNT_BALLOON_TOOLTIP) { - bTDisplayBalloonOnSuccessfulHkDismount = GetCheckBox (hwndDlg, IDC_HK_DISMOUNT_BALLOON_TOOLTIP); + bTDisplayBalloonOnSuccessfulHkDismount = GetCheckBox (hwndDlg, IDC_HK_UNMOUNT_BALLOON_TOOLTIP); } diff --git a/src/Mount/Hotkeys.h b/src/Mount/Hotkeys.h index 731f9549..ab90d6be 100644 --- a/src/Mount/Hotkeys.h +++ b/src/Mount/Hotkeys.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -26,6 +26,6 @@ enum HK_CLOSE_SECURITY_TOKEN_SESSIONS, - HK_DISMOUNT_ALL, - HK_DISMOUNT_ALL_AND_WIPE, - HK_FORCE_DISMOUNT_ALL_AND_WIPE, - HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT, + HK_UNMOUNT_ALL, + HK_UNMOUNT_ALL_AND_WIPE, + HK_FORCE_UNMOUNT_ALL_AND_WIPE, + HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT, HK_MOUNT_FAVORITE_VOLUMES, diff --git a/src/Mount/MainCom.cpp b/src/Mount/MainCom.cpp index ce6803ac..5ccbf3e1 100644 --- a/src/Mount/MainCom.cpp +++ b/src/Mount/MainCom.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Mount/MainCom.h b/src/Mount/MainCom.h index aeafa549..419d6beb 100644 --- a/src/Mount/MainCom.h +++ b/src/Mount/MainCom.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Mount/Mount.c b/src/Mount/Mount.c index 09f43b88..f6d1bc86 100644 --- a/src/Mount/Mount.c +++ b/src/Mount/Mount.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -1060,12 +1060,12 @@ void LoadSettingsAndCheckModified (HWND hwndDlg, BOOL bOnlyCheckModified, BOOL* ConfigReadCompareInt ("HotkeyCodeAutoMountDevices", 0, (int*) &Hotkeys [HK_AUTOMOUNT_DEVICES].vKeyCode, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyModDismountAll", 0, (int*) &Hotkeys [HK_DISMOUNT_ALL].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyCodeDismountAll", 0, (int*) &Hotkeys [HK_DISMOUNT_ALL].vKeyCode, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyModDismountAll", 0, (int*) &Hotkeys [HK_UNMOUNT_ALL].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyCodeDismountAll", 0, (int*) &Hotkeys [HK_UNMOUNT_ALL].vKeyCode, bOnlyCheckModified, pbSettingsModified); ConfigReadCompareInt ("HotkeyModWipeCache", 0, (int*) &Hotkeys [HK_WIPE_CACHE].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); ConfigReadCompareInt ("HotkeyCodeWipeCache", 0, (int*) &Hotkeys [HK_WIPE_CACHE].vKeyCode, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyModDismountAllWipe", 0, (int*) &Hotkeys [HK_DISMOUNT_ALL_AND_WIPE].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyCodeDismountAllWipe", 0, (int*) &Hotkeys [HK_DISMOUNT_ALL_AND_WIPE].vKeyCode, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyModForceDismountAllWipe", 0, (int*) &Hotkeys [HK_FORCE_DISMOUNT_ALL_AND_WIPE].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyCodeForceDismountAllWipe", 0, (int*) &Hotkeys [HK_FORCE_DISMOUNT_ALL_AND_WIPE].vKeyCode, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyModForceDismountAllWipeExit", 0, (int*) &Hotkeys [HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); - ConfigReadCompareInt ("HotkeyCodeForceDismountAllWipeExit", 0, (int*) &Hotkeys [HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyCode, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyModDismountAllWipe", 0, (int*) &Hotkeys [HK_UNMOUNT_ALL_AND_WIPE].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyCodeDismountAllWipe", 0, (int*) &Hotkeys [HK_UNMOUNT_ALL_AND_WIPE].vKeyCode, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyModForceDismountAllWipe", 0, (int*) &Hotkeys [HK_FORCE_UNMOUNT_ALL_AND_WIPE].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyCodeForceDismountAllWipe", 0, (int*) &Hotkeys [HK_FORCE_UNMOUNT_ALL_AND_WIPE].vKeyCode, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyModForceDismountAllWipeExit", 0, (int*) &Hotkeys [HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); + ConfigReadCompareInt ("HotkeyCodeForceDismountAllWipeExit", 0, (int*) &Hotkeys [HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyCode, bOnlyCheckModified, pbSettingsModified); ConfigReadCompareInt ("HotkeyModMountFavoriteVolumes", 0, (int*) &Hotkeys [HK_MOUNT_FAVORITE_VOLUMES].vKeyModifiers, bOnlyCheckModified, pbSettingsModified); @@ -1195,12 +1195,12 @@ void SaveSettings (HWND hwndDlg) ConfigWriteInt ("HotkeyCodeAutoMountDevices", Hotkeys[HK_AUTOMOUNT_DEVICES].vKeyCode); - ConfigWriteInt ("HotkeyModDismountAll", Hotkeys[HK_DISMOUNT_ALL].vKeyModifiers); - ConfigWriteInt ("HotkeyCodeDismountAll", Hotkeys[HK_DISMOUNT_ALL].vKeyCode); + ConfigWriteInt ("HotkeyModDismountAll", Hotkeys[HK_UNMOUNT_ALL].vKeyModifiers); + ConfigWriteInt ("HotkeyCodeDismountAll", Hotkeys[HK_UNMOUNT_ALL].vKeyCode); ConfigWriteInt ("HotkeyModWipeCache", Hotkeys[HK_WIPE_CACHE].vKeyModifiers); ConfigWriteInt ("HotkeyCodeWipeCache", Hotkeys[HK_WIPE_CACHE].vKeyCode); - ConfigWriteInt ("HotkeyModDismountAllWipe", Hotkeys[HK_DISMOUNT_ALL_AND_WIPE].vKeyModifiers); - ConfigWriteInt ("HotkeyCodeDismountAllWipe", Hotkeys[HK_DISMOUNT_ALL_AND_WIPE].vKeyCode); - ConfigWriteInt ("HotkeyModForceDismountAllWipe", Hotkeys[HK_FORCE_DISMOUNT_ALL_AND_WIPE].vKeyModifiers); - ConfigWriteInt ("HotkeyCodeForceDismountAllWipe", Hotkeys[HK_FORCE_DISMOUNT_ALL_AND_WIPE].vKeyCode); - ConfigWriteInt ("HotkeyModForceDismountAllWipeExit", Hotkeys[HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyModifiers); - ConfigWriteInt ("HotkeyCodeForceDismountAllWipeExit", Hotkeys[HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyCode); + ConfigWriteInt ("HotkeyModDismountAllWipe", Hotkeys[HK_UNMOUNT_ALL_AND_WIPE].vKeyModifiers); + ConfigWriteInt ("HotkeyCodeDismountAllWipe", Hotkeys[HK_UNMOUNT_ALL_AND_WIPE].vKeyCode); + ConfigWriteInt ("HotkeyModForceDismountAllWipe", Hotkeys[HK_FORCE_UNMOUNT_ALL_AND_WIPE].vKeyModifiers); + ConfigWriteInt ("HotkeyCodeForceDismountAllWipe", Hotkeys[HK_FORCE_UNMOUNT_ALL_AND_WIPE].vKeyCode); + ConfigWriteInt ("HotkeyModForceDismountAllWipeExit", Hotkeys[HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyModifiers); + ConfigWriteInt ("HotkeyCodeForceDismountAllWipeExit", Hotkeys[HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT].vKeyCode); ConfigWriteInt ("HotkeyModMountFavoriteVolumes", Hotkeys[HK_MOUNT_FAVORITE_VOLUMES].vKeyModifiers); @@ -3390,3 +3390,3 @@ static void PreferencesDlgEnableButtons (HWND hwndDlg) BOOL back = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_BKG_TASK_ENABLE)); - BOOL idle = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE)); + BOOL idle = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE)); BOOL installed = !IsNonInstallMode(); @@ -3398,12 +3398,12 @@ static void PreferencesDlgEnableButtons (HWND hwndDlg) EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_LOGON_MOUNT_DEVICES), installed); - EnableWindow (GetDlgItem (hwndDlg, IDT_AUTO_DISMOUNT), back); - EnableWindow (GetDlgItem (hwndDlg, IDT_AUTO_DISMOUNT_ON), back); + EnableWindow (GetDlgItem (hwndDlg, IDT_AUTO_UNMOUNT), back); + EnableWindow (GetDlgItem (hwndDlg, IDT_AUTO_UNMOUNT_ON), back); EnableWindow (GetDlgItem (hwndDlg, IDT_MINUTES), back); - EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_LOGOFF), back); - EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SESSION_LOCKED), back && wtsEnabled); - EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_POWERSAVING), back); - EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SCREENSAVER), back); - EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE), back); - EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE_TIME), back && idle); - EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_DISMOUNT), back); + EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_LOGOFF), back); + EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SESSION_LOCKED), back && wtsEnabled); + EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_POWERSAVING), back); + EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SCREENSAVER), back); + EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE), back); + EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE_TIME), back && idle); + EnableWindow (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_UNMOUNT), back); } @@ -3461,3 +3461,3 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM - SendMessage (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT), BM_SETCHECK, + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_AUTOUNMOUNT), BM_SETCHECK, bWipeCacheOnAutoDismount ? BST_CHECKED:BST_UNCHECKED, 0); @@ -3488,21 +3488,21 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM - SendMessage (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_LOGOFF), BM_SETCHECK, + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_LOGOFF), BM_SETCHECK, bDismountOnLogOff ? BST_CHECKED:BST_UNCHECKED, 0); - SendMessage (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SESSION_LOCKED), BM_SETCHECK, + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SESSION_LOCKED), BM_SETCHECK, bDismountOnSessionLocked ? BST_CHECKED:BST_UNCHECKED, 0); - SendMessage (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_POWERSAVING), BM_SETCHECK, + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_POWERSAVING), BM_SETCHECK, bDismountOnPowerSaving ? BST_CHECKED:BST_UNCHECKED, 0); - SendMessage (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SCREENSAVER), BM_SETCHECK, + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SCREENSAVER), BM_SETCHECK, bDismountOnScreenSaver ? BST_CHECKED:BST_UNCHECKED, 0); - SendMessage (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_DISMOUNT), BM_SETCHECK, + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_UNMOUNT), BM_SETCHECK, bForceAutoDismount ? BST_CHECKED:BST_UNCHECKED, 0); - SendMessage (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE), BM_SETCHECK, + SendMessage (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE), BM_SETCHECK, MaxVolumeIdleTime > 0 ? BST_CHECKED:BST_UNCHECKED, 0); - SetDlgItemInt (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE_TIME, abs (MaxVolumeIdleTime), FALSE); + SetDlgItemInt (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE_TIME, abs (MaxVolumeIdleTime), FALSE); @@ -3521,15 +3521,15 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM // Forced dismount disabled warning - if (lw == IDC_PREF_DISMOUNT_INACTIVE - || lw == IDC_PREF_DISMOUNT_LOGOFF - || lw == IDC_PREF_DISMOUNT_SESSION_LOCKED - || lw == IDC_PREF_DISMOUNT_POWERSAVING - || lw == IDC_PREF_DISMOUNT_SCREENSAVER - || lw == IDC_PREF_FORCE_AUTO_DISMOUNT) - { - BOOL i = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE)); - BOOL l = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_LOGOFF)); - BOOL sl = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SESSION_LOCKED)); - BOOL p = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_POWERSAVING)); - BOOL s = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SCREENSAVER)); - BOOL q = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_DISMOUNT)); + if (lw == IDC_PREF_UNMOUNT_INACTIVE + || lw == IDC_PREF_UNMOUNT_LOGOFF + || lw == IDC_PREF_UNMOUNT_SESSION_LOCKED + || lw == IDC_PREF_UNMOUNT_POWERSAVING + || lw == IDC_PREF_UNMOUNT_SCREENSAVER + || lw == IDC_PREF_FORCE_AUTO_UNMOUNT) + { + BOOL i = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE)); + BOOL l = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_LOGOFF)); + BOOL sl = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SESSION_LOCKED)); + BOOL p = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_POWERSAVING)); + BOOL s = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SCREENSAVER)); + BOOL q = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_UNMOUNT)); @@ -3537,17 +3537,17 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM { - if (lw == IDC_PREF_FORCE_AUTO_DISMOUNT && (i || l || sl || p || s)) + if (lw == IDC_PREF_FORCE_AUTO_UNMOUNT && (i || l || sl || p || s)) { - if (AskWarnNoYes ("CONFIRM_NO_FORCED_AUTODISMOUNT", hwndDlg) == IDNO) - SetCheckBox (hwndDlg, IDC_PREF_FORCE_AUTO_DISMOUNT, TRUE); + if (AskWarnNoYes ("CONFIRM_NO_FORCED_AUTOUNMOUNT", hwndDlg) == IDNO) + SetCheckBox (hwndDlg, IDC_PREF_FORCE_AUTO_UNMOUNT, TRUE); } - else if ((lw == IDC_PREF_DISMOUNT_INACTIVE && i - || lw == IDC_PREF_DISMOUNT_LOGOFF && l - || lw == IDC_PREF_DISMOUNT_SESSION_LOCKED && sl - || lw == IDC_PREF_DISMOUNT_POWERSAVING && p - || lw == IDC_PREF_DISMOUNT_SCREENSAVER && s)) - Warning ("WARN_PREF_AUTO_DISMOUNT", hwndDlg); + else if ((lw == IDC_PREF_UNMOUNT_INACTIVE && i + || lw == IDC_PREF_UNMOUNT_LOGOFF && l + || lw == IDC_PREF_UNMOUNT_SESSION_LOCKED && sl + || lw == IDC_PREF_UNMOUNT_POWERSAVING && p + || lw == IDC_PREF_UNMOUNT_SCREENSAVER && s)) + Warning ("WARN_PREF_AUTO_UNMOUNT", hwndDlg); } - if (p && lw == IDC_PREF_DISMOUNT_POWERSAVING) - Warning ("WARN_PREF_AUTO_DISMOUNT_ON_POWER", hwndDlg); + if (p && lw == IDC_PREF_UNMOUNT_POWERSAVING) + Warning ("WARN_PREF_AUTO_UNMOUNT_ON_POWER", hwndDlg); } @@ -3574,3 +3574,3 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM bWipeCacheOnExit = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_EXIT)); - bWipeCacheOnAutoDismount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT)); + bWipeCacheOnAutoDismount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_WIPE_CACHE_ON_AUTOUNMOUNT)); bCacheInDriverDefault = bCacheInDriver = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_CACHE_PASSWORDS)); @@ -3581,9 +3581,9 @@ BOOL CALLBACK PreferencesDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM bCloseBkgTaskWhenNoVolumes = IsNonInstallMode() ? bCloseBkgTaskWhenNoVolumes : IsButtonChecked (GetDlgItem (hwndDlg, IDC_CLOSE_BKG_TASK_WHEN_NOVOL)); - bDismountOnLogOff = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_LOGOFF)); - bDismountOnSessionLocked = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SESSION_LOCKED)); - bDismountOnPowerSaving = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_POWERSAVING)); - bDismountOnScreenSaver = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_SCREENSAVER)); - bForceAutoDismount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_DISMOUNT)); - MaxVolumeIdleTime = GetDlgItemInt (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE_TIME, NULL, FALSE) - * (IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_DISMOUNT_INACTIVE)) ? 1 : -1); + bDismountOnLogOff = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_LOGOFF)); + bDismountOnSessionLocked = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SESSION_LOCKED)); + bDismountOnPowerSaving = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_POWERSAVING)); + bDismountOnScreenSaver = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_SCREENSAVER)); + bForceAutoDismount = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_FORCE_AUTO_UNMOUNT)); + MaxVolumeIdleTime = GetDlgItemInt (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE_TIME, NULL, FALSE) + * (IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_UNMOUNT_INACTIVE)) ? 1 : -1); bStartOnLogon = IsButtonChecked (GetDlgItem (hwndDlg, IDC_PREF_LOGON_START)); @@ -4992,3 +4992,3 @@ BOOL CALLBACK TravelerDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa fwprintf (af, L"shell\\start=%s\nshell\\start\\command=VeraCrypt\\VeraCrypt.exe\n", GetString ("IDC_PREF_LOGON_START")); - fwprintf (af, L"shell\\dismount=%s\nshell\\dismount\\command=VeraCrypt\\VeraCrypt.exe /q /d\n", GetString ("DISMOUNT_ALL_TC_VOLUMES")); + fwprintf (af, L"shell\\unmount=%s\nshell\\unmount\\command=VeraCrypt\\VeraCrypt.exe /q /u\n", GetString ("UNMOUNT_ALL_TC_VOLUMES")); @@ -5437,3 +5437,3 @@ void CALLBACK DismountAllThreadProc(void* pArg, HWND hwndDlg) { - *pbResult = DeviceIoControl (hDriver, TC_IOCTL_DISMOUNT_ALL_VOLUMES, punmount, + *pbResult = DeviceIoControl (hDriver, TC_IOCTL_UNMOUNT_ALL_VOLUMES, punmount, sizeof (UNMOUNT_STRUCT), punmount, sizeof (UNMOUNT_STRUCT), pdwResult, NULL); @@ -6869,3 +6869,3 @@ void DisplayDriveListContextMenu (HWND hwndDlg, LPARAM lParam) - AppendMenuW (popup, MF_STRING, IDM_UNMOUNT_VOLUME, GetString ("DISMOUNT")); + AppendMenuW (popup, MF_STRING, IDM_UNMOUNT_VOLUME, GetString ("UNMOUNT")); AppendMenuW (popup, MF_STRING, IDPM_OPEN_VOLUME, GetString ("OPEN")); @@ -7872,3 +7872,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa StringCbPrintfW (s, sizeof(s), L"%s %c: (%s)", - GetString (n==0 ? "OPEN" : "DISMOUNT"), + GetString (n==0 ? "OPEN" : "UNMOUNT"), i + L'A', @@ -7912,5 +7912,5 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa wchar_t txt [2048]; - StringCbPrintfW (txt, sizeof(txt), GetString ("VOLUME_MOUNTED_AS_DRIVE_LETTER_X_DISMOUNTED"), sel - TRAYICON_MENU_DRIVE_OFFSET - 26 + L'A'); + StringCbPrintfW (txt, sizeof(txt), GetString ("VOLUME_MOUNTED_AS_DRIVE_LETTER_X_UNMOUNTED"), sel - TRAYICON_MENU_DRIVE_OFFSET - 26 + L'A'); - InfoBalloonDirect (GetString ("SUCCESSFULLY_DISMOUNTED"), txt, hwndDlg); + InfoBalloonDirect (GetString ("SUCCESSFULLY_UNMOUNTED"), txt, hwndDlg); } @@ -8001,3 +8001,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa UnmountVolume (hwndDlg, m, TRUE); - WarningBalloon ("HOST_DEVICE_REMOVAL_DISMOUNT_WARN_TITLE", "HOST_DEVICE_REMOVAL_DISMOUNT_WARN", hwndDlg); + WarningBalloon ("HOST_DEVICE_REMOVAL_UNMOUNT_WARN_TITLE", "HOST_DEVICE_REMOVAL_UNMOUNT_WARN", hwndDlg); } @@ -8026,3 +8026,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa UnmountVolume (hwndDlg, m, TRUE); - WarningBalloon ("HOST_DEVICE_REMOVAL_DISMOUNT_WARN_TITLE", "HOST_DEVICE_REMOVAL_DISMOUNT_WARN", hwndDlg); + WarningBalloon ("HOST_DEVICE_REMOVAL_UNMOUNT_WARN_TITLE", "HOST_DEVICE_REMOVAL_UNMOUNT_WARN", hwndDlg); } @@ -8215,3 +8215,3 @@ BOOL CALLBACK MainDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa { - InfoBalloon ("SUCCESSFULLY_DISMOUNTED", "MOUNTED_VOLUMES_DISMOUNTED", hwndDlg); + InfoBalloon ("SUCCESSFULLY_UNMOUNTED", "MOUNTED_VOLUMES_UNMOUNTED", hwndDlg); } @@ -9172,2 +9172,3 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) OptionSignalExit, + CommandUnmount, }; @@ -9202,2 +9203,3 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) { OptionSignalExit, L"/signalExit", NULL, FALSE }, + { CommandUnmount, L"/unmount", L"/u", FALSE }, }; @@ -9345,2 +9347,3 @@ void ExtractCommandLine (HWND hwndDlg, wchar_t *lpszCommandLine) case CommandDismount: + case CommandUnmount: @@ -10134,3 +10137,7 @@ int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, wchar_t *lpsz - DetectX86Features (); +#ifndef _M_ARM64 + DetectX86Features(); +#else + DetectArmFeatures(); +#endif @@ -10478,3 +10485,3 @@ skipMount: - SystemFavoritesServiceLogError (wstring (L"The filesystem of the volume mounted as ") + (wchar_t) (drive + L'A') + L": was not cleanly dismounted and needs to be checked for errors."); + SystemFavoritesServiceLogError (wstring (L"The filesystem of the volume mounted as ") + (wchar_t) (drive + L'A') + L": was not cleanly unmounted and needs to be checked for errors."); } @@ -10757,6 +10764,6 @@ static void HandleHotKey (HWND hwndDlg, WPARAM wParam) - case HK_DISMOUNT_ALL: - case HK_DISMOUNT_ALL_AND_WIPE: + case HK_UNMOUNT_ALL: + case HK_UNMOUNT_ALL_AND_WIPE: - if (wParam == HK_DISMOUNT_ALL_AND_WIPE) + if (wParam == HK_UNMOUNT_ALL_AND_WIPE) WipeCache (hwndDlg, TRUE); @@ -10766,3 +10773,3 @@ static void HandleHotKey (HWND hwndDlg, WPARAM wParam) if (bDisplayBalloonOnSuccessfulHkDismount) - InfoBalloon ("SUCCESSFULLY_DISMOUNTED", (wParam == HK_DISMOUNT_ALL_AND_WIPE ? "VOLUMES_DISMOUNTED_CACHE_WIPED" : "MOUNTED_VOLUMES_DISMOUNTED"), hwndDlg); + InfoBalloon ("SUCCESSFULLY_UNMOUNTED", (wParam == HK_UNMOUNT_ALL_AND_WIPE ? "VOLUMES_UNMOUNTED_CACHE_WIPED" : "MOUNTED_VOLUMES_UNMOUNTED"), hwndDlg); @@ -10779,3 +10786,3 @@ static void HandleHotKey (HWND hwndDlg, WPARAM wParam) - case HK_FORCE_DISMOUNT_ALL_AND_WIPE: + case HK_FORCE_UNMOUNT_ALL_AND_WIPE: success = DismountAll (hwndDlg, TRUE, FALSE, UNMOUNT_MAX_AUTO_RETRIES, UNMOUNT_AUTO_RETRY_DELAY); @@ -10785,3 +10792,3 @@ static void HandleHotKey (HWND hwndDlg, WPARAM wParam) if (bDisplayBalloonOnSuccessfulHkDismount) - InfoBalloon ("SUCCESSFULLY_DISMOUNTED", "VOLUMES_DISMOUNTED_CACHE_WIPED", hwndDlg); + InfoBalloon ("SUCCESSFULLY_UNMOUNTED", "VOLUMES_UNMOUNTED_CACHE_WIPED", hwndDlg); @@ -10792,3 +10799,3 @@ static void HandleHotKey (HWND hwndDlg, WPARAM wParam) - case HK_FORCE_DISMOUNT_ALL_AND_WIPE_AND_EXIT: + case HK_FORCE_UNMOUNT_ALL_AND_WIPE_AND_EXIT: success = DismountAll (hwndDlg, TRUE, FALSE, UNMOUNT_MAX_AUTO_RETRIES, UNMOUNT_AUTO_RETRY_DELAY); @@ -10798,3 +10805,3 @@ static void HandleHotKey (HWND hwndDlg, WPARAM wParam) if (bDisplayBalloonOnSuccessfulHkDismount) - InfoBalloon ("SUCCESSFULLY_DISMOUNTED", "VOLUMES_DISMOUNTED_CACHE_WIPED", hwndDlg); + InfoBalloon ("SUCCESSFULLY_UNMOUNTED", "VOLUMES_UNMOUNTED_CACHE_WIPED", hwndDlg); @@ -10893,3 +10900,3 @@ int BackupVolumeHeader (HWND hwndDlg, BOOL bRequireConfirmation, const wchar_t * { - Warning ("DISMOUNT_FIRST", hwndDlg); + Warning ("UNMOUNT_FIRST", hwndDlg); goto ret; @@ -11163,3 +11170,3 @@ int RestoreVolumeHeader (HWND hwndDlg, const wchar_t *lpszVolume) { - Warning ("DISMOUNT_FIRST", hwndDlg); + Warning ("UNMOUNT_FIRST", hwndDlg); return 0; diff --git a/src/Mount/Mount.h b/src/Mount/Mount.h index cd2636b1..c3dab0ed 100644 --- a/src/Mount/Mount.h +++ b/src/Mount/Mount.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Mount/Mount.rc b/src/Mount/Mount.rc index 19b3bbe9..0370f3ae 100644 --- a/src/Mount/Mount.rc +++ b/src/Mount/Mount.rc @@ -59,13 +59,13 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,140,75,188,10 - CONTROL "User logs off",IDC_PREF_DISMOUNT_LOGOFF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,104,114,11 - CONTROL "User session locked",IDC_PREF_DISMOUNT_SESSION_LOCKED, + CONTROL "User logs off",IDC_PREF_UNMOUNT_LOGOFF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,104,114,11 + CONTROL "User session locked",IDC_PREF_UNMOUNT_SESSION_LOCKED, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,197,105,130,11 - CONTROL "Screen saver is launched",IDC_PREF_DISMOUNT_SCREENSAVER, + CONTROL "Screen saver is launched",IDC_PREF_UNMOUNT_SCREENSAVER, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,81,116,114,10 - CONTROL "Entering power saving mode",IDC_PREF_DISMOUNT_POWERSAVING, + CONTROL "Entering power saving mode",IDC_PREF_UNMOUNT_POWERSAVING, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,197,115,130,11 - CONTROL "Auto-dismount volume after no data has been read/written to it for",IDC_PREF_DISMOUNT_INACTIVE, + CONTROL "Auto-unmount volume after no data has been read/written to it for",IDC_PREF_UNMOUNT_INACTIVE, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,128,246,11 - EDITTEXT IDC_PREF_DISMOUNT_INACTIVE_TIME,258,127,27,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT - CONTROL "Force auto-dismount even if volume contains open files or directories",IDC_PREF_FORCE_AUTO_DISMOUNT, + EDITTEXT IDC_PREF_UNMOUNT_INACTIVE_TIME,258,127,27,12,ES_AUTOHSCROLL | ES_NUMBER,WS_EX_RIGHT + CONTROL "Force auto-unmount even if volume contains open files or directories",IDC_PREF_FORCE_AUTO_UNMOUNT, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,141,294,10 @@ -85,3 +85,3 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,285,294,11 - CONTROL "Wipe cached passwords on auto-dismount",IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT, + CONTROL "Wipe cached passwords on auto-unmount",IDC_PREF_WIPE_CACHE_ON_AUTOUNMOUNT, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,299,296,11 @@ -95,5 +95,5 @@ BEGIN GROUPBOX "VeraCrypt Background Task",IDT_TASKBAR_ICON,4,33,328,26 - GROUPBOX "Auto-Dismount",IDT_AUTO_DISMOUNT,4,94,328,62 + GROUPBOX "Auto-Unmount",IDT_AUTO_UNMOUNT,4,94,328,62 LTEXT "minutes",IDT_MINUTES,289,129,39,10 - LTEXT "Dismount all when:",IDT_AUTO_DISMOUNT_ON,9,104,71,20 + LTEXT "Unmount all when:",IDT_AUTO_UNMOUNT_ON,9,104,71,20 GROUPBOX "Password Cache",IDT_PW_CACHE_OPTIONS,4,260,328,68 @@ -258,5 +258,5 @@ BEGIN PUSHBUTTON "Remove",IDC_HOTKEY_REMOVE,304,158,59,14 - CONTROL "Play system notification sound after successful hot-key dismount",IDC_HK_DISMOUNT_PLAY_SOUND, + CONTROL "Play system notification sound after successful hot-key unmount",IDC_HK_UNMOUNT_PLAY_SOUND, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,201,348,10 - CONTROL "Display balloon tooltip after successful hot-key dismount",IDC_HK_DISMOUNT_BALLOON_TOOLTIP, + CONTROL "Display balloon tooltip after successful hot-key unmount",IDC_HK_UNMOUNT_BALLOON_TOOLTIP, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,213,351,10,WS_EX_TRANSPARENT @@ -266,3 +266,3 @@ BEGIN RTEXT "Key to assign:",IDT_HOTKEY_KEY,15,142,86,8 - GROUPBOX "Hot Key Options",IDT_DISMOUNT_ACTION,7,188,375,42 + GROUPBOX "Hot Key Options",IDT_UNMOUNT_ACTION,7,188,375,42 GROUPBOX "Shortcut",IDT_ASSIGN_HOTKEY,7,127,375,53 @@ -562,4 +562,4 @@ END VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,19,0 + PRODUCTVERSION 1,26,19,0 FILEFLAGSMASK 0x17L @@ -580,3 +580,3 @@ BEGIN VALUE "FileDescription", "VeraCrypt" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -584,3 +584,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END @@ -653,4 +653,4 @@ BEGIN MENUITEM SEPARATOR - MENUITEM "Dismount Volume", IDM_UNMOUNT_VOLUME - MENUITEM "Dismount All Mounted Volumes", IDM_UNMOUNTALL + MENUITEM "Unmount Volume", IDM_UNMOUNT_VOLUME + MENUITEM "Unmount All Mounted Volumes", IDM_UNMOUNTALL MENUITEM SEPARATOR diff --git a/src/Mount/Resource.h b/src/Mount/Resource.h index fef9da49..860d4f99 100644 --- a/src/Mount/Resource.h +++ b/src/Mount/Resource.h @@ -41,5 +41,5 @@ #define IDC_DIRECTORY 1017 -#define IDC_PREF_DISMOUNT_LOGOFF 1018 +#define IDC_PREF_UNMOUNT_LOGOFF 1018 #define IDC_BROWSE_DIRS 1019 -#define IDC_PREF_DISMOUNT_INACTIVE 1020 +#define IDC_PREF_UNMOUNT_INACTIVE 1020 #define IDC_AUTORUN_DISABLE 1021 @@ -89,10 +89,10 @@ #define IDT_TASKBAR_ICON 1066 -#define IDT_AUTO_DISMOUNT 1067 -#define IDC_PREF_FORCE_AUTO_DISMOUNT 1068 -#define IDC_PREF_DISMOUNT_INACTIVE_TIME 1069 +#define IDT_AUTO_UNMOUNT 1067 +#define IDC_PREF_FORCE_AUTO_UNMOUNT 1068 +#define IDC_PREF_UNMOUNT_INACTIVE_TIME 1069 #define IDT_MINUTES 1070 -#define IDC_PREF_DISMOUNT_SCREENSAVER 1071 -#define IDC_PREF_DISMOUNT_POWERSAVING 1072 -#define IDT_AUTO_DISMOUNT_ON 1073 -#define IDC_PREF_WIPE_CACHE_ON_AUTODISMOUNT 1074 +#define IDC_PREF_UNMOUNT_SCREENSAVER 1071 +#define IDC_PREF_UNMOUNT_POWERSAVING 1072 +#define IDT_AUTO_UNMOUNT_ON 1073 +#define IDC_PREF_WIPE_CACHE_ON_AUTOUNMOUNT 1074 #define IDC_CLOSE_BKG_TASK_WHEN_NOVOL 1075 @@ -104,5 +104,5 @@ #define IDC_SHOW_PASSWORD_CHPWD_NEW 1081 -#define IDC_HK_DISMOUNT_BALLOON_TOOLTIP 1082 +#define IDC_HK_UNMOUNT_BALLOON_TOOLTIP 1082 #define IDC_SHOW_PASSWORD_CHPWD_ORI 1083 -#define IDC_HK_DISMOUNT_PLAY_SOUND 1084 +#define IDC_HK_UNMOUNT_PLAY_SOUND 1084 #define IDC_HOTKEY_ASSIGN 1085 @@ -113,3 +113,3 @@ #define IDC_RESET_HOTKEYS 1090 -#define IDT_DISMOUNT_ACTION 1091 +#define IDT_UNMOUNT_ACTION 1091 #define IDT_ASSIGN_HOTKEY 1092 @@ -159,3 +159,3 @@ #define IDC_FAV_VOL_OPTIONS_GLOBAL_SETTINGS_BOX 1136 -#define IDC_PREF_DISMOUNT_SESSION_LOCKED 1137 +#define IDC_PREF_UNMOUNT_SESSION_LOCKED 1137 #define IDT_NEW_PKCS5_PRF 1138 @@ -1,2 +1,2 @@ -Copyright 2013-2024 IDRIX +Copyright 2013-2025 IDRIX diff --git a/src/Platform/Buffer.cpp b/src/Platform/Buffer.cpp index 5829b1d9..412f06a5 100644 --- a/src/Platform/Buffer.cpp +++ b/src/Platform/Buffer.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Buffer.h b/src/Platform/Buffer.h index a1eb0918..53215bf5 100644 --- a/src/Platform/Buffer.h +++ b/src/Platform/Buffer.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Directory.h b/src/Platform/Directory.h index b960db0e..28eae166 100644 --- a/src/Platform/Directory.h +++ b/src/Platform/Directory.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Event.cpp b/src/Platform/Event.cpp index 86dcdde1..d60b6f4a 100644 --- a/src/Platform/Event.cpp +++ b/src/Platform/Event.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Event.h b/src/Platform/Event.h index 7d1cc2e4..e440a604 100644 --- a/src/Platform/Event.h +++ b/src/Platform/Event.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Exception.cpp b/src/Platform/Exception.cpp index 7bce461f..b6358683 100644 --- a/src/Platform/Exception.cpp +++ b/src/Platform/Exception.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Exception.h b/src/Platform/Exception.h index 36981a74..a768bfda 100644 --- a/src/Platform/Exception.h +++ b/src/Platform/Exception.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -98,3 +98,5 @@ namespace VeraCrypt TC_EXCEPTION (UnknownException); \ - TC_EXCEPTION (UserAbort) + TC_EXCEPTION (UserAbort); \ + TC_EXCEPTION (MountPointBlocked); \ + TC_EXCEPTION (MountPointNotAllowed) diff --git a/src/Platform/File.h b/src/Platform/File.h index a8befe38..28e5f6c9 100644 --- a/src/Platform/File.h +++ b/src/Platform/File.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/FileCommon.cpp b/src/Platform/FileCommon.cpp index 11d23dd2..5f493259 100644 --- a/src/Platform/FileCommon.cpp +++ b/src/Platform/FileCommon.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/FileStream.h b/src/Platform/FileStream.h index 66df1999..7b1dd212 100644 --- a/src/Platform/FileStream.h +++ b/src/Platform/FileStream.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/FilesystemPath.h b/src/Platform/FilesystemPath.h index c92f684e..f4ffadd8 100644 --- a/src/Platform/FilesystemPath.h +++ b/src/Platform/FilesystemPath.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Finally.h b/src/Platform/Finally.h index 63f07109..54c9f27b 100644 --- a/src/Platform/Finally.h +++ b/src/Platform/Finally.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/ForEach.h b/src/Platform/ForEach.h index a6131ebb..1f29e196 100644 --- a/src/Platform/ForEach.h +++ b/src/Platform/ForEach.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Functor.h b/src/Platform/Functor.h index e23e12dd..b88af814 100644 --- a/src/Platform/Functor.h +++ b/src/Platform/Functor.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Memory.cpp b/src/Platform/Memory.cpp index c4afed64..05758c14 100644 --- a/src/Platform/Memory.cpp +++ b/src/Platform/Memory.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Memory.h b/src/Platform/Memory.h index b124022f..441b1da6 100644 --- a/src/Platform/Memory.h +++ b/src/Platform/Memory.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/MemoryStream.cpp b/src/Platform/MemoryStream.cpp index 1bd090b9..f750606f 100644 --- a/src/Platform/MemoryStream.cpp +++ b/src/Platform/MemoryStream.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/MemoryStream.h b/src/Platform/MemoryStream.h index 068e6d6e..a20b12e0 100644 --- a/src/Platform/MemoryStream.h +++ b/src/Platform/MemoryStream.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Mutex.h b/src/Platform/Mutex.h index 83082825..fc58b8cd 100644 --- a/src/Platform/Mutex.h +++ b/src/Platform/Mutex.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Platform.h b/src/Platform/Platform.h index 6f7f791e..72ee9541 100644 --- a/src/Platform/Platform.h +++ b/src/Platform/Platform.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/PlatformBase.h b/src/Platform/PlatformBase.h index e378704c..10f0bb21 100644 --- a/src/Platform/PlatformBase.h +++ b/src/Platform/PlatformBase.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/PlatformTest.cpp b/src/Platform/PlatformTest.cpp index 9a3faae2..df7f447b 100644 --- a/src/Platform/PlatformTest.cpp +++ b/src/Platform/PlatformTest.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/PlatformTest.h b/src/Platform/PlatformTest.h index 64810f85..c17bad7c 100644 --- a/src/Platform/PlatformTest.h +++ b/src/Platform/PlatformTest.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Serializable.cpp b/src/Platform/Serializable.cpp index 4a307e92..ace4a819 100644 --- a/src/Platform/Serializable.cpp +++ b/src/Platform/Serializable.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Serializable.h b/src/Platform/Serializable.h index c92bc170..94b385fb 100644 --- a/src/Platform/Serializable.h +++ b/src/Platform/Serializable.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Serializer.cpp b/src/Platform/Serializer.cpp index 6f428b15..ea245436 100644 --- a/src/Platform/Serializer.cpp +++ b/src/Platform/Serializer.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Serializer.h b/src/Platform/Serializer.h index 3617a83b..81092fe5 100644 --- a/src/Platform/Serializer.h +++ b/src/Platform/Serializer.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SerializerFactory.cpp b/src/Platform/SerializerFactory.cpp index 4c7f4f7e..87091583 100644 --- a/src/Platform/SerializerFactory.cpp +++ b/src/Platform/SerializerFactory.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SerializerFactory.h b/src/Platform/SerializerFactory.h index 9c53d309..a36ffa03 100644 --- a/src/Platform/SerializerFactory.h +++ b/src/Platform/SerializerFactory.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SharedPtr.h b/src/Platform/SharedPtr.h index f80b2167..9b47388a 100644 --- a/src/Platform/SharedPtr.h +++ b/src/Platform/SharedPtr.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SharedVal.h b/src/Platform/SharedVal.h index fc64f3f3..b88ca3e2 100644 --- a/src/Platform/SharedVal.h +++ b/src/Platform/SharedVal.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Stream.h b/src/Platform/Stream.h index b9862a50..e74350f1 100644 --- a/src/Platform/Stream.h +++ b/src/Platform/Stream.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/StringConverter.cpp b/src/Platform/StringConverter.cpp index 7b3134ee..6a1f23c8 100644 --- a/src/Platform/StringConverter.cpp +++ b/src/Platform/StringConverter.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/StringConverter.h b/src/Platform/StringConverter.h index 8756d5ba..8bd27251 100644 --- a/src/Platform/StringConverter.h +++ b/src/Platform/StringConverter.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SyncEvent.h b/src/Platform/SyncEvent.h index fde6380f..bfd9e2d1 100644 --- a/src/Platform/SyncEvent.h +++ b/src/Platform/SyncEvent.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/System.h b/src/Platform/System.h index 5024568f..d5fb0e00 100644 --- a/src/Platform/System.h +++ b/src/Platform/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SystemException.h b/src/Platform/SystemException.h index ede3c5cf..2c1ab25a 100644 --- a/src/Platform/SystemException.h +++ b/src/Platform/SystemException.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SystemInfo.h b/src/Platform/SystemInfo.h index 5e1f63c2..57890d46 100644 --- a/src/Platform/SystemInfo.h +++ b/src/Platform/SystemInfo.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/SystemLog.h b/src/Platform/SystemLog.h index cff3f212..a331e966 100644 --- a/src/Platform/SystemLog.h +++ b/src/Platform/SystemLog.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/TextReader.cpp b/src/Platform/TextReader.cpp index bdaf19c2..2dfc7069 100644 --- a/src/Platform/TextReader.cpp +++ b/src/Platform/TextReader.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/TextReader.h b/src/Platform/TextReader.h index bfeaa524..2b96a8db 100644 --- a/src/Platform/TextReader.h +++ b/src/Platform/TextReader.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Thread.h b/src/Platform/Thread.h index 2f16d2a7..6fca11b3 100644 --- a/src/Platform/Thread.h +++ b/src/Platform/Thread.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Time.h b/src/Platform/Time.h index c85b363c..7f82fbcd 100644 --- a/src/Platform/Time.h +++ b/src/Platform/Time.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Directory.cpp b/src/Platform/Unix/Directory.cpp index 50de000b..c27af26a 100644 --- a/src/Platform/Unix/Directory.cpp +++ b/src/Platform/Unix/Directory.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/File.cpp b/src/Platform/Unix/File.cpp index 207efb4e..9c35a2e5 100644 --- a/src/Platform/Unix/File.cpp +++ b/src/Platform/Unix/File.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/FilesystemPath.cpp b/src/Platform/Unix/FilesystemPath.cpp index 1230c2aa..90965448 100644 --- a/src/Platform/Unix/FilesystemPath.cpp +++ b/src/Platform/Unix/FilesystemPath.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Mutex.cpp b/src/Platform/Unix/Mutex.cpp index b69a5c6c..6441ee93 100644 --- a/src/Platform/Unix/Mutex.cpp +++ b/src/Platform/Unix/Mutex.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Pipe.cpp b/src/Platform/Unix/Pipe.cpp index b05acd7c..41ebb506 100644 --- a/src/Platform/Unix/Pipe.cpp +++ b/src/Platform/Unix/Pipe.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Pipe.h b/src/Platform/Unix/Pipe.h index eb79d9dd..b0bf0409 100644 --- a/src/Platform/Unix/Pipe.h +++ b/src/Platform/Unix/Pipe.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Poller.cpp b/src/Platform/Unix/Poller.cpp index 25d2ba71..66ba0ff5 100644 --- a/src/Platform/Unix/Poller.cpp +++ b/src/Platform/Unix/Poller.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Poller.h b/src/Platform/Unix/Poller.h index a46c0359..8ae6e7ae 100644 --- a/src/Platform/Unix/Poller.h +++ b/src/Platform/Unix/Poller.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Process.cpp b/src/Platform/Unix/Process.cpp index 46b14a1e..395d4bc9 100644 --- a/src/Platform/Unix/Process.cpp +++ b/src/Platform/Unix/Process.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -29,3 +29,52 @@ namespace VeraCrypt { - string Process::Execute (const string &processName, const list <string> &arguments, int timeOut, ProcessExecFunctor *execFunctor, const Buffer *inputData) + + bool Process::IsExecutable(const std::string& path) { + struct stat sb; + if (stat(path.c_str(), &sb) == 0) { + return S_ISREG(sb.st_mode) && (sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)); + } + return false; + } + + // Find executable in system paths + std::string Process::FindSystemBinary(const char* name, std::string& errorMsg) { + if (!name) { + errno = EINVAL; // Invalid argument + errorMsg = "Invalid input: name or paths is NULL"; + return ""; + } + + // Default system directories to search for executables +#ifdef TC_MACOSX + const char* defaultDirs[] = {"/usr/local/bin", "/usr/bin", "/bin", "/user/sbin", "/sbin"}; +#elif TC_FREEBSD + const char* defaultDirs[] = {"/sbin", "/bin", "/usr/sbin", "/usr/bin", "/usr/local/sbin", "/usr/local/bin"}; +#elif TC_OPENBSD + const char* defaultDirs[] = {"/sbin", "/bin", "/usr/sbin", "/usr/bin", "/usr/X11R6/bin", "/usr/local/sbin", "/usr/local/bin"}; +#else + const char* defaultDirs[] = {"/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin"}; +#endif + const size_t defaultDirCount = sizeof(defaultDirs) / sizeof(defaultDirs[0]); + + std::string currentPath(name); + + // If path doesn't start with '/', prepend default directories + if (currentPath[0] != '/') { + for (size_t i = 0; i < defaultDirCount; ++i) { + std::string combinedPath = std::string(defaultDirs[i]) + "/" + currentPath; + if (IsExecutable(combinedPath)) { + return combinedPath; + } + } + } else if (IsExecutable(currentPath)) { + return currentPath; + } + + // Prepare error message + errno = ENOENT; // No such file or directory + errorMsg = std::string(name) + " not found in system directories"; + return ""; + } + + string Process::Execute (const string &processNameArg, const list <string> &arguments, int timeOut, ProcessExecFunctor *execFunctor, const Buffer *inputData) { @@ -35,2 +84,14 @@ namespace VeraCrypt + // if execFunctor is null and processName is not absolute path, find it in system paths + string processName; + if (!execFunctor && (processNameArg[0] != '/')) + { + std::string errorMsg; + processName = FindSystemBinary(processNameArg.c_str(), errorMsg); + if (processName.empty()) + throw SystemException(SRC_POS, errorMsg); + } + else + processName = processNameArg; + #if 0 diff --git a/src/Platform/Unix/Process.h b/src/Platform/Unix/Process.h index bb8482f2..83215956 100644 --- a/src/Platform/Unix/Process.h +++ b/src/Platform/Unix/Process.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -33,2 +33,4 @@ namespace VeraCrypt + static bool IsExecutable(const std::string& path); + static std::string FindSystemBinary(const char* name, std::string& errorMsg); static string Execute (const string &processName, const list <string> &arguments, int timeOut = -1, ProcessExecFunctor *execFunctor = nullptr, const Buffer *inputData = nullptr); diff --git a/src/Platform/Unix/SyncEvent.cpp b/src/Platform/Unix/SyncEvent.cpp index 0336164b..f186e555 100644 --- a/src/Platform/Unix/SyncEvent.cpp +++ b/src/Platform/Unix/SyncEvent.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/System.h b/src/Platform/Unix/System.h index 7225dae2..b6a6f092 100644 --- a/src/Platform/Unix/System.h +++ b/src/Platform/Unix/System.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/SystemException.cpp b/src/Platform/Unix/SystemException.cpp index 428edfe7..b29e0370 100644 --- a/src/Platform/Unix/SystemException.cpp +++ b/src/Platform/Unix/SystemException.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/SystemInfo.cpp b/src/Platform/Unix/SystemInfo.cpp index f09674aa..530d3b4b 100644 --- a/src/Platform/Unix/SystemInfo.cpp +++ b/src/Platform/Unix/SystemInfo.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/SystemLog.cpp b/src/Platform/Unix/SystemLog.cpp index 72221375..95b20074 100644 --- a/src/Platform/Unix/SystemLog.cpp +++ b/src/Platform/Unix/SystemLog.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Thread.cpp b/src/Platform/Unix/Thread.cpp index 099c4658..febf9ab2 100644 --- a/src/Platform/Unix/Thread.cpp +++ b/src/Platform/Unix/Thread.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/Unix/Time.cpp b/src/Platform/Unix/Time.cpp index 356dde74..055938f9 100644 --- a/src/Platform/Unix/Time.cpp +++ b/src/Platform/Unix/Time.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Platform/User.h b/src/Platform/User.h index d5b51aad..6ae91fc3 100644 --- a/src/Platform/User.h +++ b/src/Platform/User.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Readme.txt b/src/Readme.txt index a20ab4f8..d5096cbf 100644 --- a/src/Readme.txt +++ b/src/Readme.txt @@ -234,6 +234,6 @@ Copyright Information This software as a whole: -Copyright (c) 2013-2024 IDRIX. All rights reserved. +Copyright (c) 2013-2025 IDRIX. All rights reserved. Portions of this software: -Copyright (c) 2013-2024 IDRIX. All rights reserved. +Copyright (c) 2013-2025 IDRIX. All rights reserved. Copyright (c) 2003-2012 TrueCrypt Developers Association. All rights reserved. diff --git a/src/Release/Setup Files/Product64.wxs b/src/Release/Setup Files/Product64.wxs index 3c621209..c1c57889 100644 --- a/src/Release/Setup Files/Product64.wxs +++ b/src/Release/Setup Files/Product64.wxs @@ -6,3 +6,3 @@ for upgrades to work ; Windows Installer ignores the 4th part --> - <?define var.FullProductVersion = 1.26.17?> + <?define var.FullProductVersion = 1.26.20?> <?define var.ProductName = VeraCrypt $(var.FullProductVersion)?> @@ -14,3 +14,3 @@ <!-- MUST BE regenerated for each new release --> - <?define var.ProductGuid = {D32BFAD3-7B62-40AD-A9BC-9A66EEC75476}?> + <?define var.ProductGuid = {206DCF7E-CA28-421D-B5DE-0AD30E1132CD}?> @@ -824,3 +824,3 @@ <Component Id="cmp340BBEC25292C3BE778BA8F158DB87B1" Guid="{34107694-BD63-4466-9317-E2745861F0FE}"> - <File Id="filDF64E26B5CFC7EDB198C7CEA46690CA0" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\en\Normal Dismount vs Force Dismount.html" Checksum="yes" DiskId="1" /> + <File Id="filDF64E26B5CFC7EDB198C7CEA46690CA0" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\en\Normal Unmount vs Force Unmount.html" Checksum="yes" DiskId="1" /> </Component> @@ -1479,3 +1479,3 @@ <Component Id="cmp4BC713FA989ECC8EC884548781C4F29D" Guid="{191AF27B-1811-4149-9713-2B3913422D32}"> - <File Id="filB4D109A8E9F7C159C41DA988EF4AE5BD" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\en\ru\Normal Dismount vs Force Dismount.html" Checksum="yes" DiskId="1" /> + <File Id="filB4D109A8E9F7C159C41DA988EF4AE5BD" KeyPath="yes" Source="$(sys.CURRENTDIR)\docs\html\en\ru\Normal Unmount vs Force Unmount.html" Checksum="yes" DiskId="1" /> </Component> diff --git a/src/Release/Setup Files/veracrypt-arm64.cat b/src/Release/Setup Files/veracrypt-arm64.cat Binary files differindex a5563a0d..e9c001f2 100644 --- a/src/Release/Setup Files/veracrypt-arm64.cat +++ b/src/Release/Setup Files/veracrypt-arm64.cat diff --git a/src/Release/Setup Files/veracrypt-arm64.sys b/src/Release/Setup Files/veracrypt-arm64.sys Binary files differindex 881b3dbf..524f8b26 100644 --- a/src/Release/Setup Files/veracrypt-arm64.sys +++ b/src/Release/Setup Files/veracrypt-arm64.sys diff --git a/src/Release/Setup Files/veracrypt-x64.cat b/src/Release/Setup Files/veracrypt-x64.cat Binary files differindex f9d50096..ba3958c0 100644 --- a/src/Release/Setup Files/veracrypt-x64.cat +++ b/src/Release/Setup Files/veracrypt-x64.cat diff --git a/src/Release/Setup Files/veracrypt-x64.sys b/src/Release/Setup Files/veracrypt-x64.sys Binary files differindex 7d0bfec1..f65fb677 100644 --- a/src/Release/Setup Files/veracrypt-x64.sys +++ b/src/Release/Setup Files/veracrypt-x64.sys diff --git a/src/Release/Setup Files/veracrypt.Inf b/src/Release/Setup Files/veracrypt.Inf index a1d06fff..a6bb0d1a 100644 --- a/src/Release/Setup Files/veracrypt.Inf +++ b/src/Release/Setup Files/veracrypt.Inf @@ -4,3 +4,3 @@ ;;; -;;; Copyright (c) 2024, IDRIX +;;; Copyright (c) 2025, IDRIX ;;; @@ -12,3 +12,3 @@ ClassGuid = {a0a701c0-a511-42ff-aa6c-06dc0395576f} ;This value is determine Provider = %ProviderString% -DriverVer = 11/24/2024,1.26.17.2 +DriverVer = 02/03/2025,1.26.20.0 CatalogFile = veracrypt.cat diff --git a/src/Setup/ComSetup.cpp b/src/Setup/ComSetup.cpp index 96734303..9ae0a23d 100644 --- a/src/Setup/ComSetup.cpp +++ b/src/Setup/ComSetup.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/ComSetup.h b/src/Setup/ComSetup.h index 85d0f249..f8253dca 100644 --- a/src/Setup/ComSetup.h +++ b/src/Setup/ComSetup.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/Dir.c b/src/Setup/Dir.c index f0a89ced..01c9c36e 100644 --- a/src/Setup/Dir.c +++ b/src/Setup/Dir.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/Dir.h b/src/Setup/Dir.h index fb9dfc6b..68bb44f0 100644 --- a/src/Setup/Dir.h +++ b/src/Setup/Dir.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/MacOSX/template.dmg.bz2 b/src/Setup/MacOSX/template.dmg.bz2 Binary files differindex fe945152..d22b1578 100644 --- a/src/Setup/MacOSX/template.dmg.bz2 +++ b/src/Setup/MacOSX/template.dmg.bz2 diff --git a/src/Setup/MacOSX/veracrypt.pkgproj b/src/Setup/MacOSX/veracrypt.pkgproj index 287adac6..d300fb6f 100755 --- a/src/Setup/MacOSX/veracrypt.pkgproj +++ b/src/Setup/MacOSX/veracrypt.pkgproj @@ -559,3 +559,3 @@ <key>VERSION</key> - <string>1.26.17</string> + <string>1.26.20</string> </dict> @@ -1027,3 +1027,3 @@ https://osxfuse.github.io/ <key>NAME</key> - <string>VeraCrypt 1.26.17</string> + <string>VeraCrypt 1.26.20</string> <key>PAYLOAD_ONLY</key> diff --git a/src/Setup/MacOSX/veracrypt_Legacy.pkgproj b/src/Setup/MacOSX/veracrypt_Legacy.pkgproj index 4a092975..24d0db36 100755 --- a/src/Setup/MacOSX/veracrypt_Legacy.pkgproj +++ b/src/Setup/MacOSX/veracrypt_Legacy.pkgproj @@ -559,3 +559,3 @@ <key>VERSION</key> - <string>1.26.17</string> + <string>1.26.20</string> </dict> diff --git a/src/Setup/MacOSX/veracrypt_fuse-t.pkgproj b/src/Setup/MacOSX/veracrypt_fuse-t.pkgproj index 5641d95f..e209843f 100755 --- a/src/Setup/MacOSX/veracrypt_fuse-t.pkgproj +++ b/src/Setup/MacOSX/veracrypt_fuse-t.pkgproj @@ -559,3 +559,3 @@ <key>VERSION</key> - <string>1.26.17</string> + <string>1.26.20</string> </dict> @@ -811,3 +811,3 @@ <key>VALUE</key> - <string>FUSE-T seems to be missing on your machine. VeraCrypt requires OSXFuse 1.0 or above. + <string>FUSE-T seems to be missing on your machine. VeraCrypt requires FUSE-T 1.0 or above. Please download the latest FUSE-T version from : @@ -822,3 +822,3 @@ https://github.com/macos-fuse-t/fuse-t/releases</string> <string>FUSE-T semble ne pas être installé sur votre machine. VeraCrypt nécessite FUSE-T 1.0 ou supérieur. -Merci de télécharger la dernière version de OSXFuse à partir de : +Merci de télécharger la dernière version de FUSE-T à partir de : https://github.com/macos-fuse-t/fuse-t/releases @@ -1026,3 +1026,3 @@ https://github.com/macos-fuse-t/fuse-t/releases <key>NAME</key> - <string>VeraCrypt 1.26.17</string> + <string>VeraCrypt 1.26.20</string> <key>PAYLOAD_ONLY</key> diff --git a/src/Setup/Portable.rc b/src/Setup/Portable.rc index 1ecfa8fd..03afff77 100644 --- a/src/Setup/Portable.rc +++ b/src/Setup/Portable.rc @@ -28,4 +28,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,20,0 + PRODUCTVERSION 1,26,20,0 FILEFLAGSMASK 0x17L @@ -46,3 +46,3 @@ BEGIN VALUE "FileDescription", "VeraCrypt Portable" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -50,3 +50,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END diff --git a/src/Setup/SelfExtract.c b/src/Setup/SelfExtract.c index c672c364..6a2ce21c 100644 --- a/src/Setup/SelfExtract.c +++ b/src/Setup/SelfExtract.c @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/SelfExtract.h b/src/Setup/SelfExtract.h index bcdb6fdb..25491661 100644 --- a/src/Setup/SelfExtract.h +++ b/src/Setup/SelfExtract.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/Setup.c b/src/Setup/Setup.c index ed236616..4e1812f6 100644 --- a/src/Setup/Setup.c +++ b/src/Setup/Setup.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -1722,3 +1722,3 @@ BOOL DoDriverUnload (HWND hwndDlg) bOK = FALSE; - MessageBoxW (hwndDlg, GetString ("DISMOUNT_ALL_FIRST"), lpszTitle, MB_ICONHAND); + MessageBoxW (hwndDlg, GetString ("UNMOUNT_ALL_FIRST"), lpszTitle, MB_ICONHAND); } diff --git a/src/Setup/Setup.h b/src/Setup/Setup.h index 5ab62bb6..e2f455ae 100644 --- a/src/Setup/Setup.h +++ b/src/Setup/Setup.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/Setup.rc b/src/Setup/Setup.rc index 34b138b7..56aa751d 100644 --- a/src/Setup/Setup.rc +++ b/src/Setup/Setup.rc @@ -30,4 +30,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,20,0 + PRODUCTVERSION 1,26,20,0 FILEFLAGSMASK 0x17L @@ -48,3 +48,3 @@ BEGIN VALUE "FileDescription", "VeraCrypt Setup" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -52,3 +52,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END diff --git a/src/Setup/Wizard.c b/src/Setup/Wizard.c index abf76f69..e00e4475 100644 --- a/src/Setup/Wizard.c +++ b/src/Setup/Wizard.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Setup/Wizard.h b/src/Setup/Wizard.h index 40ff0353..c91c7c70 100644 --- a/src/Setup/Wizard.h +++ b/src/Setup/Wizard.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/SetupDLL/ComSetup.cpp b/src/SetupDLL/ComSetup.cpp index 07c3360a..39a0339e 100644 --- a/src/SetupDLL/ComSetup.cpp +++ b/src/SetupDLL/ComSetup.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/SetupDLL/ComSetup.h b/src/SetupDLL/ComSetup.h index 85d0f249..f8253dca 100644 --- a/src/SetupDLL/ComSetup.h +++ b/src/SetupDLL/ComSetup.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/SetupDLL/Dir.c b/src/SetupDLL/Dir.c index e6a5f153..1451ee9f 100644 --- a/src/SetupDLL/Dir.c +++ b/src/SetupDLL/Dir.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/SetupDLL/Dir.h b/src/SetupDLL/Dir.h index fb9dfc6b..68bb44f0 100644 --- a/src/SetupDLL/Dir.h +++ b/src/SetupDLL/Dir.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/SetupDLL/Setup.c b/src/SetupDLL/Setup.c index 195c9ec3..1f6f414d 100644 --- a/src/SetupDLL/Setup.c +++ b/src/SetupDLL/Setup.c @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is @@ -1472,3 +1472,3 @@ BOOL DoDriverUnload_Dll (MSIHANDLE hInstaller, HWND hwnd) bOK = FALSE; - MSILogAndShow(hInstaller, MSI_WARNING_LEVEL, GetString ("DISMOUNT_ALL_FIRST")); + MSILogAndShow(hInstaller, MSI_WARNING_LEVEL, GetString ("UNMOUNT_ALL_FIRST")); } @@ -3520,2 +3520,2 @@ DllMain( return TRUE; -}
\ No newline at end of file +} diff --git a/src/SetupDLL/Setup.h b/src/SetupDLL/Setup.h index 603c3e63..19448f40 100644 --- a/src/SetupDLL/Setup.h +++ b/src/SetupDLL/Setup.h @@ -8,3 +8,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/SetupDLL/Setup.rc b/src/SetupDLL/Setup.rc index 048b76bf..26a3d4fc 100644 --- a/src/SetupDLL/Setup.rc +++ b/src/SetupDLL/Setup.rc @@ -30,4 +30,4 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,26,17,2 - PRODUCTVERSION 1,26,17,2 + FILEVERSION 1,26,20,0 + PRODUCTVERSION 1,26,20,0 FILEFLAGSMASK 0x17L @@ -48,3 +48,3 @@ BEGIN VALUE "FileDescription", "VeraCryptSetup" - VALUE "FileVersion", "1.26.17" + VALUE "FileVersion", "1.26.20" VALUE "LegalTrademarks", "VeraCrypt" @@ -52,3 +52,3 @@ BEGIN VALUE "ProductName", "VeraCrypt" - VALUE "ProductVersion", "1.26.17" + VALUE "ProductVersion", "1.26.20" END diff --git a/src/Signing/sign.bat b/src/Signing/sign.bat index 8db4b105..1ddb1a70 100644 --- a/src/Signing/sign.bat +++ b/src/Signing/sign.bat @@ -2,4 +2,4 @@ PATH=%PATH%;%WSDK81%\bin\x86;C:\Program Files\7-Zip;C:\Program Files (x86)\7-Zip -set VC_VERSION=1.26.17 -set VC_VERSION_NBRE=1.26.17 +set VC_VERSION=1.26.20 +set VC_VERSION_NBRE=1.26.20 set SIGNINGPATH=%~dp0 diff --git a/src/Signing/sign_TESTSIGNING.bat b/src/Signing/sign_TESTSIGNING.bat index b34e5f26..ce56de3c 100644 --- a/src/Signing/sign_TESTSIGNING.bat +++ b/src/Signing/sign_TESTSIGNING.bat @@ -2,4 +2,4 @@ PATH=%PATH%;%WSDK81%\bin\x86;C:\Program Files\7-Zip;C:\Program Files (x86)\7-Zip -set VC_VERSION=1.26.17 -set VC_VERSION_NBRE=1.26.17 +set VC_VERSION=1.26.20 +set VC_VERSION_NBRE=1.26.20 set SIGNINGPATH=%~dp0 diff --git a/src/Signing/sign_test.bat b/src/Signing/sign_test.bat index bf47c448..4af038a4 100644 --- a/src/Signing/sign_test.bat +++ b/src/Signing/sign_test.bat @@ -1,4 +1,4 @@ PATH=%PATH%;%WSDK81%\bin\x86;C:\Program Files\7-Zip;C:\Program Files (x86)\7-Zip -set VC_VERSION=1.26.17 -set VC_VERSION_NBRE=1.26.17 +set VC_VERSION=1.26.20 +set VC_VERSION_NBRE=1.26.20 set PFXNAME=TestCertificate\idrix_codeSign.pfx diff --git a/src/Signing/sign_test_debug.bat b/src/Signing/sign_test_debug.bat index 2e33dc70..bdf3cc31 100644 --- a/src/Signing/sign_test_debug.bat +++ b/src/Signing/sign_test_debug.bat @@ -1,4 +1,4 @@ PATH=%PATH%;%WSDK81%\bin\x86;C:\Program Files\7-Zip;C:\Program Files (x86)\7-Zip -set VC_VERSION=1.26.17 -set VC_VERSION_NBRE=1.26.17 +set VC_VERSION=1.26.20 +set VC_VERSION_NBRE=1.26.20 set PFXNAME=TestCertificate\idrix_codeSign.pfx diff --git a/src/Volume/Cipher.cpp b/src/Volume/Cipher.cpp index de240544..54bce73d 100644 --- a/src/Volume/Cipher.cpp +++ b/src/Volume/Cipher.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Cipher.h b/src/Volume/Cipher.h index c53cfbd9..4c0d4893 100644 --- a/src/Volume/Cipher.h +++ b/src/Volume/Cipher.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Crc32.h b/src/Volume/Crc32.h index ebe7aa83..4b1ee045 100644 --- a/src/Volume/Crc32.h +++ b/src/Volume/Crc32.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionAlgorithm.cpp b/src/Volume/EncryptionAlgorithm.cpp index 4a325fe3..5090a254 100644 --- a/src/Volume/EncryptionAlgorithm.cpp +++ b/src/Volume/EncryptionAlgorithm.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionAlgorithm.h b/src/Volume/EncryptionAlgorithm.h index e9f9b9ef..7b6f83dc 100644 --- a/src/Volume/EncryptionAlgorithm.h +++ b/src/Volume/EncryptionAlgorithm.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionMode.cpp b/src/Volume/EncryptionMode.cpp index 6a63efe5..5519f36a 100644 --- a/src/Volume/EncryptionMode.cpp +++ b/src/Volume/EncryptionMode.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionMode.h b/src/Volume/EncryptionMode.h index 0da28fa7..bc9d0a06 100644 --- a/src/Volume/EncryptionMode.h +++ b/src/Volume/EncryptionMode.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionModeWolfCryptXTS.h b/src/Volume/EncryptionModeWolfCryptXTS.h index c9f2d59f..e19a5d23 100644 --- a/src/Volume/EncryptionModeWolfCryptXTS.h +++ b/src/Volume/EncryptionModeWolfCryptXTS.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionModeXTS.cpp b/src/Volume/EncryptionModeXTS.cpp index 001bfcf8..96427e0c 100644 --- a/src/Volume/EncryptionModeXTS.cpp +++ b/src/Volume/EncryptionModeXTS.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionModeXTS.h b/src/Volume/EncryptionModeXTS.h index cbed0d33..80130efd 100644 --- a/src/Volume/EncryptionModeXTS.h +++ b/src/Volume/EncryptionModeXTS.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionTest.cpp b/src/Volume/EncryptionTest.cpp index 9009be66..dfa1e5ea 100644 --- a/src/Volume/EncryptionTest.cpp +++ b/src/Volume/EncryptionTest.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionTest.h b/src/Volume/EncryptionTest.h index fae07cb2..b8f91c4e 100644 --- a/src/Volume/EncryptionTest.h +++ b/src/Volume/EncryptionTest.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionThreadPool.cpp b/src/Volume/EncryptionThreadPool.cpp index 36f8a622..d216df65 100644 --- a/src/Volume/EncryptionThreadPool.cpp +++ b/src/Volume/EncryptionThreadPool.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/EncryptionThreadPool.h b/src/Volume/EncryptionThreadPool.h index a78aee75..1bfa60a1 100644 --- a/src/Volume/EncryptionThreadPool.h +++ b/src/Volume/EncryptionThreadPool.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Hash.cpp b/src/Volume/Hash.cpp index d2e3e649..a990eec9 100644 --- a/src/Volume/Hash.cpp +++ b/src/Volume/Hash.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Hash.h b/src/Volume/Hash.h index 5720eb50..8950982b 100644 --- a/src/Volume/Hash.h +++ b/src/Volume/Hash.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Keyfile.cpp b/src/Volume/Keyfile.cpp index e756cdf1..d38ed523 100644 --- a/src/Volume/Keyfile.cpp +++ b/src/Volume/Keyfile.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Keyfile.h b/src/Volume/Keyfile.h index 1d87a983..f087fc70 100644 --- a/src/Volume/Keyfile.h +++ b/src/Volume/Keyfile.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Pkcs5Kdf.cpp b/src/Volume/Pkcs5Kdf.cpp index e7392d0c..7dad9ebc 100644 --- a/src/Volume/Pkcs5Kdf.cpp +++ b/src/Volume/Pkcs5Kdf.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Pkcs5Kdf.h b/src/Volume/Pkcs5Kdf.h index fc83eb06..399d53fb 100644 --- a/src/Volume/Pkcs5Kdf.h +++ b/src/Volume/Pkcs5Kdf.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Version.h b/src/Volume/Version.h index b2f9215c..8e00d81f 100644 --- a/src/Volume/Version.h +++ b/src/Volume/Version.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Volume.cpp b/src/Volume/Volume.cpp index 524f2395..b06279b7 100644 --- a/src/Volume/Volume.cpp +++ b/src/Volume/Volume.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Volume.h b/src/Volume/Volume.h index 4b91e435..e924df9b 100644 --- a/src/Volume/Volume.h +++ b/src/Volume/Volume.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/Volume.make b/src/Volume/Volume.make index 52d212eb..a4f62562 100644 --- a/src/Volume/Volume.make +++ b/src/Volume/Volume.make @@ -45,2 +45,3 @@ ifneq "$(COMPILE_ASM)" "false" OBJS += ../Crypto/Aes_hw_cpu.o + OBJSEX += ../Crypto/Aes_hw_armv8.oo OBJS += ../Crypto/Aescrypt.o @@ -51,2 +52,3 @@ ifneq "$(COMPILE_ASM)" "false" OBJSEX += ../Crypto/sha512-nayuki.oo + OBJSEX += ../Crypto/sha256_armv8.oo OBJSEX += ../Crypto/sha256_avx1.oo @@ -80,2 +82,6 @@ else ifeq "$(CPU_ARCH)" "x64" OBJS += ../Crypto/sha512_sse4_x64.o +else ifeq "$(CPU_ARCH)" "arm64" + OBJARMV8CRYPTO += ../Crypto/Aes_hw_armv8.oarmv8crypto + OBJS += ../Crypto/Aescrypt.o + OBJARMV8CRYPTO += ../Crypto/sha256_armv8.oarmv8crypto else @@ -142,2 +148,14 @@ ifeq "$(PLATFORM)" "MacOSX" ifneq "$(COMPILE_ASM)" "false" +../Crypto/Aes_hw_armv8.oo: ../Crypto/Aes_hw_armv8.c + @echo Compiling $(<F) + $(CC) $(CFLAGS_ARM64) -c ../Crypto/Aes_hw_armv8.c -o ../Crypto/Aes_hw_armv8_arm64.o + $(CC) $(CFLAGS_X64) -c ../Crypto/Aes_hw_armv8.c -o ../Crypto/Aes_hw_armv8_x64.o + lipo -create ../Crypto/Aes_hw_armv8_arm64.o ../Crypto/Aes_hw_armv8_x64.o -output ../Crypto/Aes_hw_armv8.oo + rm -fr ../Crypto/Aes_hw_armv8_arm64.o ../Crypto/Aes_hw_armv8_x64.o +../Crypto/sha256_armv8.oo: ../Crypto/sha256_armv8.c + @echo Compiling $(<F) + $(CC) $(CFLAGS_ARM64) -c ../Crypto/sha256_armv8.c -o ../Crypto/sha256_armv8_arm64.o + $(CC) $(CFLAGS_X64) -c ../Crypto/sha256_armv8.c -o ../Crypto/sha256_armv8_x64.o + lipo -create ../Crypto/sha256_armv8_arm64.o ../Crypto/sha256_armv8_x64.o -output ../Crypto/sha256_armv8.oo + rm -fr ../Crypto/sha256_armv8_arm64.o ../Crypto/sha256_armv8_x64.o ../Crypto/Aes_asm.oo: ../Crypto/Aes_x86.asm ../Crypto/Aes_x64.asm diff --git a/src/Volume/VolumeException.cpp b/src/Volume/VolumeException.cpp index 0ba9ec34..e1e8fbf8 100644 --- a/src/Volume/VolumeException.cpp +++ b/src/Volume/VolumeException.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeException.h b/src/Volume/VolumeException.h index 8185fab9..8e88a576 100644 --- a/src/Volume/VolumeException.h +++ b/src/Volume/VolumeException.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeHeader.cpp b/src/Volume/VolumeHeader.cpp index 2b8699a3..f3eaba9b 100644 --- a/src/Volume/VolumeHeader.cpp +++ b/src/Volume/VolumeHeader.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeHeader.h b/src/Volume/VolumeHeader.h index 18a52950..95018b71 100644 --- a/src/Volume/VolumeHeader.h +++ b/src/Volume/VolumeHeader.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeInfo.cpp b/src/Volume/VolumeInfo.cpp index f3b044b7..f982c077 100644 --- a/src/Volume/VolumeInfo.cpp +++ b/src/Volume/VolumeInfo.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeInfo.h b/src/Volume/VolumeInfo.h index ad6c2ca4..549b9fbd 100644 --- a/src/Volume/VolumeInfo.h +++ b/src/Volume/VolumeInfo.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeLayout.cpp b/src/Volume/VolumeLayout.cpp index 3600d76f..8077a1ab 100644 --- a/src/Volume/VolumeLayout.cpp +++ b/src/Volume/VolumeLayout.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeLayout.h b/src/Volume/VolumeLayout.h index 32b646ad..810d387f 100644 --- a/src/Volume/VolumeLayout.h +++ b/src/Volume/VolumeLayout.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumePassword.cpp b/src/Volume/VolumePassword.cpp index 9ba3ebce..28f1daaf 100644 --- a/src/Volume/VolumePassword.cpp +++ b/src/Volume/VolumePassword.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumePassword.h b/src/Volume/VolumePassword.h index c1e6b9b6..ee75636e 100644 --- a/src/Volume/VolumePassword.h +++ b/src/Volume/VolumePassword.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumePasswordCache.cpp b/src/Volume/VolumePasswordCache.cpp index bd87a858..0f7f621d 100644 --- a/src/Volume/VolumePasswordCache.cpp +++ b/src/Volume/VolumePasswordCache.cpp @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumePasswordCache.h b/src/Volume/VolumePasswordCache.h index 21e62804..3e153467 100644 --- a/src/Volume/VolumePasswordCache.h +++ b/src/Volume/VolumePasswordCache.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is diff --git a/src/Volume/VolumeSlot.h b/src/Volume/VolumeSlot.h index 153f34a4..b88ea411 100644 --- a/src/Volume/VolumeSlot.h +++ b/src/Volume/VolumeSlot.h @@ -6,3 +6,3 @@ Modifications and additions to the original source code (contained in this file) - and all other portions of this file are Copyright (c) 2013-2017 IDRIX + and all other portions of this file are Copyright (c) 2013-2025 IDRIX and are governed by the Apache License 2.0 the full text of which is |