Milan Broz
6ddf765d8d
Remove example covered by cryptsetup already.
2018-04-19 18:29:26 +02:00
Ondrej Kozina
38d83c27b4
Add --unbound keyslot option to cryptsetup.
...
An unbound keyslot is slot not assigned to a segment;
such a keyslot cannot be used to activate LUKS device, but
can be used for an arbitrary key store.
This patch adds --unboud option for luksAddKey cryptsetup command.
2018-04-19 18:25:35 +02:00
Ondrej Kozina
103fa8fa2c
Remove redundant check for key file.
...
Semantically same check is in tools_get_key routine.
2018-04-19 18:18:56 +02:00
Ondrej Kozina
53dcee6176
Test dump of volume key in a file.
2018-04-19 18:17:45 +02:00
Ondrej Kozina
0c6129c54e
Allow volume key store in a file with cryptsetup.
...
The --dump-master-key together with --master-key-file allows cryptsetup
to store the volume key to a file instead of standard output.
2018-04-19 18:08:37 +02:00
Ondrej Kozina
1f01754ea6
Update FIPS restrictions on crypt_volume_key_get
...
Allow crypt_volume_key_get for wrapped volume keys.
Allow crypt_volume_key_get for unbound LUKS2 keyslot keys.
2018-04-19 18:01:31 +02:00
Milan Broz
f8a7ab1752
Add crypt_get_pbkdf_default() function to get per-type PBKDF default.
2018-04-16 15:26:43 +02:00
Ondrej Kozina
09842ce46f
Update docs for crypt_keyslot_add_by_key.
2018-04-15 15:46:16 +02:00
Ondrej Kozina
0b849985b2
Do not wipe keys for wrapped key enabled ciphers.
...
We can't wipe (overwrite with random noise) wrapped key in
kernel. Such keys are usually structured and not only random
bytes.
Also it doesn't make sense to wipe these keys. They are supposed
to be protected (encrypted) by keys sealed in hardware.
TODO: tests: 1) with header, 2) without header (dm-crypt only),
3) arch with working paes cipher (at least).
2018-04-15 15:44:17 +02:00
Ondrej Kozina
34b8a48252
Add stand-alone device suspend.
2018-04-15 15:41:42 +02:00
Ondrej Kozina
6f6e1efbc8
Abort conversion when wrapped key cipher is used.
2018-04-15 15:40:48 +02:00
Milan Broz
9a72ec366d
Move generic ciper backend utilities to separate file.
...
And add wrapped key check.
2018-04-15 15:31:10 +02:00
Ondrej Kozina
d97302f351
Extend suspend tests for missing header case.
2018-04-15 13:12:25 +02:00
Ondrej Kozina
4eb75f3c80
Add debug message for failed external token validation.
2018-04-15 13:10:32 +02:00
Ondrej Kozina
e5f72a0d4f
Remove duplicate CRYPT_ANY_TOKEN define.
2018-04-15 13:10:01 +02:00
Ondrej Kozina
b11b11f9b0
Add test for LUKS2 conversion with tokens.
2018-04-15 13:08:57 +02:00
Ondrej Kozina
70077db07d
Abort conversion when LUKS2 header contains tokens.
...
Tokens may contain import 3rd party data. Prompt users
to remove such tokens explicitly.
2018-04-15 13:08:44 +02:00
Ondrej Kozina
eed682c529
Add fixme in luks2->luks1 convert code.
2018-04-15 13:05:22 +02:00
Ondrej Kozina
fbf2d64f34
Allow crypt_volume_key_get for unbound keyslots.
2018-04-15 13:05:08 +02:00
Ondrej Kozina
48bf08922c
Make all LUKS2 key size helpers return negative value on error.
2018-04-15 13:03:51 +02:00
Ondrej Kozina
3616ee50c0
Fix off by one bug in LUKS2 keyslot max id allocation.
...
This is almost impossible to hit bug. The max keyslot id is
checked in higher layer.
2018-04-12 15:50:24 +02:00
Ondrej Kozina
255c8e8ff4
Avoid pbkdf benchmark on LUKS2 header down conversion.
...
Also clarify use of placeholder keyslots in down conversion.
2018-04-12 15:49:35 +02:00
Ondrej Kozina
0891e84bf8
Add reencrypt tests for --master-key-file option.
2018-04-12 15:45:40 +02:00
Ondrej Kozina
a63db4ab24
Add --master-key-file parameter to cryptsetup-reencrypt.
2018-04-12 15:45:30 +02:00
Ondrej Kozina
169d45fbdb
Move reading master key in command line utilities.
...
Move and rename _read_mk->tools_read_mk in utils_password.c
2018-04-12 15:44:19 +02:00
Ondrej Kozina
965e0237a3
Add basic test for CRYPT_VOLUME_KEY_SET flag.
...
Also test for bug in keyslot to digest assignment if target
digest id is not 0.
2018-04-12 15:42:32 +02:00
Ondrej Kozina
4caef0dec7
Add new volume key flag to crypt_keyslot_add_by_key.
...
The new flag may be used to force update device volume key.
2018-04-12 15:35:34 +02:00
Ondrej Kozina
622763b240
Fix memory leak on error path in cryptsetup-reencrypt.
2018-04-11 16:12:15 +02:00
Ondrej Kozina
35d29b22c0
Move CRYPT_ANY_DIGEST definition.
2018-04-11 15:49:29 +02:00
Ondrej Kozina
fee1d659cf
Fix wrong digest assignment to new LUKS2 (volume key) keyslot.
...
All new LUKS2 keyslots added by passphrase or by volume key
were assigned to digest 0 despite the fact segment was assigned
to different digest.
2018-04-11 15:49:15 +02:00
Ondrej Kozina
869767a5cf
Move general i/o code to stand-alone utility file.
...
Get rid of internal library stuff linked to the utilities.
Also rename 'count' param to 'length' clarifying handling
of the parameter internally.
2018-04-11 15:33:43 +02:00
Milan Broz
23b01621ff
Print better debug message for open with write mode.
2018-04-10 15:33:30 +02:00
Milan Broz
f21ebaf839
Check LUKS2 conversion for luksmeta header.
...
We will reject upconversion if there is a luksmeta magic signature.
2018-04-10 14:54:35 +02:00
Milan Broz
f6f00b98a7
Always convert the whole last keyslot (including alignment).
2018-04-10 14:53:33 +02:00
Milan Broz
187170ec51
Check cipher before writing metadata (LUKS2).
...
Some ciphers and key sizes created on-disk metadata that cannot be used.
Use the same test for length-preserving cipher as LUKS1.
Also check if key for integrity algorithm is not too small.
Fixes #373 .
2018-04-06 12:57:58 +02:00
Milan Broz
f7ad64a3d3
Move absolute path helper to m4 macro.
2018-04-04 12:35:08 +02:00
Eli Schwartz
103d75f773
configure.ac: fix bashisms
...
In commits 9bcc97bc5e and
5536b3a58d new features were
added, which used bash-specific features in a POSIX sh script. This
caused configure to completely fail with syntax errors on systems where
/bin/sh was not symlinked to GNU bash.
`==` is a bash-specific alias for `=` and should never, ever, ever be
used since it offers no additional utility for bash but merely serves
to confuse people writing POSIX.
substring parameter expansion, e.g. `${with_tmpfilesdir:0:1}` is not
POSIX but can be trivially replaced by case wildcards.
2018-04-04 12:13:59 +02:00
Milan Broz
ed2968e3e8
Add paes to ciphers that cannot be used for LUKS2 keyslot encryption.
...
And use AES-XTS for keyslot in this case.
2018-03-31 17:42:30 +02:00
Milan Broz
fef5121cee
veritysetup: add support for --check-at-most-once option.
...
The kernel 4.17 will include a new dm-verity flag that
instructs kernel to verify data blocks only once.
This patch adds support for it to libcryptsetup and veritysetup.
This flag can be dangerous; if you can control underlying device
(you can change its content after it was verified) it will no longer
prevent reading tampered data and also it does not prevent to silent
data corrruptions that appears after the block was once read.
2018-03-31 11:50:09 +02:00
Milan Broz
c84983f91e
Add simple luksConvertKey test.
2018-03-25 15:04:00 +02:00
Milan Broz
86f4f4440a
Reformat crypt_resize function.
2018-03-25 14:25:02 +02:00
Milan Broz
af0887fb48
Remove no passphrase error message from library.
...
And move it to tools.
This will unify LUKS1/2 error messages.
2018-03-25 14:14:37 +02:00
Matthew Garrett
610c7858d6
Add explicit key conversion command
...
Add support for converting a keyslot from one pbkdf to another without
opening the device.
2018-03-23 09:53:06 +01:00
Milan Broz
8d1fb88a20
Fix return code and retry count for bad passphrase and non-tty input.
...
It there is an input on stdin (pipe), we cannot retry for password,
a retry applies only for the real terminal.
Also the retry lost EPERM (wrong passphrase) return code in this case,
replacing it with tty read error.
Fixes #321 .
2018-03-23 08:13:43 +01:00
Ondrej Kozina
1e2ad19d68
Validate LUKS2 keyslot json before opening it.
2018-03-22 14:06:31 +01:00
Ondrej Kozina
7bee66fe36
Add new luks2 keyslot validation condition.
2018-03-22 14:05:19 +01:00
Ondrej Kozina
303fe886b7
Fix misleading param name in prototype.
2018-03-22 14:05:08 +01:00
Ondrej Kozina
761a472b45
Remove missing digest condition from LUKS2 digest verification.
2018-03-22 14:04:56 +01:00
Ondrej Kozina
3cf2da877f
Refactor crypt_activate_by_keyfile_device_offset.
...
It's activation by passphrase after all.
2018-03-22 14:03:48 +01:00
Michal Virgovič
5b7b1596a2
Add tests for veritysetup FEC userspace decoding.
2018-03-22 12:44:14 +01:00