mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 20:00:08 +01:00
Fix some signed/unsigned warnings.
This commit is contained in:
@@ -1476,7 +1476,7 @@ static int _crypt_format_luks2(struct crypt_device *cd,
|
|||||||
size_t volume_key_size,
|
size_t volume_key_size,
|
||||||
struct crypt_params_luks2 *params)
|
struct crypt_params_luks2 *params)
|
||||||
{
|
{
|
||||||
int r;
|
int r, integrity_key_size;
|
||||||
unsigned long required_alignment = DEFAULT_DISK_ALIGNMENT;
|
unsigned long required_alignment = DEFAULT_DISK_ALIGNMENT;
|
||||||
unsigned long alignment_offset = 0;
|
unsigned long alignment_offset = 0;
|
||||||
unsigned int sector_size = params ? params->sector_size : SECTOR_SIZE;
|
unsigned int sector_size = params ? params->sector_size : SECTOR_SIZE;
|
||||||
@@ -1515,7 +1515,8 @@ static int _crypt_format_luks2(struct crypt_device *cd,
|
|||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (INTEGRITY_key_size(cd, integrity) >= volume_key_size) {
|
integrity_key_size = INTEGRITY_key_size(cd, integrity);
|
||||||
|
if ((integrity_key_size < 0) || (integrity_key_size >= (int)volume_key_size)) {
|
||||||
log_err(cd, _("Volume key is too small for encryption with integrity extensions.\n"));
|
log_err(cd, _("Volume key is too small for encryption with integrity extensions.\n"));
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -3395,7 +3396,7 @@ int crypt_volume_key_get(struct crypt_device *cd,
|
|||||||
if (key_len < 0)
|
if (key_len < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (key_len > *volume_key_size) {
|
if (key_len > (int)*volume_key_size) {
|
||||||
log_err(cd, _("Volume key buffer too small.\n"));
|
log_err(cd, _("Volume key buffer too small.\n"));
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1210,7 +1210,7 @@ static int action_luksKillSlot(void)
|
|||||||
break;
|
break;
|
||||||
case CRYPT_SLOT_INACTIVE:
|
case CRYPT_SLOT_INACTIVE:
|
||||||
log_err(_("Keyslot %d is not active."), opt_key_slot);
|
log_err(_("Keyslot %d is not active."), opt_key_slot);
|
||||||
/* pass through */
|
/* fall through */
|
||||||
case CRYPT_SLOT_INVALID:
|
case CRYPT_SLOT_INVALID:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user