]> git.ipfire.org Git - thirdparty/util-linux.git/commit
blkid: Add support for LUKS2 and new LABEL attributes.
authorMilan Broz <gmazyland@gmail.com>
Mon, 23 Oct 2017 14:26:51 +0000 (16:26 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Oct 2017 14:31:46 +0000 (16:31 +0200)
commit573538bfba202d2c32f6688feaf2f50d8c603508
tree93b28ea1d94a35b825621aed1f1028bdcdd0ba66
parentc71665adb55e6ba04c31cc9dd9c89a3a73b6b861
blkid: Add support for LUKS2 and new LABEL attributes.

This patch adds support for detection of a LUKS2 superblock.

LUKS2 is new version of Linux Unified Key Setup for encrypted
block devices.

LUKS2 contains a binary header and then JSON area for metadata.
Blkid should only parse the binary part, including newly available
optional LABEL and SUBSYSTEM fields.

LABEL is similar to filesystem label. The SUBSYSTEM field is
in principle, just a second label and can be used for specific udev rules
(for example if you have some 3rd party system that activates
volumes automatically, you can mark devices using this attribute).
Both labels are optional.

The magic string and UUID location are intentionally on the same offset
as LUKS v1, so even unpatched blkid now recognizes LUKS2.

Anyway, the code should not parse other versions of the header, so we now
explicitly check for header version and support only version 1 and 2.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
libblkid/src/superblocks/luks.c