Main Page | Data Structures | File List | Data Fields | Globals

Cli_restore.c File Reference

Linux: This is the TrueCrypt Cli.c file with the additions that enable key restore. More...

#include <errno.h>
#include <getopt.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
#include <utime.h>
#include "Tcdefs.h"
#include "Crc.h"
#include "Dm-target.h"
#include "Keyfiles.h"
#include "Fat.h"
#include "Format.h"
#include "Password.h"
#include "Progress.h"
#include "Random.h"
#include "Volumes.h"
#include "Tests.h"
#include "Cli.h"
#include "WFU.h"
#include "libconfig.h"

Defines

#define WFU_NORMAL   0
 Indicates a normal header.
#define WFU_HIDDEN   1
 Indicates a hidden header.

Functions

int WFU_is_header_backup (char *volumePath)
 Determins whether the file referenced by volumePath is a header backup or an actual volume.
char * WFU_ReadHeader (char *volumePath, int type, int is_header_backup)
 This function reads the salt from the header of the volume.
BOOL WFU_Restore (char *username, char *volumePath)
 This function restores the CRYPTO_INFO data to a volume or a header bakcup file.


Detailed Description

Linux: This is the TrueCrypt Cli.c file with the additions that enable key restore.


Function Documentation

int WFU_is_header_backup char *  volumePath  )  [static]
 

Determins whether the file referenced by volumePath is a header backup or an actual volume.

Header backups are 2*HEADER_SIZE in length. If the file is 2*HEADER_SIZE in size, then it is assumed to be a backup.

Parameters:
volumePath is the path to the file.
Returns:
1 if the file is 2*HEADER_SIZE (assumed to be a header backup)

0 if the file is not 2*HEADER_SIZE

char* WFU_ReadHeader char *  volumePath,
int  type,
int  is_header_backup
[static]
 

This function reads the salt from the header of the volume.

Normal and hidden headers can be exained in a volume for or a header bakcup file.

Parameters:
volumePath the path of the file.
type WFU_NORMAL or WFU_HIDDEN
is_header_backup 0 indicates are regular file, 1 indicates a header backup file.
Returns:
The return value is a pointer to a static structure containing the salt.

BOOL WFU_Restore char *  username,
char *  volumePath
[static]
 

This function restores the CRYPTO_INFO data to a volume or a header bakcup file.

Parameters:
username The username of the user performing the restore. This user must be authorized to perform restore actions.
volumePath the path of the file.
Returns:
true indicates success, false indicates failure.


Generated on Wed Oct 10 12:38:20 2007 for WFUCrypt by  doxygen 1.3.9.1