From: Jan Pohanka <xhpohanka@gmail.com>
To: dm-crypt@saout.de
Subject: [dm-crypt] veritysetup usage question
Date: Thu, 26 Nov 2020 12:32:27 +0100 [thread overview]
Message-ID: <CABMiYf-Z54oESvP7P4y7s+OHayWcZZ8jARk2+zT60O3AcyD31Q@mail.gmail.com> (raw)
Hello,
I'd like to use dm-verity as a part of a verified boot process on my
embedded device but I'm afraid that I still do not understand it well.
I'm able to create a hash verification data for squashfs partition,
verify it and mount it
veritysetup format rootfs.squashfs rootfs.hash
cat rootfs.squashfs rootfs.hash > srootfs.squashfs
ubiblock -c /dev/ubi0_2
ubiupdatevol /dev/ubi0_2 srootfs.squashfs
veritysetup --hash-offset=17719296 verify /dev/ubiblock0_2
/dev/ubiblock0_2 ROOT_HASH
veritysetup --hash-offset=17719296 create srootfs /dev/ubiblock0_2
/dev/ubiblock0_2 ROOT_HASH
mount -t squashfs -r /dev/mapper/srootfs /mnt
Now I can use the above verification and mount in my initramfs and it
needs the ROOT_HASH to be stored inside my bootimage. That's not a
problem but I'm thinking about future updates.
I would need to change the bootimage with a correct ROOT_HASH each
time when I update the rootfs image and it obviously is not a thing
that one wants to do.
Is there any other way to solve it using dm-verity and cryptsetup?
Otherways it is probably easier to use any hash of my squashfs image,
sign it using openssl and verify with a stable public key from the
bootimage on the device, isn't it?
best regards
Jan
reply other threads:[~2020-11-26 11:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=CABMiYf-Z54oESvP7P4y7s+OHayWcZZ8jARk2+zT60O3AcyD31Q@mail.gmail.com \
--to=xhpohanka@gmail.com \
--cc=dm-crypt@saout.de \
/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;
as well as URLs for NNTP newsgroup(s).