mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-08 01:10:03 +01:00
Fix crypt_activate_by_keyfile() to work with PLAIN devices.
(allows systemd swap with /dev/urandom activation) git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@385 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -601,6 +601,15 @@ static void AddDevicePlain(void)
|
||||
EQ_(key_size, crypt_get_volume_key_size(cd));
|
||||
EQ_(0, crypt_get_data_offset(cd));
|
||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||
|
||||
// now with keyfile
|
||||
OK_(_prepare_keyfile(KEYFILE1, KEY1));
|
||||
FAIL_(crypt_activate_by_keyfile(cd, NULL, CRYPT_ANY_SLOT, KEYFILE1, 0, 0), "cannot verify key with plain");
|
||||
EQ_(0, crypt_activate_by_keyfile(cd, CDEVICE_1, CRYPT_ANY_SLOT, KEYFILE1, 0, 0));
|
||||
EQ_(crypt_status(cd, CDEVICE_1), CRYPT_ACTIVE);
|
||||
OK_(crypt_deactivate(cd, CDEVICE_1));
|
||||
_remove_keyfiles();
|
||||
|
||||
crypt_free(cd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user