Ondrej Kozina
9845d6fd40
Shorten reencryption parameters debug message.
2019-08-05 18:28:15 +02:00
Ondrej Kozina
e5a59d6925
Remove json debug reencryption metadata fragments.
2019-08-05 18:28:15 +02:00
Ondrej Kozina
b3af88708d
Change reencryption mode parameter type to enum.
2019-08-01 15:40:53 +02:00
Ondrej Kozina
97ea39404a
Allow reencryption to parse names prefixed with /dev.
2019-08-01 10:43:57 +02:00
Ondrej Kozina
3bea349f9e
Optionaly check device table before reencryption initialization.
2019-08-01 10:43:57 +02:00
Ondrej Kozina
98e0c8d609
Extend device table check in-before reencryption.
2019-08-01 10:43:57 +02:00
Ondrej Kozina
b79086b3e9
Refactor assembly of multi-segment LUKS2 devices.
2019-07-31 14:58:55 +02:00
Ondrej Kozina
b551bdb0ce
Make json_segments_count fn return unsigned value.
2019-07-31 14:58:55 +02:00
Ondrej Kozina
0886bc7afd
Check for error sooner while assigning reencryption segments.
...
Also wraps function parameters definition.
2019-07-31 14:58:55 +02:00
Ondrej Kozina
e16319a290
Fail encryption initialization when data device too small.
2019-07-26 16:09:38 +02:00
Ondrej Kozina
c033643f07
Fix corner case bug in encryption with data shift.
...
If we initialized encryption with data shift and only single
segment the resulting metadata were missing
CRYPT_REENCRYPT_MOVE_FIRST_SEGMENT flag and also segments json section was
invalid.
2019-07-26 16:06:03 +02:00
Ondrej Kozina
607e2248c8
Simplify LUKS2_reencrypt_direction function.
2019-07-26 16:06:03 +02:00
Ondrej Kozina
a1111c7aa0
Tighten reencryption direction field validation.
2019-07-26 16:06:03 +02:00
Ondrej Kozina
1b82e70fc1
Fix bug in minimal device size calculation for reencryption.
2019-07-26 16:06:03 +02:00
Ondrej Kozina
35068c2e6e
Fix broken segments calculation for backward data shift reencryption.
2019-07-26 16:06:03 +02:00
Ondrej Kozina
212703edf8
crypt_get_data_offset() must always return new offset value.
2019-07-26 16:06:03 +02:00
Ondrej Kozina
7460d1a446
Fix backward reencryption with data shift.
...
The device has to be shrunk the data shift size during activation.
Otherwise the online reencryption would fail with incorrect device
size.
2019-07-26 16:04:27 +02:00
Ondrej Kozina
c851205f83
Fix bug in reencryption digest to segment assignement.
2019-07-23 17:28:26 +02:00
Ondrej Kozina
dd0e073159
Fill direction field in crypt_reencrypt_status.
2019-07-23 17:28:26 +02:00
Ondrej Kozina
3f85da0098
Fix datashift calculation in reencryption initialization.
2019-07-23 17:28:25 +02:00
Ondrej Kozina
dad28f3dfe
Move exclusive open for offline reencryption in initialization.
2019-07-23 17:28:25 +02:00
Ondrej Kozina
e8e1da3fb5
Do not callback progress twice in reencryption loop.
2019-07-23 17:28:25 +02:00
Ondrej Kozina
330f9daade
Pass max_hotzone_size inside reencryption parameters in sectors.
2019-07-12 15:37:18 +02:00
Ondrej Kozina
4a232bc868
Pass device size inside reencryption parameters in sectors.
...
it was mistake in reencryption API. All other device sizes
related to device mapper devices are always in 512b setctors.
2019-07-12 15:37:18 +02:00
Ondrej Kozina
61dff96474
Reencryption keyslot must report as unbound.
2019-07-12 15:37:18 +02:00
Ondrej Kozina
81dbc9c070
Reduce implicit keyslots size when header device is too small.
...
Unless user explicitly asks for keyslots areas size
(either via --luks2-keyslots-size or --offset) reduce keyslots
size so that it fits in metadata device.
2019-07-12 15:37:08 +02:00
Ondrej Kozina
e3e6e75d40
Improvements to LUKS2 reencryption error messages.
...
- make error messages propagated to users more comprehensible
- drop some error messages completely
- replace many error messages with debug logs only
Fixes #458 .
2019-07-01 10:18:55 +02:00
Yuri Chornoivan
4143d9871e
Fix minor typos
2019-06-28 12:02:39 +00:00
Ondrej Kozina
d4682b3b38
Cleanup translated messages id.
...
- minimize count of almost identical message ids
- unify style for some messages
- remove some useless messages
2019-06-27 10:23:42 +02:00
Ondrej Kozina
2f4a50064f
Add direction hint in reencryption hotzone device name.
2019-06-27 10:23:36 +02:00
Ondrej Kozina
292a5f50b2
Allow offline reencryption on files without root privileges.
...
If userspace block ciphers are not available try kcapi first.
2019-06-27 10:19:23 +02:00
Ondrej Kozina
c25ce7c585
Allow disabling of reencryption locks via crypt_metadata_locking()
2019-06-27 10:19:18 +02:00
Ondrej Kozina
b22c9a86a9
Add internal crypt_zalloc routine (calloc wrapper).
2019-06-27 10:19:14 +02:00
Ondrej Kozina
614f671b92
Introduce SUBDEV internal device type.
...
LUKS2 and other device types allow stacking of dm devices
underneath public top level device.
The new type identifies clearly those private devices in respective
device stack so that they can be easily removed while removing
top level public device.
Switch LUKS2 reencryption device stack to use SUBDEV type immmediately
for hotzone and overlay devices. Other devices will follow in later
releases.
2019-06-27 10:19:01 +02:00
Ondrej Kozina
af62dbf3d3
Add internal limit for count of dm dependencies.
...
32 should be enough (+1 for terminating NULL byte)
2019-06-27 10:18:58 +02:00
Ondrej Kozina
249e6af3a6
Add LUKS2 uuid component in underlying dm-integrity device.
2019-06-27 10:18:56 +02:00
Ondrej Kozina
aba95b00aa
Activate underlying dm-integrity privately for LUKS2 w/ auth. encryption.
2019-06-27 10:18:50 +02:00
Ondrej Kozina
4e19719bdd
Check hotzone size and device size alignment earlier.
...
It failed later but it was difficult to understand what went wrong.
2019-06-27 10:18:44 +02:00
Ondrej Kozina
3cabf608ca
Unify reencryption context load error messages.
2019-06-27 10:18:37 +02:00
Milan Broz
2e841622f8
Print proper error message if LUKS2 slot encryption fail.
2019-06-26 17:30:30 +02:00
Guilhem Moulin
70c4ce199d
Fix minor spelling errors in manpage and messages.
...
Reported by lintian(1) - Static analysis tool for Debian packages:
accidentaly -> accidentally
trigerring -> triggering
alocate -> allocate
alignemnt -> alignment
initalize -> initialize
2019-06-18 09:42:28 +02:00
Ondrej Kozina
272505b99d
If no hash is specified in pbkdf use default value for keyslot AF.
2019-06-13 17:04:21 +02:00
Ondrej Kozina
60a769955b
Rename hash data parameter in reencrypt keyslot dump.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
34bec53474
Drop excessive nested locking in LUKS2 keyslot store path.
...
Since commit 80a435f it's not needed to call device_write_lock
in function luks2_encrypt_to_storage. It's handled correctly on
upper layer.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
c77ae65a0d
Wipe both keyslot data and metadata holding single write lock.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
1ed0430b82
Move LUKS2 write lock upper when storing reencryption keyslot.
2019-06-12 12:36:51 +02:00
Ondrej Kozina
44aabc3ae4
Drop reload of metadata in reencryption initialization.
2019-06-12 12:36:50 +02:00
Ondrej Kozina
bbdf9b2745
Read and compare metadata sequence id after taking write lock.
2019-06-12 12:36:46 +02:00
Ondrej Kozina
96a87170f7
Return usage count from device locking functions.
2019-06-12 11:51:08 +02:00
Ondrej Kozina
9c3a020ecf
Remove useless debug message from keyslot dump.
2019-05-27 16:23:56 +02:00