Commit Graph

162 Commits

Author SHA1 Message Date
Ondrej Kozina
08e7c143b3 Add internal code for LUKS2 keyslot params.
This fixes crypt_keyslot_add_by_key where we were unable to store
keyslot (unbound to segment) with different key_size.
The code used (new) volume key size implicitly which could be wrong
if new size was not compatible with cipher parameter for keyslot area.
2018-01-19 13:48:09 +01:00
Ondrej Kozina
83589b7cec Extend LUKS2 specific tests.
Add yet another flawed dm-crypt test (keyring)
and test crypt_get_volume_key_size works
as expected after LUKS2 crypt_format (before
adding first keyslot).
2018-01-18 21:26:55 +01:00
Ondrej Kozina
2f890dea18 Update tests for dm-crypt kernel key bugfix.
cryptsetup now requires dm-crypt v1.18.1 or higher
to use kernel keyring service for passing VKs.

Also, relevant API functions fail if CRYPT_ACTIVATE_KEYRING_KEY
is set, but library is not allowed to use kernel keyring for
VK.
2018-01-18 14:24:24 +01:00
Ondrej Kozina
c740324636 Derive VK kernel key description from digest id
Originally the key description for VK was derived
from segment id. This could lead to ambiguity when
keyslot key is verified and loaded in kernel keyring
using activation functions with CRYPT_ACTIVATE_KEYRING_KEY
flag raised.
2017-12-10 19:56:14 +01:00
Ondrej Kozina
a6aba8cab2 tests: check keyring key is gone after crypt_suspend 2017-12-09 14:53:02 +01:00
Milan Broz
fa1f8c0d87 Limit KDF memory by available physical memory.
On some systems the requested amount of memory causes OOM killer
to kill the process (instead of returning ENOMEM).

For now, we never try to use more than half of available
physical memory.
2017-12-07 10:43:52 +01:00
Andrea Gelmini
a97de38b6b Fix typos. 2017-11-08 10:22:49 +01:00
Ondrej Kozina
e678d5ae8e test: drop useless luks2 test image 2017-10-30 16:09:40 +01:00
Milan Broz
6e3622e0f1 Fix some warning and leaks in api test code. 2017-10-28 11:59:06 +02:00
Milan Broz
892b80ffa4 Do not depend in test on loop code from library sources.
This patch duplicates part of the code because following
switch to non-recursive automake is not easily fixable without this change.

(Automake cannot use top_srcdir anymore in this context.)
2017-10-12 11:46:26 +02:00
Ondrej Kozina
c3b3d7b022 fix api-test for builds without keyring support 2017-09-27 11:03:11 +02:00
Milan Broz
c6d4ebd80c Add libLUKS2 tests. 2017-09-24 19:50:17 +02:00