Repository navigation
+ dm-crypt plain mode: open, mount and create headerless volumes - #806
Merged
Merged
Conversation
Plain dm-crypt volumes store nothing but ciphertext; every parameter comes
from the user. They were not supported at all.
- DmCryptPlainParameters: cipher spec, passphrase hash (incl. hash:bytes and
`plain`), key size, offset and skip, defaulting to cryptsetup 2.8's plain
defaults (aes-xts-plain64, sha256, 256 bits). Read from the mount
credentials' parameters or from the create options.
- DmCryptPlainVolume: key derivation (round r hashes r 'A's + passphrase,
digests concatenated and cut to the key; hash:n zero-pads the rest), the
block device (IV sector = skip + data sector) and the writer.
- DmCryptPlainFormatDescriptor ("DmCryptPlain"): never detected, chosen by
id; lists/extracts volume.img with the defaults, mounts the filesystem
inside read-only or read-write through IEncryptedBlockDeviceProvider,
creates volumes. A wrong passphrase cannot be detected and simply finds no
filesystem.
Sourcing: rung 2. cryptsetup's crypt_plain.c is GPL-2.0-or-later, so it was
read for orientation only; the key-derivation rules were written down in
docs/DMCRYPT-PLAIN-ON-DISK.md and are pinned by cryptsetup as the oracle.
Sector encryption reuses the LUKS AES XTS/CBC implementation.
Verified: cryptsetup open --type plain maps our volumes to our plaintext and
we decrypt what it writes through its mapping, both ways, for XTS with
sha256/sha512/ripemd160 and 256/512-bit keys, CBC-plain with sha1, offsets,
skips and sha256:20. The CBC-ESSIV case runs on CI (this host's kernel has
no essiv module).
Closes #800
The local regeneration cannot load Svr4BfsWriter and dropped its section and index link; restore them (and count it) as main and CI have them.
Restoring the Svr4BfsWriter section by hand repeated the FileSystem.SysV namespace heading; this is the file the README check itself regenerated (artifact package-readmes of run 42720922485).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dm-crypt plain mode (headerless) volumes can now be opened, mounted and created.
Changes
DmCryptPlainParameters/DmCryptPlainVolume/DmCryptPlainFormatDescriptor(DmCryptPlain): cipher spec, passphrase hash (incl.hash:bytesandplain), key size, offset and skip, defaulting to cryptsetup 2.8's plain defaults; never auto-detected.IEncryptedBlockDeviceProvider(parameters via the mount's volume parameters); extract uses the defaults; create via format options.docs/DMCRYPT-PLAIN-ON-DISK.md(derived from cryptsetup's behaviour — itscrypt_plain.cis GPL and was not converted). Support matrix row, API reference regenerated.Verification
hash:nzero padding,plain), round trips for every parameter set, IV skip, mount + write through the resolver.DmCryptPlainExternalConformanceTests, run in the CI "LUKS oracle" step), both directions, for XTS/sha256/sha512/ripemd160, CBC-plain/sha1 with offset+skip,sha256:20, CBC-ESSIV. All pass locally except CBC-ESSIV (this host's kernel lacks the essiv module), which CI covers.Closes #800