Vojtech Trefny
834059ddfa
Do not hardcode number of DM segments for BitLocker devices
...
Sometimes there is no gap between the metadata so we don't want to
create a dm-crypt segment there.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
5ec2fbcd38
Allow empty passphrases when opening BitLocker devices
...
It's probably not possible to create a BitLocker device with an
empty passphrase but we want to support it. And it's definitely
better to ask for the passphrase again instead of returning
ENOMEM.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
2fbf5cd79f
Covert the BitLocker test images to sparse images
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
64ebe95751
Check sha256 sums of the bitlk images in tests
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
77109b3a33
Edit BitLocker test images to be compatible with older blkid
...
We need to keep the mirror NTFS MFT too because older versions of
blkid check it too.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
b43429e684
Fix parsing BitLocker metadata on Big Endian architectures
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
97e39f0744
Fix displaying error for not supported BitLocker key decryption
...
'crypt_bitlk_decrypt_key' can also fail because of wrong
passphrase and other reasons.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
fad592b512
Fix open on devices with no supported VMKs
2019-12-30 21:53:06 +01:00
Milan Broz
565de3c536
Fix check for bitlk iv overflow in crypto backend.
2019-12-30 21:53:06 +01:00
Milan Broz
c802269ea3
Bitlk: fix some additional gcc warnings.
2019-12-30 21:53:06 +01:00
Milan Broz
06268963fb
Bitlk: clean up some inlcudes and warnings.
2019-12-30 21:53:06 +01:00
Milan Broz
2227797691
Bitlk: move test for older blkid.
2019-12-30 21:53:06 +01:00
Milan Broz
f0888c1fe0
Add AEAD define on older kernel headers.
2019-12-30 21:53:06 +01:00
Milan Broz
eda2e62589
Add other backends (Nettle, NSS) for Bitlk decryption (through kernel wrapper).
2019-12-30 21:53:06 +01:00
Milan Broz
494d8ec04c
Add kernel backend for Bitlk key decryption.
2019-12-30 21:53:06 +01:00
Milan Broz
bb8088ca0f
Another fix for ancient systems.
2019-12-30 21:53:06 +01:00
Milan Broz
26f4bc39fc
Fix tes for very old bash.
2019-12-30 21:53:06 +01:00
Milan Broz
025e4d9fc6
Fix bitlk test on older systems.
2019-12-30 21:53:06 +01:00
Milan Broz
b2774d57ba
Bitlk: Propagare errno from key decryption.
2019-12-30 21:53:06 +01:00
Milan Broz
51edfb4ec9
Bitlk: add gcrypt key backend.
2019-12-30 21:53:06 +01:00
Milan Broz
79019b1ced
Bitlk: Move crypt key handling to crypto backend.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
bc87140b5b
Do not declare control variables in for loops
...
C89 doesn't like this.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
1c5251069b
Define UUID_STR_LEN not defined in older versions of libuuid
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
0b6dfefcec
Add tests and test images for BitLocker
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
a9e32c55c0
Fix parsing BitLocker metadata from latest Windows
...
Newest version added a new metadata entry to the recovery
passphrase protected VMK containing two new timestamps. We are
ignoring these for now.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
a494228407
Do not try to activate partially decrypted BitLocker devices
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
9932b5fc5c
Do not try to activate BitLocker devices with diffuser
...
The CBC mode with Elephant Diffuser is currently not supported
by DM crypt.
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
966ba44a33
Add support for opening of BitLocker devices
...
It's now possible to open/activate the device using passphrase or
recovery passphrase. Support is limited to devices using encryption
modes supported in the DM crypt module (AES-XTS and AES-CBC).
2019-12-30 21:53:06 +01:00
Vojtěch Trefný
62c872eb49
Add support for parsing BitLocker metadata
...
Currently only support for metadata version 2 is implemented.
2019-12-30 21:53:06 +01:00
Milan Broz
434fee2e13
Add empty template for BITLK device type.
...
Also add DM_ZERO type for multi-segment mapping.
2019-12-30 21:53:06 +01:00
Andrei Shevchuk
d3f829c065
Add note on integrity mode not supporting discards (TRIM)
2019-12-23 14:31:46 +00:00
Ondrej Kozina
83934bdcf3
Clarify LUKS2 error message related to reencryption.
...
Original messages could evoke reencryption is currently
in progress. That was inaccurate because code only
detected flag marking such device is in transition state
from metadata pov. We should not imply anything about
running processes. That's detected via reencryption locks.
2019-11-28 16:38:53 +01:00
Ondrej Kozina
3691add163
Minor code cleanup.
2019-11-28 16:38:53 +01:00
Ondrej Kozina
cc7a9e4607
Fix lookup function for keyslot-segment assignment.
...
In reencryption we can have more than 3 segments.
2019-11-28 16:38:53 +01:00
Ondrej Kozina
943fa69da6
Reduce code duplication in LUKS2 keyslot handling.
2019-11-28 16:38:53 +01:00
Ondrej Kozina
3bef291184
Unify low level LUKS2 keyslot unlock and verify code.
...
Function is now unused, see later commit
2019-11-28 16:38:53 +01:00
Ondrej Kozina
7316c53b04
Remove redundant digest id to key assignement.
2019-11-28 16:38:52 +01:00
Ondrej Kozina
5e1d1e1850
Add missing validation when unlocking keys for reencryption.
...
We missed keyslot json validation when unlocking all keys necessary
for reencryption. Also assign appropriate verified digest id to
keys in volume key structure.
2019-11-28 16:38:52 +01:00
Ondrej Kozina
e52c8e148c
Remove unnecessary query for volume key size.
...
In fact we need only stored key size in examined keyslot. It's valid for
default segment volume keys and in case of non-default segment
keys it always returns -1 and fallbacks to stored key size query
instead.
2019-11-28 16:38:52 +01:00
Ondrej Kozina
7eb47f3db1
Split reencryption locking in two variants.
2019-11-28 16:38:52 +01:00
Milan Broz
ec59d31d04
Remove AEAD tests dor MORUS and AEGIS ciphers.
...
These variants were removed from mainline kernel.
2019-11-25 23:16:53 +01:00
Milan Broz
ddd15b63b2
Add backward compatibility flags API.
...
We need to have some way hot to configure old integrity devices
with legacy padding.
For now, also use in tests to not fail checksum with new kernel.
2019-11-25 23:14:58 +01:00
Milan Broz
e91b35a53d
Print info and warning if dm-integrity fix_padding is set.
...
The dump operation prints the fix_padding flag if set.
Also try to print warning if an old kernel is used and th edevice
cannot be activated because of missing fix padding support.
2019-11-25 19:48:54 +01:00
Mikulas Patocka
fb4079aa4d
cryptsetup: add support for the "fix_padding" option
...
This patch adds support for fixed padding to cryptsetup.
* Cryptsetup will accept superblocks version 4.
* If the dm-integrity target version is greater than 1.4, cryptsetup will
add a flag "fix_padding" to the dm-integrity target arguments.
There is still one quirk: if we have an old libdm without
DM_DEVICE_GET_TARGET_VERSION and if dm-integrity module is not loaded,
cryptsetup will not detect that it can use the "fix_padding" option.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com >
2019-11-24 20:58:47 +01:00
Milan Broz
48b203a134
Add crypt_resume_by_volume_key() function.
...
If user has volume key available, LUKS device can be resumed
directly using provided volume key.
No keyslot derivation is needed, only key digest is checked.
Fixes : #502 .
2019-11-24 18:04:41 +01:00
Milan Broz
2746fd708f
Implement active device suspend info.
...
Add CRYPT_ACTIVATE_SUSPENDED bit to crypt_get_active_device() flags
that informs the caller that device is suspended (luksSuspend).
Fixes : #501 .
2019-11-24 16:56:26 +01:00
Ondrej Kozina
684f43d84d
Clarify confirmation prompt text.
...
Fixes : #473
2019-11-22 15:34:16 +01:00
Milan Broz
6b1be52e6b
Fix LUKS1 format if pkbdf benchamr is disabled.
...
We use minimum iteration for key digest in this case
(the same already used in LUKS2).
Fixes : #478 .
2019-11-22 13:02:41 +01:00
Ondrej Kozina
de6258d366
Allow --test-passphrase for detached header alone.
...
Before this fix we required data device specified on cmd line
even though it was not necessary for testing passphrase.
Fixes : #487 .
2019-11-19 14:36:06 +01:00
Ondrej Kozina
5e4dbf33be
Allow --key-file option in legacy offline encryption.
...
The option was ignored for LUKS1 encryption initialization.
Fixes : #491 .
2019-11-19 12:41:14 +01:00