All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <gmazyland@gmail.com>
To: "JT Morée" <moreejt@yahoo.com>, "Dm-crypt Mail List" <dm-crypt@saout.de>
Subject: [dm-crypt] Re: json help
Date: Thu, 12 Aug 2021 18:25:44 +0200	[thread overview]
Message-ID: <fb92c064-6911-ad74-a904-dc67d1f68440@gmail.com> (raw)
In-Reply-To: <1572027243.1491001.1628775257558@mail.yahoo.com>

On 12/08/2021 15:34, JT Morée wrote:
> I am back to working with json data now that 2.4.0 is closer to
> release. I am using source clone cloned from gitlab to get the latest
> features but not able to get some commands to work.

JSON format is defined in LUKS2 doc, there is no change in 2.4.0, we are just
adding API for external shared library.
 
> If I'm reading the latest man page properly these commands should
> import json data into the header but it always fails for me.

Yes, but also read LUKS2 speciofication (in /docs), section 3.6 that describes token object.

While it can store arbitrary JSON metadata, there are mandatory fields (type, keyslots array)

If you are using direct JSON API (token import), these fields must be present.

Try

  echo '{ "type" : "blah" , "keyslots" : [ ], "foo" : "bar" }' |  ./cryptsetup token import /dev/sdb --key-slot 0

Type is you name for this token type, keyslots is then assigned according to parameters on commandline.

Also if something fails, try --debug, in your case:

...
# STDIN descriptor JSON read requested.
# Updating JSON for token -1.
# Token "0" is missing "type" (string) specification.
Failed to import token from file.

So it should give you a hint.

Milan
_______________________________________________
dm-crypt mailing list -- dm-crypt@saout.de
To unsubscribe send an email to dm-crypt-leave@saout.de

  reply	other threads:[~2021-08-12 16:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1572027243.1491001.1628775257558.ref@mail.yahoo.com>
2021-08-12 13:34 ` [dm-crypt] json help JT Morée
2021-08-12 16:25   ` Milan Broz [this message]
2021-08-16 12:35     ` [dm-crypt] " JT Morée
2021-08-16 12:49       ` Ondrej Kozina
2021-08-16 13:19       ` Ondrej Kozina
2021-08-20 13:46         ` JT Morée
2021-08-23 12:54           ` Ondrej Kozina

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=fb92c064-6911-ad74-a904-dc67d1f68440@gmail.com \
    --to=gmazyland@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.