signon  8.56
crypto-handlers.cpp File Reference
#include <sys/mount.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <libcryptsetup.h>
#include <QDataStream>
#include <QTextStream>
#include <QProcess>
#include <QLatin1Char>
#include <QFileInfo>
#include <QDir>
#include "crypto-handlers.h"
#include "debug.h"
#include "misc.h"
Include dependency graph for crypto-handlers.cpp:

Go to the source code of this file.

Macros

#define SIGNON_LUKS_DEFAULT_HASH   "ripemd160"
 
#define SIGNON_LUKS_CIPHER_NAME   "aes"
 
#define SIGNON_LUKS_CIPHER_MODE   "xts-plain"
 
#define SIGNON_LUKS_CIPHER   SIGNON_LUKS_CIPHER_NAME "-" SIGNON_LUKS_CIPHER_MODE
 
#define SIGNON_LUKS_KEY_SIZE   256
 
#define SIGNON_LUKS_BASE_KEYSLOT   0
 
#define SIGNON_EXTERNAL_PROCESS_READ_TIMEOUT   300
 
#define KILO_BYTE_SIZE   1024
 
#define MEGA_BYTE_SIZE   (KILO_BYTE_SIZE * 1024)
 
#define MYCRYPT_FLAG_VERIFY   (1 << 0)
 
#define MYCRYPT_FLAG_READONLY   (1 << 1)
 
#define MYCRYPT_FLAG_VERIFY_IF_POSSIBLE   (1 << 2)
 
#define MYCRYPT_FLAG_VERIFY_ON_DELKEY   (1 << 3)
 
#define MYCRYPT_FLAG_NON_EXCLUSIVE_ACCESS   (1 << 4)
 

Functions

int crypt_luksFormatBinary (struct my_crypt_options *options, const char *pwd, unsigned int pwdLen)
 
int crypt_luksOpenBinary (struct my_crypt_options *options, const char *pwd, unsigned int pwdLen)
 
int crypt_removeDevice (struct my_crypt_options *options)
 
int crypt_luksAddKeyBinary (struct my_crypt_options *options, const char *pwd, unsigned int pwdLen, const char *newPwd, unsigned int newPwdLen)
 

Macro Definition Documentation

#define KILO_BYTE_SIZE   1024

Definition at line 54 of file crypto-handlers.cpp.

#define MEGA_BYTE_SIZE   (KILO_BYTE_SIZE * 1024)

Definition at line 55 of file crypto-handlers.cpp.

Referenced by PartitionHandler::createPartitionFile().

#define MYCRYPT_FLAG_NON_EXCLUSIVE_ACCESS   (1 << 4)

Definition at line 245 of file crypto-handlers.cpp.

Referenced by crypt_luksOpenBinary().

#define MYCRYPT_FLAG_READONLY   (1 << 1)

Definition at line 242 of file crypto-handlers.cpp.

Referenced by crypt_luksOpenBinary().

#define MYCRYPT_FLAG_VERIFY   (1 << 0)
#define MYCRYPT_FLAG_VERIFY_IF_POSSIBLE   (1 << 2)

Definition at line 243 of file crypto-handlers.cpp.

#define MYCRYPT_FLAG_VERIFY_ON_DELKEY   (1 << 3)

Definition at line 244 of file crypto-handlers.cpp.

#define SIGNON_EXTERNAL_PROCESS_READ_TIMEOUT   300

Definition at line 52 of file crypto-handlers.cpp.

Referenced by SystemCommandLineCallHandler::makeCall().

#define SIGNON_LUKS_BASE_KEYSLOT   0

Definition at line 50 of file crypto-handlers.cpp.

Referenced by CryptsetupHandler::formatFile().

#define SIGNON_LUKS_CIPHER   SIGNON_LUKS_CIPHER_NAME "-" SIGNON_LUKS_CIPHER_MODE
#define SIGNON_LUKS_CIPHER_MODE   "xts-plain"

Definition at line 46 of file crypto-handlers.cpp.

Referenced by crypt_luksFormatBinary().

#define SIGNON_LUKS_CIPHER_NAME   "aes"

Definition at line 45 of file crypto-handlers.cpp.

Referenced by crypt_luksFormatBinary().

#define SIGNON_LUKS_DEFAULT_HASH   "ripemd160"

Definition at line 43 of file crypto-handlers.cpp.

#define SIGNON_LUKS_KEY_SIZE   256

Function Documentation

int crypt_luksAddKeyBinary ( struct my_crypt_options *  options,
const char *  pwd,
unsigned int  pwdLen,
const char *  newPwd,
unsigned int  newPwdLen 
)

Definition at line 533 of file crypto-handlers.cpp.

References MYCRYPT_FLAG_VERIFY.

Referenced by CryptsetupHandler::addKeySlot().

int crypt_luksFormatBinary ( struct my_crypt_options *  options,
const char *  pwd,
unsigned int  pwdLen 
)
int crypt_luksOpenBinary ( struct my_crypt_options *  options,
const char *  pwd,
unsigned int  pwdLen 
)
int crypt_removeDevice ( struct my_crypt_options *  options)

Definition at line 487 of file crypto-handlers.cpp.

Referenced by CryptsetupHandler::closeFile().