Fix loopaesOpen for keyfile on standard input.

The change in keyfile processing caused that special loopAES
keyfiles are no longer read from stdin if key-file argument is "-".

Fix it by using /dev/stdin in cryptsetup if "-" is detected.
(The libcryptsetup API no longer parses spacial meaning of "-" internally).

Fixes #364.
This commit is contained in:
Milan Broz
2018-01-24 08:58:57 +01:00
parent 3ba07ed27f
commit 8728ba08e2
2 changed files with 15 additions and 9 deletions

View File

@@ -271,8 +271,8 @@ static int action_open_loopaes(void)
goto out;
r = crypt_activate_by_keyfile_device_offset(cd, action_argv[1], CRYPT_ANY_SLOT,
opt_key_file, opt_keyfile_size,
opt_keyfile_offset, activate_flags);
tools_is_stdin(opt_key_file) ? "/dev/stdin" : opt_key_file, opt_keyfile_size,
opt_keyfile_offset, activate_flags);
out:
crypt_free(cd);