Blame docs/v1.5.0-ReleaseNotes

Packit 94f725
Cryptsetup 1.5.0 Release Notes
Packit 94f725
==============================
Packit 94f725
Packit 94f725
This release covers mainly inclusion of:
Packit 94f725
Packit 94f725
  * Veritysetup tool (and related libcryptsetup extensions for dm-verity).
Packit 94f725
Packit 94f725
  * Experimental cryptsetup-reencrypt tool (LUKS offline reencryption).
Packit 94f725
Packit 94f725
Changes since version 1.5.0-rc2
Packit 94f725
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 94f725
Packit 94f725
  * Add --device-size option for reencryption tool.
Packit 94f725
Packit 94f725
  * Switch to use unit suffix for --reduce-device-size option.
Packit 94f725
Packit 94f725
  * Remove open device debugging feature (no longer needed).
Packit 94f725
Packit 94f725
  * Fix library name for FIPS check.
Packit 94f725
Packit 94f725
  * Add example of using reencryption inside dracut (see misc/dracut).
Packit 94f725
Packit 94f725
Changes since version 1.5.0-rc1
Packit 94f725
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 94f725
Introduce cryptsetup-reencrypt - experimental offline LUKS reencryption tool.
Packit 94f725
Packit 94f725
! cryptsetup-reencrypt tool is EXPERIMENTAL
Packit 94f725
! ALWAYS BE SURE YOU HAVE RELIABLE BACKUP BEFORE USING THIS TOOL
Packit 94f725
Packit 94f725
This tool tries to simplify situation when you need to re-encrypt the whole
Packit 94f725
LUKS device in situ (without need to move data elsewhere).
Packit 94f725
Packit 94f725
This can happen for example when you want to change volume (master) key,
Packit 94f725
encryption algorithm, or other encryption parameter.
Packit 94f725
Packit 94f725
Cryptsetup-reencrypt can even optionally shift data on device
Packit 94f725
(reducing data device size - you need some free space at the end of device).
Packit 94f725
Packit 94f725
In general, cryptsetup-reencrypt can be used to
Packit 94f725
Packit 94f725
 - re-generate volume key
Packit 94f725
 - change arbitrary encryption parameters
Packit 94f725
 - add encryption to not yet encrypted drive
Packit 94f725
Packit 94f725
Side effect of reencryption is that final device will contain
Packit 94f725
only ciphertext (for all sectors) so even if device was not properly
Packit 94f725
wiped by random data, after reencryption you cannot distinguish
Packit 94f725
which sectors are used.
Packit 94f725
(Reencryption is done always for the whole device.)
Packit 94f725
Packit 94f725
There are for sure bugs, please TEST IT IN TEST ENVIRONMENT before
Packit 94f725
use for your data.
Packit 94f725
Packit 94f725
This tool is not resistant to HW and kernel failures - hw crash
Packit 94f725
will cause serious data corruption.
Packit 94f725
Packit 94f725
You can enable compilation of this tool with --enable-cryptsetup-reencrypt
Packit 94f725
configure option (it is switched off by default).
Packit 94f725
(Tool requires libcryptsetup 1.4.3 and later.)
Packit 94f725
Packit 94f725
You have to provide all keyslot passphrases or use --keyslot-option
Packit 94f725
(then all other keyslots will be disabled).
Packit 94f725
Packit 94f725
EXAMPLES (from man page)
Packit 94f725
Packit 94f725
Reencrypt /dev/sdb1 (change volume key)
Packit 94f725
   # cryptsetup-reencrypt /dev/sdb1
Packit 94f725
Packit 94f725
Reencrypt and also change cipher and cipher mode
Packit 94f725
  # cryptsetup-reencrypt /dev/sdb1 -c aes-xts-plain64
Packit 94f725
Packit 94f725
  Note: if you are changing key size, there must be enough space
Packit 94f725
  for keyslots in header or you have to use --reduce-device size and
Packit 94f725
  reduce fs in advance.
Packit 94f725
Packit 94f725
Add LUKS encryption to not yet encrypted device
Packit 94f725
  First, be sure you have space added to disk.
Packit 94f725
  Or, alternatively, shrink filesystem in advance.
Packit 94f725
Packit 94f725
  Here we need 4096 512-bytes sectors (enough for 2x128 bit key).
Packit 94f725
Packit 94f725
  # fdisk -u /dev/sdb # move sdb1 partition end + 4096 sectors
