Skip to content

Commit

Permalink
TrueCrypt Source Version 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Truecrypt Foundation authored and FreeApophis committed May 29, 2014
1 parent ffebfc5 commit ab2928f
Show file tree
Hide file tree
Showing 386 changed files with 8,356 additions and 2,460 deletions.
2 changes: 1 addition & 1 deletion Boot/Windows/Bios.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
4 changes: 4 additions & 0 deletions Boot/Windows/Boot.vcproj
Expand Up @@ -144,6 +144,10 @@
<Filter
Name="Crypto"
>
<File
RelativePath="..\..\Crypto\Aes_hw_cpu.asm"
>
</File>
<File
RelativePath="..\..\Crypto\AesSmall.c"
>
Expand Down
10 changes: 5 additions & 5 deletions Boot/Windows/BootCommon.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand All @@ -15,19 +15,19 @@
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x060a

#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * SECTOR_SIZE)
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)

#define TC_BOOT_VOLUME_HEADER_SECTOR (TC_BOOT_LOADER_AREA_SECTOR_COUNT - 1)
#define TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET (TC_BOOT_VOLUME_HEADER_SECTOR * SECTOR_SIZE)
#define TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET (TC_BOOT_VOLUME_HEADER_SECTOR * TC_SECTOR_SIZE_BIOS)

#define TC_CD_BOOTSECTOR_OFFSET 0xd000
#define TC_CD_BOOT_LOADER_SECTOR 26

#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR TC_BOOT_LOADER_AREA_SECTOR_COUNT
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR * SECTOR_SIZE)
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR * TC_SECTOR_SIZE_BIOS)

#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR + TC_BOOT_LOADER_AREA_SECTOR_COUNT)
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET (TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR * SECTOR_SIZE)
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET (TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR * TC_SECTOR_SIZE_BIOS)

#define TC_MBR_SECTOR 0
#define TC_MAX_MBR_BOOT_CODE_SIZE 440
Expand Down
9 changes: 7 additions & 2 deletions Boot/Windows/BootConfig.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down Expand Up @@ -43,6 +43,11 @@ void ReadBootSectorUserConfiguration ()
goto ret;

userConfig = SectorBuffer[TC_BOOT_SECTOR_USER_CONFIG_OFFSET];

#ifdef TC_WINDOWS_BOOT_AES
EnableHwEncryption (!(userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION));
#endif

PreventBootMenu = (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC);

memcpy (CustomUserMessage, SectorBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
Expand All @@ -55,7 +60,7 @@ void ReadBootSectorUserConfiguration ()

DisableScreenOutput();
}

OuterVolumeBackupHeaderCrc = *(uint32 *) (SectorBuffer + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET);

ret:
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootConfig.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootConsoleIo.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootConsoleIo.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootCrt.asm
@@ -1,7 +1,7 @@
;
; Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
;
; Governed by the TrueCrypt License 2.8 the full text of which is contained in
; Governed by the TrueCrypt License 3.0 the full text of which is contained in
; the file License.txt included in TrueCrypt binary and source code distribution
; packages.
;
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootDebug.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootDebug.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
11 changes: 7 additions & 4 deletions Boot/Windows/BootDefs.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand All @@ -17,9 +17,9 @@

# ifdef TC_WINDOWS_BOOT_AES
# ifdef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
# define TC__BOOT_MEMORY_REQUIRED 29
# define TC__BOOT_MEMORY_REQUIRED 30
# else
# define TC__BOOT_MEMORY_REQUIRED 27
# define TC__BOOT_MEMORY_REQUIRED 28
# endif
# elif defined (TC_WINDOWS_BOOT_SERPENT)
# define TC__BOOT_MEMORY_REQUIRED 32
Expand Down Expand Up @@ -84,13 +84,14 @@
// If you add more flags, revise TC__BOOT_CFG_FLAG_AREA_SIZE
#define TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC_HEX (02)
#define TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC_HEX (04)
#define TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC_HEX (10)
#define TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC_HEX (20)

#define TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE (TC_HEX (40) + TC_HEX (80))

// Modifying the following values can introduce incompatibility with previous versions
#define TC__BOOT_USER_CFG_FLAG_SILENT_MODE TC_HEX (01)
#define TC__BOOT_USER_CFG_FLAG_DISABLE_ESC TC_HEX (02)
#define TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC_HEX (04)

