zuluCrypt  5.7.1
About: zuluCrypt is a simple but feature rich solution for hard drives encryption. It can manage PLAIN dm-crypt, LUKS, TrueCrypt and VeraCrypt encrypted volumes.
  Fossies Dox: zuluCrypt-5.7.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

save_and_restore_volume_header.c File Reference
#include "includes.h"
#include "../lib/includes.h"
#include <libcryptsetup.h>
#include <sys/syscall.h>
#include <errno.h>
#include <sys/mman.h>
#include <libintl.h>
#include <locale.h>
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "truecrypt_support_1.h"
Include dependency graph for save_and_restore_volume_header.c:

Go to the source code of this file.

Macros

#define SIZE   512
 
#define ignore_result(x)   if( x ){;}
 
#define path_does_not_exist(x)   stat( x,&xt ) != 0
 

Functions

static int zuluExit (int st, const char *dev)
 
static string_t _create_work_directory (void)
 
static int _secure_file_path (const char **path, const char *source)
 
static const char * _secure_file_path_1 (void)
 
static int _secure_copy_file (const char *source, const char *dest, uid_t uid)
 
static int _save_luks_header (const struct_opts *opts, const char *temp_path, const char *path, uid_t uid)
 
static int zuluExit_1 (int r, string_t st, string_t xt)
 
static string_t _get_password (int *r)
 
static string_t _get_password_0 (int *r)
 
static int _modify_tcrypt (info_t *info, const struct_opts *opts)
 
stringList_t veraCryptVolumePIMValue (info_t *s, const char *type)
 
static int _save_truecrypt_header (const struct_opts *opts, const char *temp_path, const char *path, uid_t uid)
 
static int _restore_truecrypt_header (const struct_opts *opts, const char *temp_path, uid_t uid)
 
static int _save_header (const struct_opts *opts, const char *path, uid_t uid)
 
static int _restore_luks_header (const struct_opts *opts, const char *temp_path)
 
static int _restore_header (const struct_opts *opts, const char *dev, const char *path, int ask_confirmation, uid_t uid)
 
int zuluCryptEXESaveAndRestoreVolumeHeader (const struct_opts *opts, uid_t uid, int option)
 
static int _files_are_equal (const char *file1, const char *file2)
 
static int _save_tmp_header (const char *device, const char *backup)
 
int zuluCryptHeaderMatchBackUpHeader (const char *device, const char *header_backup, uid_t uid)
 

Macro Definition Documentation

◆ ignore_result

#define ignore_result (   x)    if( x ){;}

Definition at line 37 of file save_and_restore_volume_header.c.

◆ path_does_not_exist

#define path_does_not_exist (   x)    stat( x,&xt ) != 0

◆ SIZE

#define SIZE   512

Definition at line 35 of file save_and_restore_volume_header.c.

Function Documentation

◆ _create_work_directory()

◆ _files_are_equal()

static int _files_are_equal ( const char *  file1,
const char *  file2 
)
static

◆ _get_password()

static string_t _get_password ( int *  r)
static

◆ _get_password_0()

static string_t _get_password_0 ( int *  r)
static

◆ _modify_tcrypt()

◆ _restore_header()

◆ _restore_luks_header()

static int _restore_luks_header ( const struct_opts opts,
const char *  temp_path 
)
static

Definition at line 529 of file save_and_restore_volume_header.c.

References struct_opts_1::device.

Referenced by _restore_header().

◆ _restore_truecrypt_header()

◆ _save_header()

◆ _save_luks_header()

static int _save_luks_header ( const struct_opts opts,
const char *  temp_path,
const char *  path,
uid_t  uid 
)
static

Definition at line 270 of file save_and_restore_volume_header.c.

References _secure_copy_file(), and struct_opts_1::device.

Referenced by _save_header().

◆ _save_tmp_header()

static int _save_tmp_header ( const char *  device,
const char *  backup 
)
static

Definition at line 739 of file save_and_restore_volume_header.c.

Referenced by zuluCryptHeaderMatchBackUpHeader().

◆ _save_truecrypt_header()

◆ _secure_copy_file()

static int _secure_copy_file ( const char *  source,
const char *  dest,
uid_t  uid 
)
static

◆ _secure_file_path()

◆ _secure_file_path_1()

static const char* _secure_file_path_1 ( void  )
static

◆ veraCryptVolumePIMValue()

◆ zuluCryptEXESaveAndRestoreVolumeHeader()

◆ zuluCryptHeaderMatchBackUpHeader()

int zuluCryptHeaderMatchBackUpHeader ( const char *  device,
const char *  header_backup,
uid_t  uid 
)

◆ zuluExit()

static int zuluExit ( int  st,
const char *  dev 
)
static

Definition at line 39 of file save_and_restore_volume_header.c.

References StringFree().

Referenced by zuluCryptEXESaveAndRestoreVolumeHeader().

◆ zuluExit_1()

static int zuluExit_1 ( int  r,
string_t  st,
string_t  xt 
)
static

Definition at line 293 of file save_and_restore_volume_header.c.

References StringMultipleDelete().

Referenced by _modify_tcrypt().