Packit 94f725
Packit 94f725
  # cryptsetup-reencrypt /dev/sdb1 --new --reduce-device-size 4096
Packit 94f725
Packit 94f725
There are some options which can improve performance (depends on system),
Packit 94f725
namely --use-directio (use direct IO for all operations) can be faster
Packit 94f725
on some systems. See man page.
Packit 94f725
Packit 94f725
Progress and estimated time is printed during reencryption.
Packit 94f725
Packit 94f725
You can suspend reencryption (using ctrl+c or term signal).
Packit 94f725
To continue reencryption you have to provide only
Packit 94f725
the device parameter (offset is stored in temporary log file).
Packit 94f725
Packit 94f725
Please note LUKS device is marked invalid during reencryption and
Packit 94f725
you have to retain tool temporary files until reencryption finishes.
Packit 94f725
Packit 94f725
Temporary files are LUKS-<uuid>.[log|org|new]
Packit 94f725
Packit 94f725
Other changes
Packit 94f725
~~~~~~~~~~~~~
Packit 94f725
Packit 94f725
  * Fix luks-header-from-active script (do not use LUKS header on-disk, add UUID).
Packit 94f725
Packit 94f725
  * Add --test-passphrase option for luksOpen (check passphrase only).
Packit 94f725
Packit 94f725
  * Fix parsing of hexadecimal string (salt or root hash) in veritysetup.
Packit 94f725
Packit 94f725
Changes since version 1.4.3
Packit 94f725
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit 94f725
Introduce veritysetup tool for dm-verity target management.
Packit 94f725
Packit 94f725
The dm-verity device-mapper target was added to Linux kernel 3.4 and
Packit 94f725
provides transparent integrity checking of block devices using a cryptographic
Packit 94f725
digest provided by the kernel crypto API. This target is read-only.
Packit 94f725
Packit 94f725
It is meant to be setup as part of a verified boot path (it was originally
Packit 94f725
developed by Chrome OS authors as part of verified boot infrastructure).
Packit 94f725
Packit 94f725
For deeper description please see http://code.google.com/p/cryptsetup/wiki/DMVerity
Packit 94f725
and kernel dm-verity documentation.
Packit 94f725
Packit 94f725
The libcryptsetup library was extended to support manipulation
Packit 94f725
with dm-verity kernel module and new veritysetup CLI tool is added.
Packit 94f725
Packit 94f725
There are no additional library requirements (it uses the same crypto
Packit 94f725
backend as cryptsetup).
Packit 94f725
Packit 94f725
If you want compile cryptsetup without veritysetup tool,
Packit 94f725
use --disable-veritysetup configure option.
Packit 94f725
For other configuration option see configure --help and veritysetup --help
Packit 94f725
(e.g. default parameters).
Packit 94f725
Packit 94f725
Supported libcryptsetup functions new CRYPT_VERITY type:
Packit 94f725
  crypt_init
Packit 94f725
  crypt_init_by_name
Packit 94f725
  crypt_set_data device
Packit 94f725
  crypt_get_type
Packit 94f725
  crypt_format
Packit 94f725
  crypt_load
Packit 94f725
  crypt_get_active_device
Packit 94f725
  crypt_activate_by_volume_key (volume key == root hash here)
Packit 94f725
  crypt_dump
Packit 94f725
and new introduced function
Packit 94f725
  crypt_get_verity_info
Packit 94f725
Packit 94f725
Please see comments in libcryptsetup.h and veritysetup.c as an code example
Packit 94f725
how to use CRYPT_VERITY API.
Packit 94f725
Packit 94f725
The veritysetup tool supports these operations:
Packit 94f725
Packit 94f725
  veritysetup format <data_device> <hash_device>
Packit 94f725
    Formats <hash_device> (calculates all hash areas according to <data_device>).
Packit 94f725
    This is initial command to prepare device <hash_device> for later verification.
Packit 94f725
Packit 94f725
  veritysetup create <name> <data_device> <hash_device> <root_hash>
Packit 94f725
    Creates (activates) a dm-verity mapping with <name> backed by device <data_device>
Packit 94f725
    and using <hash_device> for in-kernel verification.
Packit 94f725
Packit 94f725
  veritysetup verify <data_device> <hash_device> <root_hash>
Packit 94f725
    Verifies data in userspace (no kernel device is activated).
Packit 94f725
Packit 94f725
  veritysetup remove <name>
