lib/validate_encrypt_utils.pm

parse_devices_in_crypttab

parse_devices_in_crypttab();

This sub reads the output of /etc/crypttab and returns %crypttab reference with its data. Check https://www.freedesktop.org/software/systemd/man/crypttab.html for more info about parsing

parse_cryptsetup_status

parse_cryptsetup_status($dev);
$dev The encrypted device name

returns the $status of the encrypted device. If no encrypted device found it returns a reference to an empty anonymous hash.

verify_crypttab_file_existence

verify_crypttab_file_existence();

Verify the existence of /etc/crypttab file.

verify_number_of_encrypted_devices

verify_number_of_encrypted_devices($expected_number, $actual_number);
$expected_number the int number of the expected encrypted devices
$actual_number the int number of the actual encrypted devices

verify_cryptsetup_message

verify_cryptsetup_message($expected_message, $actual_message);
$expected_message A string with the expected status message of a device
$actual_message A string with the actual status message of a device

verify_cryptsetup_properties

verify_cryptsetup_properties($expected_properties, $actual_properties);
$expected_properties A hash reference with the expected LUKS properties
$actual_properties A hash reference with the actual LUKS properties

verify_restoring_luks_backups

verify_restoring_luks_backups(%args);

Where %args expects the following parameters:

$mapped_device path of encrypted device
$backup_file_info unique string to match with the info of the backup file
$backup_path path to a binary file used for backup of the keys

Validates that the device is an encrypted one and tests the backup of the keyslot info.

verify_locked_encrypted_partition

verify_locked_encrypted_partition($enc_disk_part);
$enc_disk_part block device name of the encrypted disk partition, i.e.: sda1