From 246233c40262c5be2edfa916cf841dd4bce6598e Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 9 Aug 2016 22:08:47 +0200 Subject: Windows EFI Bootloader: modifications to prepare EFI system encryption support (common files with DcsBoot) --- src/Common/Volumes.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/Common/Volumes.h') diff --git a/src/Common/Volumes.h b/src/Common/Volumes.h index fdd1444f..3fe3a450 100644 --- a/src/Common/Volumes.h +++ b/src/Common/Volumes.h @@ -1,11 +1,11 @@ /* Legal Notice: Some portions of the source code contained in this file were - derived from the source code of TrueCrypt 7.1a, which is - Copyright (c) 2003-2012 TrueCrypt Developers Association and which is + derived from the source code of TrueCrypt 7.1a, which is + Copyright (c) 2003-2012 TrueCrypt Developers Association and which is governed by the TrueCrypt License 3.0, also from the source code of Encryption for the Masses 2.02a, which is Copyright (c) 1998-2000 Paul Le Roux - and which is governed by the 'License Agreement for Encryption for the Masses' - Modifications and additions to the original source code (contained in this file) + and which is governed by the 'License Agreement for Encryption for the Masses' + Modifications and additions to the original source code (contained in this file) and all other portions of this file are Copyright (c) 2013-2016 IDRIX and are governed by the Apache License 2.0 the full text of which is contained in the file License.txt included in VeraCrypt binary and source @@ -19,7 +19,7 @@ extern "C" { #endif // Volume header version -#define VOLUME_HEADER_VERSION 0x0005 +#define VOLUME_HEADER_VERSION 0x0005 // Version number written to volume header during format; // specifies the minimum program version required to mount the volume @@ -101,7 +101,7 @@ extern "C" { #define HEADER_SALT_OFFSET 0 #define HEADER_ENCRYPTED_DATA_OFFSET PKCS5_SALT_SIZE #define HEADER_MASTER_KEYDATA_OFFSET 256 - + #define TC_HEADER_OFFSET_MAGIC 64 #define TC_HEADER_OFFSET_VERSION 68 #define TC_HEADER_OFFSET_REQUIRED_VERSION 70 @@ -130,16 +130,20 @@ extern BOOL ReadVolumeHeaderRecoveryMode; uint16 GetHeaderField16 (byte *header, int offset); uint32 GetHeaderField32 (byte *header, int offset); UINT64_STRUCT GetHeaderField64 (byte *header, int offset); -#ifdef TC_WINDOWS_BOOT +#if defined(TC_WINDOWS_BOOT) int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int pim, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo); +#elif defined(_UEFI) +int ReadVolumeHeader(BOOL bBoot, char *encryptedHeader, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo); +int CreateVolumeHeaderInMemory(BOOL bBoot, char *encryptedHeader, int ea, int mode, Password *password, int pkcs5_prf, int pim, char *masterKeydata, PCRYPTO_INFO *retInfo, unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize, unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode); +BOOL RandgetBytes(unsigned char *buf, int len, BOOL forceSlowPoll); #else int ReadVolumeHeader (BOOL bBoot, char *encryptedHeader, Password *password, int pkcs5_prf, int pim, BOOL truecryptMode, PCRYPTO_INFO *retInfo, CRYPTO_INFO *retHeaderCryptoInfo); -#ifdef _WIN32 +#if defined(_WIN32) && !defined(_UEFI) void ComputeBootloaderFingerprint (byte *bootLoaderBuf, unsigned int bootLoaderSize, byte* fingerprint); #endif #endif -#if !defined (DEVICE_DRIVER) && !defined (TC_WINDOWS_BOOT) +#if !defined (DEVICE_DRIVER) && !defined (TC_WINDOWS_BOOT) && !defined(_UEFI) int CreateVolumeHeaderInMemory (HWND hwndDlg, BOOL bBoot, char *encryptedHeader, int ea, int mode, Password *password, int pkcs5_prf, int pim, char *masterKeydata, PCRYPTO_INFO *retInfo, unsigned __int64 volumeSize, unsigned __int64 hiddenVolumeSize, unsigned __int64 encryptedAreaStart, unsigned __int64 encryptedAreaLength, uint16 requiredProgramVersion, uint32 headerFlags, uint32 sectorSize, BOOL bWipeMode); BOOL ReadEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header, DWORD *bytesRead); BOOL WriteEffectiveVolumeHeader (BOOL device, HANDLE fileHandle, byte *header); -- cgit v1.2.3