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
Ondrej Kozina
4c4cc55bb7
Wipe backup segment data after reencryption is finished.
2019-05-27 16:05:21 +02:00
Ondrej Kozina
f4c2e7e629
Implement LUKS2 reencrypt keyslot dump.
2019-05-27 15:27:23 +02:00
Ondrej Kozina
0c725a257d
Compare moved segment specific size against real device size only.
2019-05-24 17:29:56 +02:00
Ondrej Kozina
bd6af68bc5
Add support for explicit reencryption recovery in request.
2019-05-24 17:07:37 +02:00
Ondrej Kozina
13050f73c1
Properly finished reencryption after recovery.
2019-05-24 17:07:37 +02:00
Ondrej Kozina
5472fb0c56
Refactor reencryption recovery during activation.
2019-05-24 17:07:36 +02:00
Ondrej Kozina
60d26be325
Load volume key in keyring when activated by token.
...
LUKS2 should use keyring for dm-crypt volume keys by default
when possible. crypt_activate_by_token didn't load keys in
keyring by default. It was a bug.
2019-05-21 18:08:00 +02:00
Ondrej Kozina
013d0d3753
Rename internal reencrypt enum to REENC_PROTECTION_NONE.
2019-05-21 18:08:00 +02:00
Ondrej Kozina
31cd41bfe4
Add support for reencryption of initial device part.
...
It's useful to reencrypt only initial device part only.
For example with golden image reencryption it may be useful
to reencrypt only first X bytes of device because we know
the rest of device is empty.
2019-05-21 15:54:07 +02:00
Ondrej Kozina
af6c321395
Set default length for reencryption with resilience 'none' only.
2019-05-21 15:54:07 +02:00
Ondrej Kozina
1923928fdc
Drop duplicate error message from reencrypt load.
2019-05-21 15:54:07 +02:00
Ondrej Kozina
8c8a68d850
Add CRYPT_REENCRYPT_RESUME_ONLY flag.
2019-05-13 18:23:20 +02:00
Ondrej Kozina
2d0079905e
Adapt device_open_excl to reusing of fds.
2019-05-10 21:05:31 +02:00
Ondrej Kozina
83c227d53c
Sync device using internal write enabled descriptor.
2019-05-10 21:05:31 +02:00
Ondrej Kozina
ee57b865b0
Reuse device file desriptors.
2019-05-10 21:05:31 +02:00
Ondrej Kozina
8545e8496b
Fix memleak in reencryption with moved segment.
2019-05-07 17:17:34 +02:00
Milan Broz
237021ec15
Fix some warnings in static analysis.
2019-05-07 13:44:43 +02:00
Milan Broz
1f91fe7a2c
Use JSON-debug wrappers.
2019-05-03 14:02:43 +02:00
Ondrej Kozina
a7f80a2770
Add resilient LUKS2 reencryption library code.
2019-05-02 16:44:23 +02:00
Ondrej Kozina
345385376a
Add missing validation check for area type specification.
2019-04-29 16:10:57 +02:00
Milan Broz
dbe9db26fc
Never serialize memory-hard KDF for small amount of memory.
2019-04-29 16:10:57 +02:00
Ondrej Kozina
86b2736480
Drop unused type parameter from LUKS2_keyslot_find_empty()
2019-04-23 10:41:56 +02:00
Milan Broz
cfe2fb66ab
Fix some untranslated error messages.
2019-04-23 10:41:06 +02:00
Milan Broz
1b49ea4061
Add global serialization lock for memory hard PBKDF.
...
This is very ugly workaround for situation when multiple
devices are being activated in parallel (systemd crypttab)
and system instead of returning ENOMEM use OOM killer
to randomly kill processes.
This flag is intended to be used only in very specific situations.
2019-03-29 11:58:12 +01:00
Ondrej Kozina
80a435f00b
Write keyslot binary data and metadata holding single lock.
2019-03-25 11:37:32 +01:00
Ondrej Kozina
fdcd5806b1
Allow to change requirements flag in-memory only.
2019-03-25 11:37:32 +01:00
Ondrej Kozina
fea2e0be4f
Add algorithm for searching largest gap in keyslots area.
2019-03-13 14:56:31 +01:00
Milan Broz
751f5dfda3
Move error message for a keyslot area search.
2019-03-13 14:56:31 +01:00
Ondrej Kozina
d5f71e66f9
Allow digest segment (un)binding for all segments at once.
2019-03-13 14:56:31 +01:00
Ondrej Kozina
03e810ec72
Split crypt_drop_keyring_key in two different routines.
...
crypt_drop_keyring_key function allow to drop all keys in keyring
assocatiated with passed volume key list.
crypt_drop_keyring_key_by_description is used to drop independent key.
2019-03-13 14:56:31 +01:00
Ondrej Kozina
6c6f4bcd45
Add signed int64 json helpers.
2019-03-13 14:56:31 +01:00
Ondrej Kozina
304942302b
Introduce CRYPT_DEFAULT_SEGMENT abstraction.
...
Default segment is no longer constant segment with id 0.
2019-03-13 14:56:31 +01:00
Ondrej Kozina
8dc1a74df8
Adapt existing code to future reencryption changes.
2019-03-13 14:56:31 +01:00
Ondrej Kozina
e295d01505
Adding new functions later used in reencryption.
2019-03-13 14:56:31 +01:00
Ondrej Kozina
56b571fcaa
Use const before vk in all digest verify functions.
2019-03-08 08:52:47 +01:00
Ondrej Kozina
46bf3c9e9c
Add segment create helpers.
2019-03-08 08:44:51 +01:00
Ondrej Kozina
361fb22954
Remove helper get_first_data_offset completely.
2019-03-08 08:43:19 +01:00
Ondrej Kozina
203fe0f4bf
Move get_first_data_offset to luks2_segment.c
2019-03-08 08:42:23 +01:00
Ondrej Kozina
36ac5fe735
Move LUKS2 segments handling in separate file.
2019-03-08 08:39:32 +01:00