diff options
author | Lennart Poettering <lennart@poettering.net> | 2020-04-29 18:17:33 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-05-19 17:28:29 +0200 |
commit | cb6c9283b5f0a06722609b8834fcee48acee0c32 (patch) | |
tree | 6add742c0a1a2c32cc379c5a62307591a1997a7f /src/cryptsetup/cryptsetup.c | |
parent | 7407f689807963d48dce08e5581b5cb4b4e56813 (diff) | |
download | systemd-cb6c9283b5f0a06722609b8834fcee48acee0c32.tar.gz |
cryptsetup: make sure to return EAGAIN on wrong tcrypt password too
Only then we'll try again to ask the user for a password.
Fixes: #12152
Diffstat (limited to 'src/cryptsetup/cryptsetup.c')
-rw-r--r-- | src/cryptsetup/cryptsetup.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index f6a9a21caa..9ff10d8aaa 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -512,15 +512,13 @@ static int attach_tcrypt( r = crypt_load(cd, CRYPT_TCRYPT, ¶ms); if (r < 0) { if (r == -EPERM) { - if (key_data) { + if (key_data) log_error_errno(r, "Failed to activate using discovered key. (Key not correct?)"); - return -EAGAIN; /* log the actual error, but return EAGAIN */ - } - if (key_file) { + if (key_file) log_error_errno(r, "Failed to activate using password file '%s'. (Key data not correct?)", key_file); - return -EAGAIN; /* log the actual error, but return EAGAIN */ - } + + return -EAGAIN; /* log the actual error, but return EAGAIN */ } return log_error_errno(r, "Failed to load tcrypt superblock on device %s: %m", crypt_get_device_name(cd)); |