"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/compat-test2" between
cryptsetup-2.4.0.tar.xz and cryptsetup-2.4.1.tar.xz

About: cryptsetup is a utility used to conveniently setup disk encryption based on the dm-crypt kernel module. These include plain dm-crypt volumes, LUKS volumes, loop-AES and TrueCrypt compatible format.

compat-test2  (cryptsetup-2.4.0.tar.xz):compat-test2  (cryptsetup-2.4.1.tar.xz)
skipping to change at line 418 skipping to change at line 418
tst=$($CRYPTSETUP -q luksUUID $LOOPDEV) tst=$($CRYPTSETUP -q luksUUID $LOOPDEV)
[ "$tst"x = "$TEST_UUID"x ] || fail [ "$tst"x = "$TEST_UUID"x ] || fail
prepare "[16] luksFormat" wipe prepare "[16] luksFormat" wipe
echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --master-key-file /dev/ur andom --type luks2 $LOOPDEV || fail echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --master-key-file /dev/ur andom --type luks2 $LOOPDEV || fail
echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --master-key-file /dev/ur andom --type luks2 $LOOPDEV -d $KEY1 || fail echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --master-key-file /dev/ur andom --type luks2 $LOOPDEV -d $KEY1 || fail
$CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --master-key-file /dev/urandom -s 256 --uuid $TEST_UUID --type luks2 $LOOPDEV $KEY1 || fail $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --master-key-file /dev/urandom -s 256 --uuid $TEST_UUID --type luks2 $LOOPDEV $KEY1 || fail
$CRYPTSETUP luksOpen -d $KEY1 $LOOPDEV $DEV_NAME || fail $CRYPTSETUP luksOpen -d $KEY1 $LOOPDEV $DEV_NAME || fail
$CRYPTSETUP -q luksClose $DEV_NAME || fail $CRYPTSETUP -q luksClose $DEV_NAME || fail
# open by UUID # open by UUID
force_uevent # some systems do not update loop by-uuid if [ -d /dev/disk/by-uuid ] ; then
$CRYPTSETUP luksOpen -d $KEY1 UUID=X$TEST_UUID $DEV_NAME 2>/dev/null && fail force_uevent # some systems do not update loop by-uuid
$CRYPTSETUP luksOpen -d $KEY1 UUID=$TEST_UUID $DEV_NAME || fail $CRYPTSETUP luksOpen -d $KEY1 UUID=X$TEST_UUID $DEV_NAME 2>/dev/null && f
$CRYPTSETUP -q luksClose $DEV_NAME || fail ail
$CRYPTSETUP luksOpen -d $KEY1 UUID=$TEST_UUID $DEV_NAME || fail
$CRYPTSETUP -q luksClose $DEV_NAME || fail
fi
# empty keyfile # empty keyfile
$CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV $KEYE || fail $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV $KEYE || fail
$CRYPTSETUP luksOpen -d $KEYE $LOOPDEV $DEV_NAME || fail $CRYPTSETUP luksOpen -d $KEYE $LOOPDEV $DEV_NAME || fail
$CRYPTSETUP -q luksClose $DEV_NAME || fail $CRYPTSETUP -q luksClose $DEV_NAME || fail
# open by volume key # open by volume key
echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT -s 256 --master-key-file $KEY1 --type luks2 $LOOPDEV || fail echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT -s 256 --master-key-file $KEY1 --type luks2 $LOOPDEV || fail
$CRYPTSETUP luksOpen --master-key-file /dev/urandom $LOOPDEV $DEV_NAME 2>/dev/nu ll && fail $CRYPTSETUP luksOpen --master-key-file /dev/urandom $LOOPDEV $DEV_NAME 2>/dev/nu ll && fail
$CRYPTSETUP luksOpen --master-key-file $KEY1 $LOOPDEV $DEV_NAME || fail $CRYPTSETUP luksOpen --master-key-file $KEY1 $LOOPDEV $DEV_NAME || fail
$CRYPTSETUP -q luksClose $DEV_NAME || fail $CRYPTSETUP -q luksClose $DEV_NAME || fail
skipping to change at line 875 skipping to change at line 877
# test we can remove keyslot with token # test we can remove keyslot with token
echo -e "$PWD1\n$PWD2" | $CRYPTSETUP luksAddKey -S4 $FAST_PBKDF_OPT $LOOP DEV || fail echo -e "$PWD1\n$PWD2" | $CRYPTSETUP luksAddKey -S4 $FAST_PBKDF_OPT $LOOP DEV || fail
$CRYPTSETUP token add $LOOPDEV --key-description $TEST_TOKEN1 --key-slot 4 || fail $CRYPTSETUP token add $LOOPDEV --key-description $TEST_TOKEN1 --key-slot 4 || fail
$CRYPTSETUP -q luksKillSlot $LOOPDEV 4 || fail $CRYPTSETUP -q luksKillSlot $LOOPDEV 4 || fail
fi fi
echo -n "$IMPORT_TOKEN" | $CRYPTSETUP token import $LOOPDEV --token-id 10 || fai l echo -n "$IMPORT_TOKEN" | $CRYPTSETUP token import $LOOPDEV --token-id 10 || fai l
echo -n "$IMPORT_TOKEN" | $CRYPTSETUP token import $LOOPDEV --token-id 11 --json -file - || fail echo -n "$IMPORT_TOKEN" | $CRYPTSETUP token import $LOOPDEV --token-id 11 --json -file - || fail
echo -n "$IMPORT_TOKEN" > $TOKEN_FILE0 echo -n "$IMPORT_TOKEN" > $TOKEN_FILE0
$CRYPTSETUP token import $LOOPDEV --token-id 12 --json-file $TOKEN_FILE0 || fail $CRYPTSETUP token import $LOOPDEV --token-id 12 --json-file $TOKEN_FILE0 || fail
$CRYPTSETUP token import $LOOPDEV --token-id 12 --json-file $TOKEN_FILE0 2>/dev/ null && fail $CRYPTSETUP token import $LOOPDEV --token-id 12 --json-file $TOKEN_FILE0 2>/dev/ null && fail
$CRYPTSETUP token export $LOOPDEV --token-id 10 | diff --from-file - $TOKEN_FILE $CRYPTSETUP token export $LOOPDEV --token-id 10 >$TOKEN_FILE1 || fail
0 || fail diff $TOKEN_FILE0 $TOKEN_FILE1 || fail
$CRYPTSETUP token export $LOOPDEV --token-id 11 | diff --from-file - $TOKEN_FILE $CRYPTSETUP token export $LOOPDEV --token-id 11 >$TOKEN_FILE1 || fail
0 || fail diff $TOKEN_FILE0 $TOKEN_FILE1 || fail
$CRYPTSETUP token export $LOOPDEV --token-id 12 | diff --from-file - $TOKEN_FILE $CRYPTSETUP token export $LOOPDEV --token-id 12 >$TOKEN_FILE1 || fail
0 || fail diff $TOKEN_FILE0 $TOKEN_FILE1 || fail
$CRYPTSETUP token export $LOOPDEV --token-id 12 --json-file $TOKEN_FILE1 || fail $CRYPTSETUP token export $LOOPDEV --token-id 12 --json-file $TOKEN_FILE1 || fail
diff $TOKEN_FILE0 $TOKEN_FILE1 || fail diff $TOKEN_FILE0 $TOKEN_FILE1 || fail
$CRYPTSETUP token export $LOOPDEV --token-id 12 > $TOKEN_FILE1 || fail $CRYPTSETUP token export $LOOPDEV --token-id 12 > $TOKEN_FILE1 || fail
diff $TOKEN_FILE0 $TOKEN_FILE1 || fail diff $TOKEN_FILE0 $TOKEN_FILE1 || fail
prepare "[34] LUKS keyslot priority" wipe prepare "[34] LUKS keyslot priority" wipe
echo $PWD1 | $CRYPTSETUP luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV -S 1 | | fail echo $PWD1 | $CRYPTSETUP luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV -S 1 | | fail
echo -e "$PWD1\n$PWD2" | $CRYPTSETUP luksAddKey $LOOPDEV $FAST_PBKDF_OPT -S 5 || fail echo -e "$PWD1\n$PWD2" | $CRYPTSETUP luksAddKey $LOOPDEV $FAST_PBKDF_OPT -S 5 || fail
$CRYPTSETUP config $LOOPDEV -S 0 --priority prefer && fail $CRYPTSETUP config $LOOPDEV -S 0 --priority prefer && fail
$CRYPTSETUP config $LOOPDEV -S 1 --priority bla >/dev/null 2>&1 && fail $CRYPTSETUP config $LOOPDEV -S 1 --priority bla >/dev/null 2>&1 && fail
skipping to change at line 1005 skipping to change at line 1010
tar xJf luks2_mda_images.tar.xz tar xJf luks2_mda_images.tar.xz
echo -n "$IMPORT_TOKEN" > $TOKEN_FILE0 echo -n "$IMPORT_TOKEN" > $TOKEN_FILE0
for mda in 16 32 64 128 256 512 1024 2048 4096 ; do for mda in 16 32 64 128 256 512 1024 2048 4096 ; do
echo -n "[$mda KiB]" echo -n "[$mda KiB]"
echo $PWD4 | $CRYPTSETUP open test_image_$mda $DEV_NAME || fail echo $PWD4 | $CRYPTSETUP open test_image_$mda $DEV_NAME || fail
$CRYPTSETUP close $DEV_NAME || fail $CRYPTSETUP close $DEV_NAME || fail
echo -e "$PWD4\n$PWD3" | $CRYPTSETUP luksAddKey -S9 $FAST_PBKDF_OPT test_ image_$mda || fail echo -e "$PWD4\n$PWD3" | $CRYPTSETUP luksAddKey -S9 $FAST_PBKDF_OPT test_ image_$mda || fail
echo $PWD4 | $CRYPTSETUP open --test-passphrase test_image_$mda || fail echo $PWD4 | $CRYPTSETUP open --test-passphrase test_image_$mda || fail
echo $PWD3 | $CRYPTSETUP open -S9 --test-passphrase test_image_$mda || fa il echo $PWD3 | $CRYPTSETUP open -S9 --test-passphrase test_image_$mda || fa il
echo -n "$IMPORT_TOKEN" | $CRYPTSETUP token import test_image_$mda --toke n-id 10 || fail echo -n "$IMPORT_TOKEN" | $CRYPTSETUP token import test_image_$mda --toke n-id 10 || fail
$CRYPTSETUP token export test_image_$mda --token-id 10 | diff --from-file $CRYPTSETUP token export test_image_$mda --token-id 10 >$TOKEN_FILE1 || f
- $TOKEN_FILE0 || fail ail
diff $TOKEN_FILE1 $TOKEN_FILE0 || fail
echo -n "[OK]" echo -n "[OK]"
done done
echo echo
prepare "[40] LUKS2 metadata areas" wipe prepare "[40] LUKS2 metadata areas" wipe
echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV 2> /dev/null || fail echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV 2> /dev/null || fail
DEFAULT_OFFSET=$($CRYPTSETUP luksDump $LOOPDEV | grep "offset: " | cut -f 2 -d ' ') DEFAULT_OFFSET=$($CRYPTSETUP luksDump $LOOPDEV | grep "offset: " | cut -f 2 -d ' ')
echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks1 $LOOPDEV --k ey-size 256 --luks2-metadata-size=128k --luks2-keyslots-size=128k 2> /dev/null & & fail echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks1 $LOOPDEV --k ey-size 256 --luks2-metadata-size=128k --luks2-keyslots-size=128k 2> /dev/null & & fail
echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV --k ey-size 256 --luks2-metadata-size=128k --luks2-keyslots-size=127k 2> /dev/null & & fail echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV --k ey-size 256 --luks2-metadata-size=128k --luks2-keyslots-size=127k 2> /dev/null & & fail
echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV --k ey-size 256 --luks2-metadata-size=127k --luks2-keyslots-size=128k 2> /dev/null & & fail echo $PWD1 | $CRYPTSETUP -q luksFormat $FAST_PBKDF_OPT --type luks2 $LOOPDEV --k ey-size 256 --luks2-metadata-size=127k --luks2-keyslots-size=128k 2> /dev/null & & fail
 End of changes. 3 change blocks. 
12 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)