mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-12 03:10:08 +01:00
Fix api test on kernels with capi format support.
This commit is contained in:
@@ -1727,15 +1727,17 @@ static void ResizeDeviceLuks2(void)
|
|||||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||||
CRYPT_FREE(cd);
|
CRYPT_FREE(cd);
|
||||||
|
|
||||||
OK_(crypt_init(&cd, DMDIR L_DEVICE_OK));
|
if (t_dm_capi_string_supported()) {
|
||||||
OK_(crypt_set_pbkdf_type(cd, &min_pbkdf2));
|
OK_(crypt_init(&cd, DMDIR L_DEVICE_OK));
|
||||||
OK_(crypt_format(cd, CRYPT_LUKS2, capi_cipher, capi_cipher_mode, NULL, key, key_size, NULL));
|
OK_(crypt_set_pbkdf_type(cd, &min_pbkdf2));
|
||||||
OK_(crypt_activate_by_volume_key(cd, CDEVICE_1, key, key_size, 0));
|
OK_(crypt_format(cd, CRYPT_LUKS2, capi_cipher, capi_cipher_mode, NULL, key, key_size, NULL));
|
||||||
OK_(crypt_resize(cd, CDEVICE_1, 8));
|
OK_(crypt_activate_by_volume_key(cd, CDEVICE_1, key, key_size, 0));
|
||||||
if (!t_device_size(DMDIR CDEVICE_1, &r_size))
|
OK_(crypt_resize(cd, CDEVICE_1, 8));
|
||||||
EQ_(8, r_size >> TST_SECTOR_SHIFT);
|
if (!t_device_size(DMDIR CDEVICE_1, &r_size))
|
||||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
EQ_(8, r_size >> TST_SECTOR_SHIFT);
|
||||||
CRYPT_FREE(cd);
|
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||||
|
CRYPT_FREE(cd);
|
||||||
|
}
|
||||||
|
|
||||||
_cleanup_dmdevices();
|
_cleanup_dmdevices();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ int t_dm_crypt_cpu_switch_support(void);
|
|||||||
int t_dm_crypt_discard_support(void);
|
int t_dm_crypt_discard_support(void);
|
||||||
int t_dm_integrity_resize_support(void);
|
int t_dm_integrity_resize_support(void);
|
||||||
int t_dm_integrity_recalculate_support(void);
|
int t_dm_integrity_recalculate_support(void);
|
||||||
|
int t_dm_capi_string_supported(void);
|
||||||
int t_set_readahead(const char *device, unsigned value);
|
int t_set_readahead(const char *device, unsigned value);
|
||||||
|
|
||||||
int fips_mode(void);
|
int fips_mode(void);
|
||||||
|
|||||||
@@ -685,6 +685,11 @@ int t_dm_integrity_recalculate_support(void)
|
|||||||
return t_dm_crypt_flags & T_DM_INTEGRITY_RECALC_SUPPORTED;
|
return t_dm_crypt_flags & T_DM_INTEGRITY_RECALC_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int t_dm_capi_string_supported(void)
|
||||||
|
{
|
||||||
|
return t_dm_crypt_flags & T_DM_CAPI_STRING_SUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
/* loop helpers */
|
/* loop helpers */
|
||||||
|
|
||||||
#define LOOP_DEV_MAJOR 7
|
#define LOOP_DEV_MAJOR 7
|
||||||
|
|||||||
Reference in New Issue
Block a user