public inbox for dm-crypt@saout.de
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: Dan Farrell <djfarrell@gmail.com>
Cc: JT Moree <moreejt@yahoo.com>, dm-crypt <dm-crypt@saout.de>
Subject: Re: [dm-crypt] cryptsetup Yubikey challenge-response support
Date: Thu, 16 Apr 2020 12:36:07 +0200	[thread overview]
Message-ID: <1d35ee9c-3393-ca22-2cd3-986cc0d34e34@gmail.com> (raw)
In-Reply-To: <CAKO8emaSbD-eGEbmtkbj=ewGiw_ko52v_aYn1u2A=+gvNRQVSA@mail.gmail.com>

On 16/04/2020 04:03, Dan Farrell wrote:
> The reason I want this is be have the option of entering a password manually, or have it automatically provided by a program at the same time.
> 
> So the idea is, for example, I turn on my laptop and either type the password, or insert a security token. The password helper program would interact with the token, and provide a password from it.
> 
> Does that make sense? I realise it is a bit silly, but relying on systemd to provide a password seems suboptimal. It's just an easy way of getting vendor specific USB support without he libs in cryptsetup itself.

Well, that's exactly what we tried to solve with "tokens" struct in LUKS2 metadata.
(Token says "how the unlocking passphrase could be retrieved".)

If there is a token defined, cryptsetup tries to use it, if not, it fallbacks to password query.
(Currently only internal keyring token is implemented. IOW it tries to check keyring,
if it is not there, it fallbacks to password query.)

Later we allow dynamic token handling. (You can do it today if you compile own application,
libcryptsetup API allows it, but not commandline cryptsetup.)

This way the policy (and keyslot priorities) is stored in LUKS2 metadata.

For LUKS1, you can easily script this outside of cryptetup (check if token is available,
then pipe output otherwise call cryptsetup without piping input). Or see below.

> But for sure I won't take any offence if it's a no go, I can do it for my own systems easily enough.

TBH I think you are implementing something that can be done with named pipes already
(you can use named pipe for --key-file).

Try:

# mkfifo pipe
# cryptsetup open <device> <name> --key-file pipe &

And now just write to the pipe what you want (either manually ot through token):
# echo -n <passphrase> >pipe

(Note it processes EOL as part of the keyfile, so you need to avoid it.)

Milan

  reply	other threads:[~2020-04-16 10:36 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <233063842.2717340.1586366160963.ref@mail.yahoo.com>
2020-04-08 17:16 ` [dm-crypt] cryptsetup Yubikey challenge-response support JT Morée
2020-04-10  3:01   ` Dan Farrell
2020-04-11 14:49     ` JT Moree
2020-04-11 16:09       ` Milan Broz
2020-04-11 19:56         ` Arno Wagner
2020-04-11 21:05           ` JT Moree
2020-04-11 22:23             ` Arno Wagner
2020-04-12 13:00               ` [dm-crypt] LUKS FAQ separate for LUKS1/LUKS2, or combined? Was: " Michael Kjörling
2020-04-14 10:56                 ` Milan Broz
2020-04-15 22:25                   ` Arno Wagner
2020-04-14 11:35           ` [dm-crypt] " Milan Broz
2020-04-15 21:47             ` Arno Wagner
2020-04-15  6:37         ` Dan Farrell
2020-04-15  6:48           ` Dan Farrell
2020-04-15  7:08             ` Dan Farrell
2020-04-15 19:38           ` Milan Broz
2020-04-16  2:03             ` Dan Farrell
2020-04-16 10:36               ` Milan Broz [this message]
2020-04-08  8:37 7heo
2020-04-08 10:07 ` Nikolay Kichukov
2020-04-08 16:31   ` Tim Steiner
2020-04-08 22:18     ` Dan Farrell
  -- strict thread matches above, loose matches on Subject: below --
2020-04-08  7:54 Dan Farrell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d35ee9c-3393-ca22-2cd3-986cc0d34e34@gmail.com \
    --to=gmazyland@gmail.com \
    --cc=djfarrell@gmail.com \
    --cc=dm-crypt@saout.de \
    --cc=moreejt@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox