summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Broz <gmazyland@gmail.com>2012-12-01 13:43:59 +0100
committerMilan Broz <gmazyland@gmail.com>2012-12-01 13:43:59 +0100
commitd05f020d5a82d9f0fc49401b88eaf6a428ba762f (patch)
tree00571b6475c7972ecc62825b818f9a7de366481e
parentdde57477fcc3ce93fb6b0bc1f916b6ec64521778 (diff)
downloadcryptsetup-d05f020d5a82d9f0fc49401b88eaf6a428ba762f.tar.gz
cryptsetup-d05f020d5a82d9f0fc49401b88eaf6a428ba762f.tar.bz2
cryptsetup-d05f020d5a82d9f0fc49401b88eaf6a428ba762f.zip
Add keyfiles tcrypt test.
-rw-r--r--tests/api-test.c11
-rwxr-xr-xtests/tcrypt-compat-test12
-rw-r--r--tests/tcrypt-images.tar.bz2bin196521 -> 200923 bytes
3 files changed, 18 insertions, 5 deletions
diff --git a/tests/api-test.c b/tests/api-test.c
index eb86809..7f65c6c 100644
--- a/tests/api-test.c
+++ b/tests/api-test.c
@@ -1695,17 +1695,22 @@ static void TcryptTest(void)
struct crypt_device *cd = NULL;
struct crypt_active_device cad;
const char *passphrase = "aaaaaaaaaaaa";
+ const char *kf1 = "tcrypt-images/keyfile1";
+ const char *kf2 = "tcrypt-images/keyfile2";
+ const char *keyfiles[] = { kf1, kf2 };
struct crypt_params_tcrypt params = {
.passphrase = passphrase,
.passphrase_size = strlen(passphrase),
+ .keyfiles = keyfiles,
+ .keyfiles_count = 2,
};
double enc_mbr = 0, dec_mbr = 0;
- const char *tcrypt_dev = "tcrypt-images/tc_5-sha512-xts-aes";
+ const char *tcrypt_dev = "tcrypt-images/tck_5-sha512-xts-aes";
size_t key_size = 64;
char key[key_size], key_def[key_size];
const char *key_hex =
- "e87dd14403a547b440f459aa8284da62db364658a286b94ba2f3c7957c03f290"
- "266d38facd211e12cd0abfc5b41555df6019d73374f85fbcb23fd4efc43b0c64";
+ "98dee64abe44bbf41d171c1f7b3e8eacda6d6b01f459097459a167f8c2872a96"
+ "3979531d1cdc18af62757cf22286f16f8583d848524f128d7594ac2082668c73";
int r;
crypt_decode_key(key_def, key_hex, strlen(key_hex) / 2);
diff --git a/tests/tcrypt-compat-test b/tests/tcrypt-compat-test
index 6cbf33c..1e587b8 100755
--- a/tests/tcrypt-compat-test
+++ b/tests/tcrypt-compat-test
@@ -76,13 +76,21 @@ for file in $(ls $TST_DIR/tc_*-hidden) ; do
echo " [OK]"
done
+echo "HEADER KEYFILES CHECK"
+for file in $(ls $TST_DIR/tck_*) ; do
+ echo -n " $file (hidden)"
+ echo $PASSWORD | $CRYPTSETUP tcryptDump -d $TST_DIR/keyfile1 -d $TST_DIR/keyfile2 $file >/dev/null || fail
+ echo " [OK]"
+done
+
+
if [ $(id -u) != 0 ]; then
echo "WARNING: You must be root to run activation part of test, test skipped."
exit 0
fi
echo "ACTIVATION FS UUID CHECK (LRW/XTS modes only)"
-for file in $(ls $TST_DIR/*-lrw-* $TST_DIR/*-xts-*) ; do
+for file in $(ls $TST_DIR/tc_*-lrw-* $TST_DIR/tc_*-xts-*) ; do
echo -n " $file"
echo $PASSWORD | $CRYPTSETUP tcryptOpen -r $file $MAP || fail
UUID=$(lsblk -n -o UUID /dev/mapper/$MAP)
@@ -92,7 +100,7 @@ for file in $(ls $TST_DIR/*-lrw-* $TST_DIR/*-xts-*) ; do
done
echo "ACTIVATION FS UUID (HIDDEN) CHECK (LRW/XTS modes only)"
-for file in $(ls $TST_DIR/*-lrw-*-hidden $TST_DIR/*-xts-*-hidden) ; do
+for file in $(ls $TST_DIR/tc_*-lrw-*-hidden $TST_DIR/tc_*-xts-*-hidden) ; do
echo -n " $file"
echo $PASSWORD_HIDDEN | $CRYPTSETUP tcryptOpen -r $file $MAP --hidden || fail
UUID=$(lsblk -n -o UUID /dev/mapper/$MAP)
diff --git a/tests/tcrypt-images.tar.bz2 b/tests/tcrypt-images.tar.bz2
index 0557121..b801821 100644
--- a/tests/tcrypt-images.tar.bz2
+++ b/tests/tcrypt-images.tar.bz2
Binary files differ