From 700b558fb6b7d6bb6136abbc5d6e036be793a4ea Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Wed, 20 Nov 2013 22:20:15 +0100 Subject: [PATCH] Fix api test to use proper key size. LUKS format now reuires correct kernel parameters always, so validation test must use different but still correct key size. --- tests/api-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api-test.c b/tests/api-test.c index 721d3b57..1312b6f2 100644 --- a/tests/api-test.c +++ b/tests/api-test.c @@ -1310,8 +1310,8 @@ static void LuksHeaderRestore(void) // volume key_size mismatch OK_(crypt_init(&cd, DMDIR L_DEVICE_OK)); - memcpy(key2, key, key_size - 1); - OK_(crypt_format(cd, CRYPT_LUKS1, cipher, cipher_mode, NULL, key2, key_size - 1, ¶ms)); + memcpy(key2, key, key_size / 2); + OK_(crypt_format(cd, CRYPT_LUKS1, cipher, cipher_mode, NULL, key2, key_size / 2, ¶ms)); FAIL_(crypt_header_restore(cd, CRYPT_LUKS1, VALID_HEADER), "Volume keysize mismatch"); crypt_free(cd);