Re: cryptsetup mistakenly includes newline character in passphrase
| Newsgroups | dev.linux.lists.cryptsetup |
|---|---|
| Message-ID | <CACHosL_pEoFibzKwvwRbXcWiHL+shG+b4Br9GRpJURvHAHqLuw@mail.gmail.com> |
Hi Christoph, I understand. Then it seems that I got confused. Thanks. Best regards, David. On Wed, Sep 7, 2022 at 7:03 PM Christoph Anton Mitterer <[email protected]> wrote: > > 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. -- Best regards, David.