tcryptDump: fix support for --veracrypt-pim

the user provided PIM value was not forwarded to the respective
implementation dumping the VeraCrypt header information.

extends the tcrypt-compat-test such that tcryptDump is performed
on VeraCrypt containers as well.
This commit is contained in:
Bernhard Kirchen
2018-04-06 13:47:52 +02:00
parent 5a71c6f2eb
commit 6002099288
2 changed files with 5 additions and 2 deletions

View File

@@ -446,6 +446,7 @@ static int action_tcryptDump(void)
.keyfiles_count = opt_keyfiles_count, .keyfiles_count = opt_keyfiles_count,
.flags = CRYPT_TCRYPT_LEGACY_MODES | .flags = CRYPT_TCRYPT_LEGACY_MODES |
(opt_veracrypt ? CRYPT_TCRYPT_VERA_MODES : 0), (opt_veracrypt ? CRYPT_TCRYPT_VERA_MODES : 0),
.veracrypt_pim = (opt_veracrypt_pim > 0) ? opt_veracrypt_pim : 0,
}; };
int r; int r;

View File

@@ -73,9 +73,11 @@ export LANG=C
[ ! -d $TST_DIR ] && tar xjf $srcdir/tcrypt-images.tar.bz2 --no-same-owner [ ! -d $TST_DIR ] && tar xjf $srcdir/tcrypt-images.tar.bz2 --no-same-owner
echo "HEADER CHECK" echo "HEADER CHECK"
for file in $(ls $TST_DIR/[tv]c_*) ; do for file in $(ls $TST_DIR/[t]c_* $TST_DIR/vcpim_*) ; do
echo -n " $file" echo -n " $file"
echo $PASSWORD | $CRYPTSETUP tcryptDump --veracrypt $file >/dev/null || fail PIM_OPT=""
[[ $file =~ vcpim.* ]] && PIM_OPT="--veracrypt-pim $PIM"
echo $PASSWORD | $CRYPTSETUP tcryptDump --veracrypt $PIM_OPT $file >/dev/null || fail
echo " [OK]" echo " [OK]"
done done