"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/keyring-compat-test" between
cryptsetup-2.3.6.tar.xz and cryptsetup-2.4.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.3.6.tar.xz):keyring-compat-test  (cryptsetup-2.4.0.tar.xz)
skipping to change at line 38 skipping to change at line 38
[ -f /etc/system-fips ] && FIPS_MODE=$(cat /proc/sys/crypto/fips_enabled 2>/dev/ null) [ -f /etc/system-fips ] && FIPS_MODE=$(cat /proc/sys/crypto/fips_enabled 2>/dev/ null)
function remove_mapping() function remove_mapping()
{ {
[ -b /dev/mapper/$NAME ] && dmsetup remove --retry $NAME [ -b /dev/mapper/$NAME ] && dmsetup remove --retry $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 >/dev/null 2>&1
rm -f $CHKS_DMCRYPT $CHKS_KEYRING rm -f $CHKS_DMCRYPT $CHKS_KEYRING
} }
function skip() function skip()
{ {
[ -n "$1" ] && echo "$1" [ -n "$1" ] && echo "$1"
remove_mapping remove_mapping
exit 77 exit 77
} }
skipping to change at line 95 skipping to change at line 95
function test_and_prepare_keyring() { function test_and_prepare_keyring() {
keyctl list "@s" > /dev/null || skip "Current session keyring is unreacha ble, test skipped" keyctl list "@s" > /dev/null || skip "Current session keyring is unreacha ble, test skipped"
TEST_KEYRING=$(keyctl newring $TEST_KEYRING_NAME "@u" 2> /dev/null) TEST_KEYRING=$(keyctl newring $TEST_KEYRING_NAME "@u" 2> /dev/null)
test -n "$TEST_KEYRING" || skip "Failed to create keyring in user keyring " test -n "$TEST_KEYRING" || skip "Failed to create keyring in user keyring "
keyctl search "@s" keyring "$TEST_KEYRING" > /dev/null 2>&1 || keyctl lin k "@u" "@s" > /dev/null 2>&1 keyctl search "@s" keyring "$TEST_KEYRING" > /dev/null 2>&1 || keyctl lin k "@u" "@s" > /dev/null 2>&1
load_key "$HEXKEY_16" user test_key "$TEST_KEYRING" || skip "Kernel keyri ng service is useless on this system, test skipped." load_key "$HEXKEY_16" user test_key "$TEST_KEYRING" || skip "Kernel keyri ng service is useless on this system, test skipped."
} }
function fips_mode() function fips_mode()
{ {
[ -n "$FIPS_MODE" ] && [ "$FIPS_MODE" -gt 0 ] [ -n "$FIPS_MODE" ] && [ "$FIPS_MODE" -gt 0 ]
} }
add_device() { add_device() {
modprobe scsi_debug $@ delay=0 rmmod scsi_debug >/dev/null 2>&1
if [ -d /sys/module/scsi_debug ] ; then
echo "Cannot use scsi_debug module (in use or compiled-in), test
skipped."
exit 77
fi
modprobe scsi_debug $@ delay=0 >/dev/null 2>&1
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
echo "This kernel seems to not support proper scsi_debug module, test skipped." echo "This kernel seems to not support proper scsi_debug module, test skipped."
exit 77 exit 77
fi fi
sleep 2 sleep 2
DEV=$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /) DEV=$(grep -l -e scsi_debug /sys/block/*/device/model | cut -f4 -d /)
DEV="/dev/$DEV" DEV="/dev/$DEV"
[ -b $DEV ] || fail "Cannot find $DEV." [ -b $DEV ] || fail "Cannot find $DEV."
} }
[ $(id -u) != 0 ] && skip "WARNING: You must be root to run this test, test skip ped." [ $(id -u) != 0 ] && skip "WARNING: You must be root to run this test, test skip ped."
which dmsetup >/dev/null 2>&1 || skip "Cannot find dmsetup, test skipped" which dmsetup >/dev/null 2>&1 || skip "Cannot find dmsetup, test skipped"
which keyctl >/dev/null 2>&1 || skip "Cannot find keyctl, test skipped" which keyctl >/dev/null 2>&1 || skip "Cannot find keyctl, test skipped"
which xxd >/dev/null 2>&1 || skip "Cannot find xxd, test skipped" which xxd >/dev/null 2>&1 || skip "Cannot find xxd, test skipped"
which sha1sum > /dev/null 2>&1 || skip "Cannot find sha1sum, test skipped" which sha1sum > /dev/null 2>&1 || skip "Cannot find sha1sum, test skipped"
modprobe dm-crypt || fail "dm-crypt failed to load" modprobe dm-crypt >/dev/null 2>&1 || fail "dm-crypt failed to load"
dm_crypt_keyring_support || skip "dm-crypt doesn't support kernel keyring, test skipped." dm_crypt_keyring_support || skip "dm-crypt doesn't support kernel keyring, test skipped."
test_and_prepare_keyring test_and_prepare_keyring
add_device dev_size_mb=$DEVSIZEMB add_device dev_size_mb=$DEVSIZEMB
dd if=/dev/urandom of=$DEV bs=1M count=$DEVSIZEMB oflag=direct > /dev/null 2>&1 || fail dd if=/dev/urandom of=$DEV bs=1M count=$DEVSIZEMB oflag=direct > /dev/null 2>&1 || fail
#test aes cipher with xts mode, plain IV #test aes cipher with xts mode, plain IV
echo -n "Testing $CIPHER_XTS_PLAIN..." echo -n "Testing $CIPHER_XTS_PLAIN..."
 End of changes. 4 change blocks. 
4 lines changed or deleted 11 lines changed or added

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