Re: cryptsetup mistakenly includes newline character in passphrase

Christoph Anton Mitterer <[email protected]>
Newsgroups dev.linux.lists.cryptsetup
Message-ID <[email protected]>
Hey.

In your script, you create the volume via:
> printf "%s\n" "${PASSPHRASE}" | cryptsetup "${cmd_cryptsetup_params[@]}" --type=luks2 luksFormat ${DEVP}5 -

With the "-" in the end meaning "read the key file from stdin"... so it
takes up everything presented (up to some compiled-in maximum).

There you have a trailing "\n" in the printf.


When opening you also read a keyfile from stdin, but you don't give a
trailing "\n":
> printf "%s" "${PASSPHRASE}" | cryptsetup --verbose --debug --key-file - open ${DEVP}5 debug_open


Cheers,
Chris.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.