"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/keyring-compat-test" between
cryptsetup-2.0.6.tar.xz and cryptsetup-2.1.0.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.

keyring-compat-test  (cryptsetup-2.0.6.tar.xz):keyring-compat-test  (cryptsetup-2.1.0.tar.xz)
skipping to change at line 24 skipping to change at line 24
HEXKEY_16="be21aa8c733229347bd4e681891e213d"; HEXKEY_16="be21aa8c733229347bd4e681891e213d";
HEXKEY_32="bb21158c733229347bd4e681891e213d94c685be6a5b84818afe7a78a6de7a1a"; HEXKEY_32="bb21158c733229347bd4e681891e213d94c685be6a5b84818afe7a78a6de7a1a";
HEXKEY_64="34f95b96abff946b64f1339ff8653cc77c38697c93b797a496f3786e86eed7781850d 5112bbae17d209b8310a8f3a034f1cd297667bc0cd1438fad28d87ef6a1" HEXKEY_64="34f95b96abff946b64f1339ff8653cc77c38697c93b797a496f3786e86eed7781850d 5112bbae17d209b8310a8f3a034f1cd297667bc0cd1438fad28d87ef6a1"
DEVSIZEMB=16 DEVSIZEMB=16
DEVSECTORS=$((DEVSIZEMB*1024*1024/512)) DEVSECTORS=$((DEVSIZEMB*1024*1024/512))
NAME=testcryptdev NAME=testcryptdev
CHKS_DMCRYPT=vk_in_dmcrypt.chk CHKS_DMCRYPT=vk_in_dmcrypt.chk
CHKS_KEYRING=vk_in_keyring.chk CHKS_KEYRING=vk_in_keyring.chk
PWD="aaa"
CRYPTSETUP=../cryptsetup
function remove_mapping() function remove_mapping()
{ {
[ -b /dev/mapper/$NAME ] && dmsetup remove $NAME [ -b /dev/mapper/$NAME ] && dmsetup remove $NAME
# unlink whole test keyring # unlink whole test keyring
[ -n "$TEST_KEYRING" ] && keyctl unlink $TEST_KEYRING "@u" >/dev/null [ -n "$TEST_KEYRING" ] && keyctl unlink $TEST_KEYRING "@u" >/dev/null
rmmod scsi_debug 2>/dev/null rmmod scsi_debug 2>/dev/null
rm -f $CHKS_DMCRYPT $CHKS_KEYRING rm -f $CHKS_DMCRYPT $CHKS_KEYRING
skipping to change at line 185 skipping to change at line 188
dmsetup create $NAME --table "0 $DEVSECTORS crypt $CIPHER_CBC_TCW $HEXKEY_64 0 $ DEV 0" || fail dmsetup create $NAME --table "0 $DEVSECTORS crypt $CIPHER_CBC_TCW $HEXKEY_64 0 $ DEV 0" || fail
dmsetup suspend $NAME || fail dmsetup suspend $NAME || fail
dmsetup message $NAME 0 key wipe || fail dmsetup message $NAME 0 key wipe || fail
dmsetup message $NAME 0 "key set :64:logon:$LOGON_KEY_64_OK" || fail dmsetup message $NAME 0 "key set :64:logon:$LOGON_KEY_64_OK" || fail
dmsetup resume $NAME || fail dmsetup resume $NAME || fail
sha1sum /dev/mapper/$NAME > $CHKS_KEYRING || fail sha1sum /dev/mapper/$NAME > $CHKS_KEYRING || fail
dmsetup remove $NAME || fail dmsetup remove $NAME || fail
diff $CHKS_DMCRYPT $CHKS_KEYRING || fail "Plaintext checksums mismatch (corrupti on)" diff $CHKS_DMCRYPT $CHKS_KEYRING || fail "Plaintext checksums mismatch (corrupti on)"
echo "OK" echo "OK"
echo -n "Test LUKS2 key refresh..."
echo $PWD | $CRYPTSETUP luksFormat --type luks2 --luks2-metadata-size 16k --luks
2-keyslots-size 4064k --pbkdf pbkdf2 --pbkdf-force-iterations 1000 --force-passw
ord $DEV || fail
echo $PWD | $CRYPTSETUP open $DEV $NAME || fail
$CRYPTSETUP status $NAME | grep -q -i "location:.*keyring" || skip "LUKS2 can't
use keyring. Test skipped."
dd if=/dev/mapper/$NAME bs=1M iflag=direct status=none | sha1sum > $CHKS_KEYRING
|| fail
echo $PWD | $CRYPTSETUP refresh $NAME --disable-keyring || fail
$CRYPTSETUP status $NAME | grep -q -i "location:.*keyring" && fail "Key is still
in keyring"
dd if=/dev/mapper/$NAME bs=1M iflag=direct status=none | sha1sum > $CHKS_DMCRYPT
|| fail
diff $CHKS_DMCRYPT $CHKS_KEYRING || fail "Plaintext checksum mismatch (corruptio
n)"
echo "OK"
remove_mapping remove_mapping
 End of changes. 2 change blocks. 
0 lines changed or deleted 21 lines changed or added

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