// The following items are treated as a 2-bit value (apply TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE to obtain the value)
#define TC__HIDDEN_OS_CREATION_PHASE_NONE 0
Expand Down Expand Up @@ -172,9 +173,11 @@ TC_HIDDEN_OS_CREATION_PHASE_WIPED = TC__HIDDEN_OS_CREATION_PHASE_WIPED
#define TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE
#define TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER
#define TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER
#define TC_BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION
#define TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE
#define TC_BOOT_USER_CFG_FLAG_SILENT_MODE TC__BOOT_USER_CFG_FLAG_SILENT_MODE
#define TC_BOOT_USER_CFG_FLAG_DISABLE_ESC TC__BOOT_USER_CFG_FLAG_DISABLE_ESC
#define TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION
#define TC_HIDDEN_OS_CREATION_PHASE_NONE TC__HIDDEN_OS_CREATION_PHASE_NONE
#define TC_HIDDEN_OS_CREATION_PHASE_CLONING TC__HIDDEN_OS_CREATION_PHASE_CLONING
#define TC_HIDDEN_OS_CREATION_PHASE_WIPING TC__HIDDEN_OS_CREATION_PHASE_WIPING
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootDiskIo.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootDiskIo.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootEncryptedIo.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootEncryptedIo.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
4 changes: 3 additions & 1 deletion Boot/Windows/BootMain.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down Expand Up @@ -1042,6 +1042,8 @@ void main ()

#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
ReadBootSectorUserConfiguration();
#elif defined (TC_WINDOWS_BOOT_AES)
EnableHwEncryption (!(BootSectorFlags & TC_BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION));
#endif

InitVideoMode();
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootMain.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootMemory.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootMemory.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootSector.asm
@@ -1,7 +1,7 @@
;
; Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
;
; Governed by the TrueCrypt License 2.8 the full text of which is contained in
; Governed by the TrueCrypt License 3.0 the full text of which is contained in
; the file License.txt included in TrueCrypt binary and source code distribution
; packages.
;
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/BootStrings.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
4 changes: 2 additions & 2 deletions Boot/Windows/IntFilter.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down Expand Up @@ -177,7 +177,7 @@ bool Int13Filter ()
}


#define TC_MAX_MEMORY_MAP_SIZE 36
#define TC_MAX_MEMORY_MAP_SIZE 80

BiosMemoryMapEntry BiosMemoryMap[TC_MAX_MEMORY_MAP_SIZE];
static size_t BiosMemoryMapSize;
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/IntFilter.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
5 changes: 3 additions & 2 deletions Boot/Windows/Makefile
@@ -1,7 +1,7 @@
#
# Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
# Copyright (c) 2008-2010 TrueCrypt Developers Association. All rights reserved.
#
# Governed by the TrueCrypt License 2.8 the full text of which is contained in
# Governed by the TrueCrypt License 3.0 the full text of which is contained in
# the file License.txt included in TrueCrypt binary and source code distribution
# packages.
#
Expand Down Expand Up @@ -77,6 +77,7 @@ OBJS = $(OBJS) $(OUTDIR)\Rmd160.obj
!if !DEFINED (SINGLE_CIPHER)
OBJS = $(OBJS) $(OUTDIR)\AesSmall.obj
!else if "$(SINGLE_CIPHER)" == "AES"
OBJS = $(OBJS) $(OUTDIR)\Aes_hw_cpu.obj
OBJS = $(OBJS) $(OUTDIR)\AesSmall_x86.obj
OBJS = $(OBJS) $(OUTDIR)\Aestab.obj
!endif
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/Platform.cpp
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
2 changes: 1 addition & 1 deletion Boot/Windows/Platform.h
@@ -1,7 +1,7 @@
/*
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
Governed by the TrueCrypt License 2.8 the full text of which is contained in
Governed by the TrueCrypt License 3.0 the full text of which is contained in
the file License.txt included in TrueCrypt binary and source code distribution
packages.
*/
Expand Down
12 changes: 8 additions & 4 deletions Build/Include/Makefile.inc
@@ -1,7 +1,7 @@
#
# Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
#
# Governed by the TrueCrypt License 2.8 the full text of which is contained in
# Governed by the TrueCrypt License 3.0 the full text of which is contained in
# the file License.txt included in TrueCrypt binary and source code distribution
# packages.
#
Expand All @@ -20,6 +20,10 @@ clean:
@echo Compiling $(<F)
$(CXX) $(CXXFLAGS) -c $< -o $@

%.o: %.asm
@echo Assembling $(<F)
$(AS) $(ASFLAGS) -o $@ $<


# Precompiled headers
%.h.gch: %.h
Expand All @@ -32,15 +36,15 @@ OD_BIN := od -v -t u1 -A n
TR_SED_BIN := tr '\n' ' ' | tr -s ' ' ',' | sed -e 's/^,//g' -e 's/,$$/n/' | tr 'n' '\n'

%.xml.h: %.xml
echo Converting $(<F)
@echo Converting $(<F)
$(OD_BIN) $< | $(TR_SED_BIN) >$@

%.txt.h: %.txt
echo Converting $(<F)
@echo Converting $(<F)
$(OD_BIN) $< | $(TR_SED_BIN) >$@

%.bmp.h: %.bmp
echo Converting $(<F)
@echo Converting $(<F)
$(OD_BIN) $< | $(TR_SED_BIN) >$@


Expand Down

0 comments on commit ab2928f

Please sign in to comment.