static char *get_params(struct crypt_dm_active_device *dmd)
{
int r, max_size;
- char *params, *hexkey, *features = "";
+ char *params, *hexkey;
+ const char *features = "";
if (dmd->flags & CRYPT_ACTIVATE_ALLOW_DISCARDS) {
if (dm_flags() & DM_DISCARDS_SUPPORTED) {
- features =" 1 allow_discards";
+ features = " 1 allow_discards";
log_dbg("Discard/TRIM is allowed.");
} else
log_dbg("Discard/TRIM is not supported by the kernel.");
// FIXME
if (!cd->plain_uuid && dm_query_device(name, DM_ACTIVE_UUID, &dmd) >= 0)
- cd->plain_uuid = (char*)dmd.uuid;
+ cd->plain_uuid = CONST_CAST(char*)dmd.uuid;
free(dm_cipher);
return r;
/* Underlying device is not readable but crypt mapping exists */
if (r == -ENOTBLK) {
- free((char*)dmd.device);
+ free(CONST_CAST(void*)dmd.device);
dmd.device = NULL;
r = crypt_init(cd, NULL);
}
*cd = NULL;
}
crypt_free_volume_key(dmd.vk);
- free((char*)dmd.device);
- free((char*)dmd.cipher);
- free((char*)dmd.uuid);
+ free(CONST_CAST(void*)dmd.device);
+ free(CONST_CAST(void*)dmd.cipher);
+ free(CONST_CAST(void*)dmd.uuid);
return r;
}
}
out:
crypt_free_volume_key(dmd.vk);
- free((char*)dmd.cipher);
- free((char*)dmd.device);
- free((char*)dmd.uuid);
+ free(CONST_CAST(void*)dmd.cipher);
+ free(CONST_CAST(void*)dmd.device);
+ free(CONST_CAST(void*)dmd.uuid);
return r;
}
free(cd->type);
/* used in plain device only */
- free((char*)cd->plain_hdr.hash);
+ free(CONST_CAST(void*)cd->plain_hdr.hash);
free(cd->plain_cipher);
free(cd->plain_cipher_mode);
free(cd->plain_uuid);
/* used in loop-AES device only */
- free((char*)cd->loopaes_hdr.hash);
+ free(CONST_CAST(void*)cd->loopaes_hdr.hash);
free(cd->loopaes_cipher);
free(cd->loopaes_uuid);
goto out;
if (new_passphrase) {
- new_password = (char *)new_passphrase;
+ new_password = CONST_CAST(char*)new_passphrase;
new_passwordLen = new_passphrase_size;
} else {
r = key_from_terminal(cd, _("Enter new passphrase for key slot: "),