mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-16 21:29:59 +01:00
Fix loopaes open parameters.
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@458 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
@@ -273,7 +273,7 @@ static int action_loopaesOpen(int arg)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((r = crypt_init(&cd, action_argv[1])))
|
if ((r = crypt_init(&cd, action_argv[0])))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
r = crypt_format(cd, CRYPT_LOOPAES, NULL, NULL, NULL, NULL,
|
r = crypt_format(cd, CRYPT_LOOPAES, NULL, NULL, NULL, NULL,
|
||||||
@@ -281,7 +281,7 @@ static int action_loopaesOpen(int arg)
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
r = crypt_activate_by_keyfile(cd, action_argv[0],
|
r = crypt_activate_by_keyfile(cd, action_argv[1],
|
||||||
CRYPT_ANY_SLOT, opt_key_file, 0,
|
CRYPT_ANY_SLOT, opt_key_file, 0,
|
||||||
opt_readonly ? CRYPT_ACTIVATE_READONLY : 0);
|
opt_readonly ? CRYPT_ACTIVATE_READONLY : 0);
|
||||||
out:
|
out:
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function check_sum() # $key $keysize
|
|||||||
sync
|
sync
|
||||||
dmremove $DEV_NAME
|
dmremove $DEV_NAME
|
||||||
|
|
||||||
$CRYPTSETUP loopaesOpen $DEV_NAME $LOOPDEV -s $2 --key-file $1 >/dev/null 2>&1
|
$CRYPTSETUP loopaesOpen $LOOPDEV $DEV_NAME -s $2 --key-file $1 >/dev/null 2>&1
|
||||||
ret=$?
|
ret=$?
|
||||||
VSUM=$(sha256sum /dev/mapper/$DEV_NAME | cut -d' ' -f 1)
|
VSUM=$(sha256sum /dev/mapper/$DEV_NAME | cut -d' ' -f 1)
|
||||||
if [ $ret -eq 0 -a "$VSUM" = "$EXPSUM" ] ; then
|
if [ $ret -eq 0 -a "$VSUM" = "$EXPSUM" ] ; then
|
||||||
@@ -123,7 +123,7 @@ KEY_FILES="$KEYv1 $KEYv2 $KEYv3"
|
|||||||
for key_size in $KEY_SIZES ; do
|
for key_size in $KEY_SIZES ; do
|
||||||
for key in $KEY_FILES ; do
|
for key in $KEY_FILES ; do
|
||||||
prepare "Open Loop-AES $key / AES-$key_size"
|
prepare "Open Loop-AES $key / AES-$key_size"
|
||||||
$CRYPTSETUP loopaesOpen $DEV_NAME $LOOPDEV -s $key_size --key-file $key || fail
|
$CRYPTSETUP loopaesOpen $LOOPDEV $DEV_NAME -s $key_size --key-file $key || fail
|
||||||
check_exists
|
check_exists
|
||||||
check_sum $key $key_size
|
check_sum $key $key_size
|
||||||
$CRYPTSETUP loopaesClose $DEV_NAME || fail
|
$CRYPTSETUP loopaesClose $DEV_NAME || fail
|
||||||
|
|||||||
Reference in New Issue
Block a user