dm_target_crypt - Fix compatibility with Linux
authorAlex Hornung <ahornung@gmail.com>
Sat, 21 Aug 2010 06:17:54 +0000 (07:17 +0100)
committerAlex Hornung <ahornung@gmail.com>
Sat, 21 Aug 2010 06:21:10 +0000 (07:21 +0100)
commit7a89864aca790456f28133cb04924ae4b1364a46
treede8da0abadda2e0c9073be8c3bde01db7aaf259f
parent619de3dbfce9be4d5c88700fe543de4180428905
dm_target_crypt - Fix compatibility with Linux

* The sector number that Linux' dm-crypt passes to its iv generators
  is offset another -block_offset sectors, so that the actual sector
  number is the one on the dm device, not the underlying device.

* Also fix the plain iv generator, which is supposed to be a "32-bit
  little-endian version of the sector number"

* Now our dm_target_crypt can read Linux' crypt disks. This was tested
  with an image using aes-cbc-essiv:sha256 and aes-cbc-plain.
sys/dev/disk/dm/dm_target_crypt.c