|
|
7cdc99 |
diff -rupN cryptsetup-2.0.3.old/src/Makemodule.am cryptsetup-2.0.3.new/src/Makemodule.am
|
|
|
7cdc99 |
--- cryptsetup-2.0.3.old/src/Makemodule.am 2019-08-27 17:37:25.043999695 +0200
|
|
|
7cdc99 |
+++ cryptsetup-2.0.3.new/src/Makemodule.am 2019-08-27 17:39:40.303336254 +0200
|
|
|
7cdc99 |
@@ -6,6 +6,7 @@ cryptsetup_SOURCES = \
|
|
|
7cdc99 |
lib/utils_loop.c \
|
|
|
7cdc99 |
lib/utils_io.c \
|
|
|
7cdc99 |
src/utils_tools.c \
|
|
|
7cdc99 |
+ lib/utils_loop.c \
|
|
|
7cdc99 |
src/utils_password.c \
|
|
|
7cdc99 |
src/cryptsetup.c \
|
|
|
7cdc99 |
src/cryptsetup.h
|
|
|
7cdc99 |
diff -rupN cryptsetup-2.0.3.old/src/utils_password.c cryptsetup-2.0.3.new/src/utils_password.c
|
|
|
7cdc99 |
--- cryptsetup-2.0.3.old/src/utils_password.c 2019-08-27 17:37:25.043999695 +0200
|
|
|
7cdc99 |
+++ cryptsetup-2.0.3.new/src/utils_password.c 2019-08-27 17:38:35.354214280 +0200
|
|
|
7cdc99 |
@@ -256,7 +256,7 @@ int tools_get_key(const char *prompt,
|
|
|
7cdc99 |
int timeout, int verify, int pwquality,
|
|
|
7cdc99 |
struct crypt_device *cd)
|
|
|
7cdc99 |
{
|
|
|
7cdc99 |
- char tmp[1024];
|
|
|
7cdc99 |
+ char tmp[1024], *backing_file;
|
|
|
7cdc99 |
int r = -EINVAL, block;
|
|
|
7cdc99 |
|
|
|
7cdc99 |
block = tools_signals_blocked();
|
|
|
7cdc99 |
@@ -270,9 +270,11 @@ int tools_get_key(const char *prompt,
|
|
|
7cdc99 |
} else {
|
|
|
7cdc99 |
if (!prompt && !crypt_get_device_name(cd))
|
|
|
7cdc99 |
snprintf(tmp, sizeof(tmp), _("Enter passphrase: "));
|
|
|
7cdc99 |
- else if (!prompt)
|
|
|
7cdc99 |
- snprintf(tmp, sizeof(tmp), _("Enter passphrase for %s: "),
|
|
|
7cdc99 |
- crypt_get_device_name(cd));
|
|
|
7cdc99 |
+ else if (!prompt) {
|
|
|
7cdc99 |
+ backing_file = crypt_loop_backing_file(crypt_get_device_name(cd));
|
|
|
7cdc99 |
+ snprintf(tmp, sizeof(tmp), _("Enter passphrase for %s: "), backing_file ?: crypt_get_device_name(cd));
|
|
|
7cdc99 |
+ free(backing_file);
|
|
|
7cdc99 |
+ }
|
|
|
7cdc99 |
r = crypt_get_key_tty(prompt ?: tmp, key, key_size, timeout, verify, cd);
|
|
|
7cdc99 |
}
|
|
|
7cdc99 |
} else {
|
|
|
7cdc99 |
diff -rupN cryptsetup-2.0.3.old/tests/compat-test cryptsetup-2.0.3.new/tests/compat-test
|
|
|
7cdc99 |
--- cryptsetup-2.0.3.old/tests/compat-test 2019-08-27 17:37:24.942997950 +0200
|
|
|
7cdc99 |
+++ cryptsetup-2.0.3.new/tests/compat-test 2019-08-27 17:41:15.868988979 +0200
|
|
|
7cdc99 |
@@ -735,15 +735,20 @@ fi
|
|
|
7cdc99 |
which expect >/dev/null 2>&1 || skip "WARNING: expect tool missing, interactive test will be skipped." 0
|
|
|
7cdc99 |
|
|
|
7cdc99 |
prepare "[32] Interactive password retry from terminal." new
|
|
|
7cdc99 |
+if [ "$(pwd)" = "/" ]; then
|
|
|
7cdc99 |
+ EXPECT_DEV=/$IMG
|
|
|
7cdc99 |
+else
|
|
|
7cdc99 |
+ EXPECT_DEV=$(pwd)/$IMG
|
|
|
7cdc99 |
+fi
|
|
|
7cdc99 |
expect - >/dev/null <
|
|
|
7cdc99 |
proc abort {} { send_error "Timeout. "; exit 2 }
|
|
|
7cdc99 |
set timeout 10
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksOpen -v -T 2 $LOOPDEV $DEV_NAME
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0 x\n"
|
|
|
7cdc99 |
expect timeout abort "No key available with this passphrase."
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0\n"
|
|
|
7cdc99 |
expect timeout abort "Key slot 0 unlocked."
|
|
|
7cdc99 |
@@ -760,11 +765,11 @@ expect - >/dev/null <
|
|
|
7cdc99 |
proc abort {} { send_error "Timeout. "; exit 2 }
|
|
|
7cdc99 |
set timeout 10
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksOpen -v -T 2 $LOOPDEV $DEV_NAME
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0 x\n"
|
|
|
7cdc99 |
expect timeout abort "No key available with this passphrase."
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0 y\n"
|
|
|
7cdc99 |
expect timeout abort "No key available with this passphrase."
|
|
|
7cdc99 |
@@ -799,7 +804,7 @@ set timeout 10
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksFormat --type luks1 $FAST_PBKDF_OPT -v $LOOPDEV
|
|
|
7cdc99 |
expect timeout abort "Are you sure? (Type uppercase yes):"
|
|
|
7cdc99 |
send "YES\n"
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0\n"
|
|
|
7cdc99 |
expect timeout abort "Verify passphrase:"
|
|
|
7cdc99 |
@@ -808,7 +813,7 @@ send "$PWD0\n"
|
|
|
7cdc99 |
expect timeout abort "Command successful."
|
|
|
7cdc99 |
expect timeout abort eof
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksOpen -v $LOOPDEV --test-passphrase
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0\n"
|
|
|
7cdc99 |
expect timeout abort "Command successful."
|
|
|
7cdc99 |
@@ -829,7 +834,7 @@ expect timeout abort eof
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksFormat --type luks1 $FAST_PBKDF_OPT -v $LOOPDEV
|
|
|
7cdc99 |
expect timeout abort "Are you sure? (Type uppercase yes):"
|
|
|
7cdc99 |
send "YES\n"
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0\n"
|
|
|
7cdc99 |
expect timeout abort "Verify passphrase:"
|
|
|
7cdc99 |
@@ -838,7 +843,7 @@ send "$PWD0 x\n"
|
|
|
7cdc99 |
expect timeout abort "Passphrases do not match."
|
|
|
7cdc99 |
expect timeout abort eof
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksOpen -v $LOOPDEV -T 1 --test-passphrase
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0\n"
|
|
|
7cdc99 |
expect timeout abort "No key available with this passphrase."
|
|
|
7cdc99 |
@@ -890,7 +895,7 @@ send "$PWD1\n"
|
|
|
7cdc99 |
expect timeout abort "Command successful."
|
|
|
7cdc99 |
expect timeout abort eof
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksOpen -v $LOOPDEV --test-passphrase
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD1\n"
|
|
|
7cdc99 |
expect timeout abort "Command successful."
|
|
|
7cdc99 |
@@ -908,21 +913,21 @@ eval spawn $CRYPTSETUP luksSuspend -v $D
|
|
|
7cdc99 |
expect timeout abort "Command successful."
|
|
|
7cdc99 |
expect timeout abort eof
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksResume -v -T 3 $DEV_NAME
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0 x\n"
|
|
|
7cdc99 |
expect timeout abort "No key available with this passphrase."
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD1\n"
|
|
|
7cdc99 |
expect timeout abort "No key available with this passphrase."
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0 y\n"
|
|
|
7cdc99 |
expect timeout abort "No key available with this passphrase."
|
|
|
7cdc99 |
expect timeout abort eof
|
|
|
7cdc99 |
eval spawn $CRYPTSETUP luksResume -v $DEV_NAME
|
|
|
7cdc99 |
-expect timeout abort "Enter passphrase for $LOOPDEV:"
|
|
|
7cdc99 |
+expect timeout abort "Enter passphrase for $EXPECT_DEV:"
|
|
|
7cdc99 |
sleep 0.1
|
|
|
7cdc99 |
send "$PWD0\n"
|
|
|
7cdc99 |
expect timeout abort "Command successful."
|