16 files changed:
#define PLAIN_HASH_LEN_MAX 256
#define PLAIN_HASH_LEN_MAX 256
-int crypt_plain_hash(struct crypt_device *ctx,
+int crypt_plain_hash(struct crypt_device *ctx __attribute__((unused)),
const char *hash_name,
char *key, size_t key_size,
const char *passphrase, size_t passphrase_size)
const char *hash_name,
char *key, size_t key_size,
const char *passphrase, size_t passphrase_size)
-int crypt_backend_init(struct crypt_device *ctx)
+int crypt_backend_init(struct crypt_device *ctx __attribute__((unused)))
{
if (crypto_backend_initialised)
return 0;
{
if (crypto_backend_initialised)
return 0;
- if (length > ctx->hash_len)
+ if (length > (size_t)ctx->hash_len)
return -EINVAL;
hash = gcry_md_read(ctx->hd, ctx->hash_id);
return -EINVAL;
hash = gcry_md_read(ctx->hd, ctx->hash_id);
- if (length > ctx->hash_len)
+ if (length > (size_t)ctx->hash_len)
return -EINVAL;
hash = gcry_md_read(ctx->hd, ctx->hash_id);
return -EINVAL;
hash = gcry_md_read(ctx->hd, ctx->hash_id);
ssize_t r;
r = send(ctx->opfd, buffer, length, MSG_MORE);
ssize_t r;
r = send(ctx->opfd, buffer, length, MSG_MORE);
- if (r < 0 || r < length)
+ if (r < 0 || (size_t)r < length)
- if (length > ctx->hash_len)
+ if (length > (size_t)ctx->hash_len)
return -EINVAL;
r = read(ctx->opfd, buffer, length);
return -EINVAL;
r = read(ctx->opfd, buffer, length);
ssize_t r;
r = send(ctx->opfd, buffer, length, MSG_MORE);
ssize_t r;
r = send(ctx->opfd, buffer, length, MSG_MORE);
- if (r < 0 || r < length)
+ if (r < 0 || (size_t)r < length)
- if (length > ctx->hash_len)
+ if (length > (size_t)ctx->hash_len)
return -EINVAL;
r = read(ctx->opfd, buffer, length);
return -EINVAL;
r = read(ctx->opfd, buffer, length);
unsigned char tmp[64];
unsigned int tmp_len;
unsigned char tmp[64];
unsigned int tmp_len;
- if (length > ctx->hash->length)
+ if (length > (size_t)ctx->hash->length)
return -EINVAL;
if (PK11_DigestFinal(ctx->md, tmp, &tmp_len, length) != SECSuccess)
return -EINVAL;
if (PK11_DigestFinal(ctx->md, tmp, &tmp_len, length) != SECSuccess)
unsigned char tmp[64];
unsigned int tmp_len;
unsigned char tmp[64];
unsigned int tmp_len;
- if (length > ctx->hash->length)
+ if (length > (size_t)ctx->hash->length)
return -EINVAL;
if (PK11_DigestFinal(ctx->md, tmp, &tmp_len, length) != SECSuccess)
return -EINVAL;
if (PK11_DigestFinal(ctx->md, tmp, &tmp_len, length) != SECSuccess)
unsigned char tmp[EVP_MAX_MD_SIZE];
unsigned int tmp_len = 0;
unsigned char tmp[EVP_MAX_MD_SIZE];
unsigned int tmp_len = 0;
- if (length > ctx->hash_len)
+ if (length > (size_t)ctx->hash_len)
return -EINVAL;
if (EVP_DigestFinal_ex(&ctx->md, tmp, &tmp_len) != 1)
return -EINVAL;
if (EVP_DigestFinal_ex(&ctx->md, tmp, &tmp_len) != 1)
unsigned char tmp[EVP_MAX_MD_SIZE];
unsigned int tmp_len = 0;
unsigned char tmp[EVP_MAX_MD_SIZE];
unsigned int tmp_len = 0;
- if (length > ctx->hash_len)
+ if (length > (size_t)ctx->hash_len)
return -EINVAL;
HMAC_Final(&ctx->md, tmp, &tmp_len);
return -EINVAL;
HMAC_Final(&ctx->md, tmp, &tmp_len);
static int _dm_udev_wait(uint32_t cookie) { return 0; };
#endif
static int _dm_udev_wait(uint32_t cookie) { return 0; };
#endif
-static int _dm_use_udev()
+static int _dm_use_udev(void)
{
#ifdef USE_UDEV /* cannot be enabled if devmapper is too old */
return dm_udev_get_sync_support();
{
#ifdef USE_UDEV /* cannot be enabled if devmapper is too old */
return dm_udev_get_sync_support();
-static void set_dm_error(int level, const char *file, int line,
+__attribute__((format(printf, 4, 5)))
+static void set_dm_error(int level,
+ const char *file __attribute__((unused)),
+ int line __attribute__((unused)),
const char *f, ...)
{
char *msg = NULL;
const char *f, ...)
{
char *msg = NULL;
static void hex_key(char *hexkey, size_t key_size, const char *key)
{
static void hex_key(char *hexkey, size_t key_size, const char *key)
{
for(i = 0; i < key_size; i++)
sprintf(&hexkey[i * 2], "%02x", (unsigned char)key[i]);
for(i = 0; i < key_size; i++)
sprintf(&hexkey[i * 2], "%02x", (unsigned char)key[i]);
{
char *ptr, uuid2[UUID_LEN] = {0};
uuid_t uu;
{
char *ptr, uuid2[UUID_LEN] = {0};
uuid_t uu;
/* Remove '-' chars */
if (uuid && !uuid_parse(uuid, uu)) {
/* Remove '-' chars */
if (uuid && !uuid_parse(uuid, uu)) {
static const char *get_hash(unsigned int key_size)
{
static const char *get_hash(unsigned int key_size)
{
switch (key_size) {
case 16: hash = "sha256"; break;
switch (key_size) {
case 16: hash = "sha256"; break;
{
const char *hash_name;
char tweak, *key_ptr;
{
const char *hash_name;
char tweak, *key_ptr;
- int r, i, key_len_input;
+ unsigned i, key_len_input;
+ int r;
hash_name = hash_override ?: get_hash(key_len_output);
tweak = get_tweak(keys_count);
hash_name = hash_override ?: get_hash(key_len_output);
tweak = get_tweak(keys_count);
size_t buffer_len)
{
const char *keys[LOOPAES_KEYS_MAX];
size_t buffer_len)
{
const char *keys[LOOPAES_KEYS_MAX];
- int i, key_index, key_len, offset;
+ unsigned i, key_index, key_len, offset;
log_dbg("Parsing loop-AES keyfile of size %d.", buffer_len);
log_dbg("Parsing loop-AES keyfile of size %d.", buffer_len);
#include <errno.h>
#include "crypto_backend.h"
#include "internal.h"
#include <errno.h>
#include "crypto_backend.h"
#include "internal.h"
static void XORblock(const char *src1, const char *src2, char *dst, size_t n)
{
static void XORblock(const char *src1, const char *src2, char *dst, size_t n)
{
static int devfd=-1;
static int setup_mapping(const char *cipher, const char *name,
static int devfd=-1;
static int setup_mapping(const char *cipher, const char *name,
- const char *device, unsigned int payloadOffset,
const char *key, size_t keyLength,
unsigned int sector, size_t srcLength,
int mode, struct crypt_device *ctx)
const char *key, size_t keyLength,
unsigned int sector, size_t srcLength,
int mode, struct crypt_device *ctx)
keyLength, key, (mode == O_RDONLY), 0);
}
keyLength, key, (mode == O_RDONLY), 0);
}
-static void sigint_handler(int sig)
+static void sigint_handler(int sig __attribute__((unused)))
{
if(devfd >= 0)
close(devfd);
{
if(devfd >= 0)
close(devfd);
kill(getpid(), SIGINT);
}
kill(getpid(), SIGINT);
}
-static char *_error_hint(char *cipherName, char *cipherMode, size_t keyLength)
+static const char *_error_hint(char *cipherMode, size_t keyLength)
#ifdef __linux__
char c, tmp[4] = {0};
struct utsname uts;
#ifdef __linux__
char c, tmp[4] = {0};
struct utsname uts;
signal(SIGINT, sigint_handler);
cleaner_name = name;
signal(SIGINT, sigint_handler);
cleaner_name = name;
- r = setup_mapping(dmCipherSpec, name, device, hdr->payloadOffset,
+ r = setup_mapping(dmCipherSpec, name, device,
key, keyLength, sector, srcLength, mode, ctx);
if(r < 0) {
log_err(ctx, _("Failed to setup dm-crypt key mapping for device %s.\n"
"Check that kernel supports %s cipher (check syslog for more info).\n%s"),
device, dmCipherSpec,
key, keyLength, sector, srcLength, mode, ctx);
if(r < 0) {
log_err(ctx, _("Failed to setup dm-crypt key mapping for device %s.\n"
"Check that kernel supports %s cipher (check syslog for more info).\n%s"),
device, dmCipherSpec,
- _error_hint(hdr->cipherName, hdr->cipherMode, keyLength * 8));
+ _error_hint(hdr->cipherMode, keyLength * 8));
return div_round_up(x, m) * m;
}
return div_round_up(x, m) * m;
}
-const char *dbg_slot_state(crypt_keyslot_info ki)
+static const char *dbg_slot_state(crypt_keyslot_info ki)
{
switch(ki) {
case CRYPT_SLOT_INACTIVE:
{
switch(ki) {
case CRYPT_SLOT_INACTIVE:
struct crypt_device *ctx)
{
int r = 0, devfd = -1;
struct crypt_device *ctx)
{
int r = 0, devfd = -1;
char *buffer = NULL;
struct stat st;
char *buffer = NULL;
struct stat st;
struct crypt_device *ctx)
{
int r = 0, devfd = -1, diff_uuid = 0;
struct crypt_device *ctx)
{
int r = 0, devfd = -1, diff_uuid = 0;
char *buffer = NULL, msg[200];
struct stat st;
struct luks_phdr hdr_file;
char *buffer = NULL, msg[200];
struct stat st;
struct luks_phdr hdr_file;
int require_luks_device,
struct crypt_device *ctx)
{
int require_luks_device,
struct crypt_device *ctx)
{
+ ssize_t hdr_size = sizeof(struct luks_phdr);
int devfd = 0, r = 0;
log_dbg("Reading LUKS header of size %d from backup file %s",
int devfd = 0, r = 0;
log_dbg("Reading LUKS header of size %d from backup file %s",
- sizeof(struct luks_phdr), backup_file);
+ (int)hdr_size, backup_file);
devfd = open(backup_file, O_RDONLY);
if(-1 == devfd) {
devfd = open(backup_file, O_RDONLY);
if(-1 == devfd) {
- if(read(devfd, hdr, sizeof(struct luks_phdr)) < sizeof(struct luks_phdr))
+ if (read(devfd, hdr, hdr_size) < hdr_size)
r = -EIO;
else {
LUKS_fix_header_compatible(hdr);
r = -EIO;
else {
LUKS_fix_header_compatible(hdr);
int require_luks_device,
struct crypt_device *ctx)
{
int require_luks_device,
struct crypt_device *ctx)
{
+ ssize_t hdr_size = sizeof(struct luks_phdr);
int devfd = 0, r = 0;
uint64_t size;
log_dbg("Reading LUKS header of size %d from device %s",
int devfd = 0, r = 0;
uint64_t size;
log_dbg("Reading LUKS header of size %d from device %s",
- sizeof(struct luks_phdr), device);
devfd = open(device,O_RDONLY | O_DIRECT | O_SYNC);
if(-1 == devfd) {
devfd = open(device,O_RDONLY | O_DIRECT | O_SYNC);
if(-1 == devfd) {
- if(read_blockwise(devfd, hdr, sizeof(struct luks_phdr)) < sizeof(struct luks_phdr))
+ if (read_blockwise(devfd, hdr, hdr_size) < hdr_size)
r = -EIO;
else
r = _check_and_convert_hdr(device, hdr, require_luks_device, ctx);
r = -EIO;
else
r = _check_and_convert_hdr(device, hdr, require_luks_device, ctx);
struct luks_phdr *hdr,
struct crypt_device *ctx)
{
struct luks_phdr *hdr,
struct crypt_device *ctx)
{
+ ssize_t hdr_size = sizeof(struct luks_phdr);
int devfd = 0;
unsigned int i;
struct luks_phdr convHdr;
int devfd = 0;
unsigned int i;
struct luks_phdr convHdr;
- memcpy(&convHdr, hdr, sizeof(struct luks_phdr));
+ memcpy(&convHdr, hdr, hdr_size);
memset(&convHdr._padding, 0, sizeof(convHdr._padding));
/* Convert every uint16/32_t item to network byte order */
memset(&convHdr._padding, 0, sizeof(convHdr._padding));
/* Convert every uint16/32_t item to network byte order */
convHdr.keyblock[i].stripes = htonl(hdr->keyblock[i].stripes);
}
convHdr.keyblock[i].stripes = htonl(hdr->keyblock[i].stripes);
}
- r = write_blockwise(devfd, &convHdr, sizeof(struct luks_phdr)) < sizeof(struct luks_phdr) ? -EIO : 0;
+ r = write_blockwise(devfd, &convHdr, hdr_size) < hdr_size ? -EIO : 0;
if (r)
log_err(ctx, _("Error during update of LUKS header on device %s.\n"), device);
close(devfd);
if (r)
log_err(ctx, _("Error during update of LUKS header on device %s.\n"), device);
close(devfd);
unsigned int i=0;
unsigned int blocksPerStripeSet = div_round_up(vk->keylength*stripes,SECTOR_SIZE);
int r;
unsigned int i=0;
unsigned int blocksPerStripeSet = div_round_up(vk->keylength*stripes,SECTOR_SIZE);
int r;
- char luksMagic[] = LUKS_MAGIC;
uuid_t partitionUuid;
int currentSector;
uuid_t partitionUuid;
int currentSector;
+ char luksMagic[] = LUKS_MAGIC;
if (alignPayload == 0)
alignPayload = DEFAULT_DISK_ALIGNMENT / SECTOR_SIZE;
if (alignPayload == 0)
alignPayload = DEFAULT_DISK_ALIGNMENT / SECTOR_SIZE;
}
for(i = 0; i < 39; ++i) {
}
for(i = 0; i < 39; ++i) {
- if (i >= 0 && i < 5) crypt_random_get(NULL, buffer, bufLen, CRYPT_RND_NORMAL);
+ if (i < 5) crypt_random_get(NULL, buffer, bufLen, CRYPT_RND_NORMAL);
else if(i >= 5 && i < 32) wipeSpecial(buffer, bufLen, i - 5);
else if(i >= 32 && i < 38) crypt_random_get(NULL, buffer, bufLen, CRYPT_RND_NORMAL);
else if(i >= 38 && i < 39) memset(buffer, 0xFF, bufLen);
else if(i >= 5 && i < 32) wipeSpecial(buffer, bufLen, i - 5);
else if(i >= 32 && i < 38) crypt_random_get(NULL, buffer, bufLen, CRYPT_RND_NORMAL);
else if(i >= 38 && i < 39) memset(buffer, 0xFF, bufLen);
#include <string.h>
#include <sys/time.h>
#include "crypto_backend.h"
#include <string.h>
#include <sys/time.h>
#include "crypto_backend.h"
static volatile uint64_t __PBKDF2_global_j = 0;
static volatile uint64_t __PBKDF2_performance = 0;
static volatile uint64_t __PBKDF2_global_j = 0;
static volatile uint64_t __PBKDF2_performance = 0;
-static void sigvtalarm(int foo)
+static void sigvtalarm(int foo __attribute__((unused)))
{
__PBKDF2_performance = __PBKDF2_global_j;
}
{
__PBKDF2_performance = __PBKDF2_global_j;
}
#define RANDOM_DEVICE_TIMEOUT 5
/* URANDOM_DEVICE access */
#define RANDOM_DEVICE_TIMEOUT 5
/* URANDOM_DEVICE access */
-static int _get_urandom(struct crypt_device *ctx, char *buf, size_t len)
+static int _get_urandom(struct crypt_device *ctx __attribute__((unused)),
+ char *buf, size_t len)
{
int r;
size_t old_len = len;
{
int r;
size_t old_len = len;
-void crypt_random_exit()
+void crypt_random_exit(void)
{
random_initialised = 0;
{
random_initialised = 0;
-int crypt_random_default_key_rng()
+int crypt_random_default_key_rng(void)
{
if (!strcmp(DEFAULT_RNG, RANDOM_DEVICE))
return CRYPT_RNG_RANDOM;
{
if (!strcmp(DEFAULT_RNG, RANDOM_DEVICE))
return CRYPT_RNG_RANDOM;
-int crypt_get_debug_level()
+int crypt_get_debug_level(void)
_default_log(level, msg, NULL);
}
_default_log(level, msg, NULL);
}
+__attribute__((format(printf, 5, 6)))
void logger(struct crypt_device *cd, int level, const char *file,
int line, const char *format, ...)
{
void logger(struct crypt_device *cd, int level, const char *file,
int line, const char *format, ...)
{
if (key_file && strcmp(key_file, "-")) {
if(passLen < key_size) {
log_err(cd, _("Cannot not read %d bytes from key file %s.\n"),
if (key_file && strcmp(key_file, "-")) {
if(passLen < key_size) {
log_err(cd, _("Cannot not read %d bytes from key file %s.\n"),
+ (int)key_size, key_file);
crypt_safe_free(key);
return NULL;
}
crypt_safe_free(key);
return NULL;
}
uint64_t offset,
const char *uuid,
int read_only,
uint64_t offset,
const char *uuid,
int read_only,
int reload)
{
crypt_status_info ci;
int reload)
{
crypt_status_info ci;
- if (key_size < 0 || key_size > 1024) {
- log_err(cd, _("Invalid key size %d.\n"), key_size);
+ if (key_size > 1024) {
+ log_err(cd, _("Invalid key size %d.\n"), (int)key_size);
passphrase, passphrase_size,
options->key_size, options->size, options->skip,
options->offset, NULL, options->flags & CRYPT_FLAG_READONLY,
passphrase, passphrase_size,
options->key_size, options->size, options->skip,
options->offset, NULL, options->flags & CRYPT_FLAG_READONLY,
- options->flags, update);
crypt_safe_free(passphrase);
crypt_free(cd);
crypt_safe_free(passphrase);
crypt_free(cd);
{
struct crypt_device *cd = NULL;
char *device = NULL, *cipher = NULL, *uuid = NULL, *key = NULL;
{
struct crypt_device *cd = NULL;
char *device = NULL, *cipher = NULL, *uuid = NULL, *key = NULL;
+ const char *type = NULL;
uint64_t size, skip, offset;
int key_size, read_only, r;
uint64_t size, skip, offset;
int key_size, read_only, r;
return r;
uuid = (char *)crypt_get_uuid(cd);
return r;
uuid = (char *)crypt_get_uuid(cd);
- log_std(cd, uuid ?: "");
- log_std(cd, "\n");
+ log_std(cd, "%s\n", uuid ?: "");
crypt_free(cd);
return 0;
}
crypt_free(cd);
return 0;
}
int crypt_load(struct crypt_device *cd,
const char *requested_type,
int crypt_load(struct crypt_device *cd,
const char *requested_type,
+ void *params __attribute__((unused)))
{
struct luks_phdr hdr;
int r;
{
struct luks_phdr hdr;
int r;
cd->volume_key->keylength, 0,
cd->plain_hdr.skip, cd->plain_hdr.offset,
cd->plain_uuid,
cd->volume_key->keylength, 0,
cd->plain_hdr.skip, cd->plain_hdr.offset,
cd->plain_uuid,
- flags & CRYPT_ACTIVATE_READONLY, 0, 0);
+ flags & CRYPT_ACTIVATE_READONLY, 0);
keyslot = 0;
} else if (isLUKS(cd->type)) {
/* provided passphrase, do not retry */
keyslot = 0;
} else if (isLUKS(cd->type)) {
/* provided passphrase, do not retry */
cd->volume_key->keylength, 0,
cd->plain_hdr.skip, cd->plain_hdr.offset,
cd->plain_uuid,
cd->volume_key->keylength, 0,
cd->plain_hdr.skip, cd->plain_hdr.offset,
cd->plain_uuid,
- flags & CRYPT_ACTIVATE_READONLY, 0, 0);
+ flags & CRYPT_ACTIVATE_READONLY, 0);
} else if (isLUKS(cd->type)) {
r = key_from_file(cd, _("Enter passphrase: "), &passphrase_read,
&passphrase_size_read, keyfile, keyfile_size);
} else if (isLUKS(cd->type)) {
r = key_from_file(cd, _("Enter passphrase: "), &passphrase_read,
&passphrase_size_read, keyfile, keyfile_size);
return create_device_helper(cd, name, NULL,
cd->plain_cipher, cd->plain_cipher_mode, NULL, volume_key, volume_key_size,
cd->volume_key->keylength, 0, cd->plain_hdr.skip,
return create_device_helper(cd, name, NULL,
cd->plain_cipher, cd->plain_cipher_mode, NULL, volume_key, volume_key_size,
cd->volume_key->keylength, 0, cd->plain_hdr.skip,
- cd->plain_hdr.offset, cd->plain_uuid, flags & CRYPT_ACTIVATE_READONLY, 0, 0);
+ cd->plain_hdr.offset, cd->plain_uuid, flags & CRYPT_ACTIVATE_READONLY, 0);
}
if (!isLUKS(cd->type)) {
}
if (!isLUKS(cd->type)) {
{
struct volume_key *vk;
char *processed_key = NULL;
{
struct volume_key *vk;
char *processed_key = NULL;
+ unsigned key_len;
+ int r;
key_len = crypt_get_volume_key_size(cd);
if (key_len > *volume_key_size) {
key_len = crypt_get_volume_key_size(cd);
if (key_len > *volume_key_size) {
-int crypt_get_active_device(struct crypt_device *cd,
+int crypt_get_active_device(struct crypt_device *cd __attribute__((unused)),
const char *name,
struct crypt_active_device *cad)
{
const char *name,
struct crypt_active_device *cad)
{
+__attribute__((format(printf, 1, 0)))
void set_error_va(const char *fmt, va_list va)
{
int r;
void set_error_va(const char *fmt, va_list va)
{
int r;
+__attribute__((format(printf, 1, 2)))
void set_error(const char *fmt, ...)
{
va_list va;
void set_error(const char *fmt, ...)
{
va_list va;
char dirpath[MAX_SHORTNAME], fdpath[MAX_SHORTNAME], linkpath[MAX_PATHNAME];
DIR *dirp;
struct dirent *direntry;
char dirpath[MAX_SHORTNAME], fdpath[MAX_SHORTNAME], linkpath[MAX_PATHNAME];
DIR *dirp;
struct dirent *direntry;
int r = 0;
snprintf(dirpath, sizeof(dirpath), "/proc/%d/fd", pid);
int r = 0;
snprintf(dirpath, sizeof(dirpath), "/proc/%d/fd", pid);
{ NULL, NULL, 0, 0, 0, NULL, NULL }
};
{ NULL, NULL, 0, 0, 0, NULL, NULL }
};
+__attribute__((format(printf, 5, 6)))
static void clogger(struct crypt_device *cd, int level, const char *file,
int line, const char *format, ...)
{
static void clogger(struct crypt_device *cd, int level, const char *file,
int line, const char *format, ...)
{
-static int _yesDialog(const char *msg, void *usrptr)
+static int _yesDialog(const char *msg, void *usrptr __attribute__((unused)))
{
char *answer = NULL;
size_t size = 0;
{
char *answer = NULL;
size_t size = 0;
-static void _log(int level, const char *msg, void *usrptr)
+static void _log(int level, const char *msg, void *usrptr __attribute__((unused)))
-static int action_create(int arg)
+static int action_create(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
char cipher[MAX_CIPHER_LEN], cipher_mode[MAX_CIPHER_LEN];
{
struct crypt_device *cd = NULL;
char cipher[MAX_CIPHER_LEN], cipher_mode[MAX_CIPHER_LEN];
-static int action_loopaesOpen(int arg)
+static int action_loopaesOpen(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
struct crypt_params_loopaes params = {
{
struct crypt_device *cd = NULL;
struct crypt_params_loopaes params = {
-static int action_remove(int arg)
+static int action_remove(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_resize(int arg)
+static int action_resize(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_status(int arg)
+static int action_status(int arg __attribute__((unused)))
{
crypt_status_info ci;
struct crypt_active_device cad;
{
crypt_status_info ci;
struct crypt_active_device cad;
-static int action_luksFormat(int arg)
+static int action_luksFormat(int arg __attribute__((unused)))
{
int r = -EINVAL, keysize;
char *msg = NULL, *key = NULL, cipher [MAX_CIPHER_LEN], cipher_mode[MAX_CIPHER_LEN];
{
int r = -EINVAL, keysize;
char *msg = NULL, *key = NULL, cipher [MAX_CIPHER_LEN], cipher_mode[MAX_CIPHER_LEN];
-static int action_luksOpen(int arg)
+static int action_luksOpen(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
uint32_t flags = 0;
{
struct crypt_device *cd = NULL;
uint32_t flags = 0;
-static int action_luksKillSlot(int arg)
+static int action_luksKillSlot(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_luksRemoveKey(int arg)
+static int action_luksRemoveKey(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
char *password = NULL;
{
struct crypt_device *cd = NULL;
char *password = NULL;
-static int action_luksAddKey(int arg)
+static int action_luksAddKey(int arg __attribute__((unused)))
{
int r = -EINVAL, keysize = 0;
char *key = NULL;
{
int r = -EINVAL, keysize = 0;
char *key = NULL;
-static int action_luksChangeKey(int arg)
+static int action_luksChangeKey(int arg __attribute__((unused)))
{
const char *opt_new_key_file = (action_argc > 1 ? action_argv[1] : NULL);
struct crypt_device *cd = NULL;
{
const char *opt_new_key_file = (action_argc > 1 ? action_argv[1] : NULL);
struct crypt_device *cd = NULL;
-static int action_isLuks(int arg)
+static int action_isLuks(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_luksUUID(int arg)
+static int action_luksUUID(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
const char *existing_uuid = NULL;
{
struct crypt_device *cd = NULL;
const char *existing_uuid = NULL;
char *vk = NULL, *password = NULL;
size_t passwordLen = 0;
size_t vk_size;
char *vk = NULL, *password = NULL;
size_t passwordLen = 0;
size_t vk_size;
crypt_set_confirm_callback(cd, _yesDialog, NULL);
if (!_yesDialog(
crypt_set_confirm_callback(cd, _yesDialog, NULL);
if (!_yesDialog(
log_std("LUKS header information for %s\n", crypt_get_device_name(cd));
log_std("Cipher name: \t%s\n", crypt_get_cipher(cd));
log_std("Cipher mode: \t%s\n", crypt_get_cipher_mode(cd));
log_std("LUKS header information for %s\n", crypt_get_device_name(cd));
log_std("Cipher name: \t%s\n", crypt_get_cipher(cd));
log_std("Cipher mode: \t%s\n", crypt_get_cipher_mode(cd));
- log_std("Payload offset:\t%d\n", crypt_get_data_offset(cd));
+ log_std("Payload offset:\t%d\n", (int)crypt_get_data_offset(cd));
log_std("UUID: \t%s\n", crypt_get_uuid(cd));
log_std("UUID: \t%s\n", crypt_get_uuid(cd));
- log_std("MK bits: \t%d\n", vk_size * 8);
+ log_std("MK bits: \t%d\n", (int)vk_size * 8);
log_std("MK dump:\t");
for(i = 0; i < vk_size; i++) {
log_std("MK dump:\t");
for(i = 0; i < vk_size; i++) {
-static int action_luksDump(int arg)
+static int action_luksDump(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_luksSuspend(int arg)
+static int action_luksSuspend(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_luksResume(int arg)
+static int action_luksResume(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_luksBackup(int arg)
+static int action_luksBackup(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r;
{
struct crypt_device *cd = NULL;
int r;
-static int action_luksRestore(int arg)
+static int action_luksRestore(int arg __attribute__((unused)))
{
struct crypt_device *cd = NULL;
int r = 0;
{
struct crypt_device *cd = NULL;
int r = 0;
-static void help(poptContext popt_context, enum poptCallbackReason reason,
- struct poptOption *key, const char * arg, void *data)
+static void help(poptContext popt_context,
+ enum poptCallbackReason reason __attribute__((unused)),
+ struct poptOption *key,
+ const char *arg __attribute__((unused)),
+ void *data __attribute__((unused)))
{
if (key->shortName == '?') {
struct action_type *action;
{
if (key->shortName == '?') {
struct action_type *action;
for (i = 0; i < argc; i++) {
if (i)
log_std(" ");
for (i = 0; i < argc; i++) {
if (i)
log_std(" ");
+ log_std("%s", argv[i]);