Packit 94f725
    Removes activated device from kernel (similar to dmsetup remove).
Packit 94f725
Packit 94f725
  veritysetup status <name>
Packit 94f725
    Reports status for the active kernel dm-verity device.
Packit 94f725
Packit 94f725
  veritysetup dump <hash_device>
Packit 94f725
    Reports parameters of verity device from on-disk stored superblock.
Packit 94f725
Packit 94f725
For more info see veritysetup --help and veritysetup man page.
Packit 94f725
Packit 94f725
Other changes
Packit 94f725
~~~~~~~~~~~~~
Packit 94f725
Packit 94f725
  * Both data and header device can now be a file and
Packit 94f725
    loop device is automatically allocated.
Packit 94f725
Packit 94f725
  * Require only up to last keyslot area for header device, previously
Packit 94f725
    backup (and activation) required device/file of size up to data start
Packit 94f725
    offset (data payload).
Packit 94f725
Packit 94f725
  * Fix header backup and restore to work on files with large data offset.
Packit 94f725
    Backup and restore now works even if backup file is smaller than data offset.
Packit 94f725
Packit 94f725
Appendix: Examples of veritysetup use
Packit 94f725
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Packit 94f725
Packit 94f725
 Format device using default parameters, info and final root hash is printed:
Packit 94f725
 # veritysetup format /dev/sdb /dev/sdc
Packit 94f725
 VERITY header information for /dev/sdc
Packit 94f725
 UUID:                   fad30431-0c59-4fa6-9b57-732a90501f75
Packit 94f725
 Hash type:              1
Packit 94f725
 Data blocks:            52224
Packit 94f725
 Data block size:        4096
Packit 94f725
 Hash block size:        4096
Packit 94f725
 Hash algorithm:         sha256
Packit 94f725
 Salt:                   5cc52759af76a092e0c21829cd0ef6938f69831bf86926525106f92a7e9e3aa9
Packit 94f725
 Root hash:              7aefa4506f7af497ac491a27f862cf8005ea782a5d97f6426945a6896ab557a1
Packit 94f725
Packit 94f725
 Activation of device in-kernel:
Packit 94f725
 # veritysetup create vr /dev/sdb /dev/sdc 7aefa4506f7af497ac491a27f862cf8005ea782a5d97f6426945a6896ab557a1
Packit 94f725
 Note - if device is corrupted, kernel mapping is created but will report failure:
Packit 94f725
 Verity device detected corruption after activation.
Packit 94f725
Packit 94f725
 Userspace verification:
Packit 94f725
 # veritysetup verify /dev/sdb /dev/sdc 7aefa4506f7af497ac491a27f862cf8005ea782a5d97f6426945a6896ab557a1
Packit 94f725
  Verification failed at position 8192.
Packit 94f725
  Verification of data area failed.
Packit 94f725
Packit 94f725
 Active device status report:
Packit 94f725
 # veritysetup status vr
Packit 94f725
 /dev/mapper/vr is active.
Packit 94f725
   type:        VERITY
Packit 94f725
   status:      verified
Packit 94f725
   hash type:   1
Packit 94f725
   data block:  4096
Packit 94f725
   hash block:  4096
Packit 94f725
   hash name:   sha256
Packit 94f725
   salt:        5cc52759af76a092e0c21829cd0ef6938f69831bf86926525106f92a7e9e3aa9
Packit 94f725
   data device: /dev/sdb
Packit 94f725
   size:        417792 sectors
Packit 94f725
   mode:        readonly
Packit 94f725
   hash device: /dev/sdc
Packit 94f725
   hash offset: 8 sectors
Packit 94f725
Packit 94f725
 Dump of on-disk superblock information:
Packit 94f725
 # veritysetup dump /dev/sdc
Packit 94f725
 VERITY header information for /dev/sdc
Packit 94f725
 UUID:                   fad30431-0c59-4fa6-9b57-732a90501f75
Packit 94f725
 Hash type:              1
Packit 94f725
 Data blocks:            52224
Packit 94f725
 Data block size:        4096
Packit 94f725
 Hash block size:        4096
Packit 94f725
 Hash algorithm:         sha256
Packit 94f725
 Salt:                   5cc52759af76a092e0c21829cd0ef6938f69831bf86926525106f92a7e9e3aa9
Packit 94f725
Packit 94f725
 Remove mapping:
Packit 94f725
 # veritysetup remove vr