Commit Graph

60 Commits

Author SHA1 Message Date
Milan Broz
153aed3d16 Fix key-size descriptions
For compatibility reasons, cryptsetup uses key size in BITS
while integritysetup in BYTES.

The help is confusing here, this patch fixes it.

Thanks Daniel Tang for notification.
2025-11-21 16:34:47 +01:00
Milan Broz
267de08586 man: Try to explain PBKDF hardcoded limits. 2025-07-29 09:14:56 +02:00
Milan Broz
a498757fd4 man: Use *WARNING* only for serious issues.
Use highlighted warning only for possibility of data loss or serious security issues.

No need to scary people everywhere :)
2025-07-29 09:14:56 +02:00
Milan Broz
349912fec2 man: Do not use *NOTE*, it is just a normal description. 2025-07-29 09:14:56 +02:00
Milan Broz
b0e3b94839 man: Remove mentions about archeologic kernel 2.6 and kernel 4.x 2025-07-29 09:14:56 +02:00
Milan Broz
2c95933bb5 man: Clarify that commands do not wipes data, unify OPAL reset wording. 2025-07-29 09:14:56 +02:00
Milan Broz
bc1b149ee4 man: Better mark option --align-payload as deprecated. 2025-07-29 09:14:56 +02:00
Milan Broz
55272bee98 man: Make --sector-size option description more clear. 2025-07-29 09:14:56 +02:00
Milan Broz
9590d6fe62 man: Clarify --label option. 2025-07-29 09:14:56 +02:00
Milan Broz
5af06cb6cc man: Weaken warning about /dev/urandom as recent kernels behave much better. 2025-07-29 09:14:56 +02:00
Milan Broz
360f85dde7 man: Grammar and simple stylistic fixes.
This is based mainly on Grammarly.

It unifies man pages to at least some level of grammar,
so later we can focus on adding more readable content.
2025-07-17 15:01:39 +02:00
Milan Broz
1438140ce3 man: Do not wrap sentences in man pages.
This helps to use external tools for language checking.
2025-07-17 12:38:17 +02:00
Milan Broz
a52e1aadca man: unify formatting of options
- do not use bold if option is the text
- unify argument format
- do not highlight obsolete syntax
2025-07-17 11:51:18 +02:00
Ondrej Kozina
10ab6be262 Allow --reduce-device-size and --device-size in encrypt action.
Fixes: #822
2025-06-02 17:10:02 +02:00
Milan Broz
324926e2d8 LUKS2: support Inline tags format and activation for integrity protection 2025-05-22 14:53:16 +02:00
Ondrej Kozina
ad21502d06 Extend options for initializing reencrypiton from cli.
This patch extends available options for LUKS2 reencryption
initialization.

When no specific keyslot is selected by --key-slot option, all active
keyslots needs to be refreshed. With current patch user does not
have to provide passphrase via interactive prompt when token is
available and can unlock assigned keyslot. Only keyslots not assigned
to tokens (and unlocked by tokens) must be provided with passphrase.

Furthermore user may directly narrow down selection of keyslots
suitable for reencryption by specifying either --token-id, --token-type
or --token-only option. In that case only keyslots associated to the
specific token (--token-id) or specific type (--token-type) or any token
specified in LUKS2 metadata (--token-only) will be used for
reencryption and refreshed with new volume key. All other keyslots will
not be refreshed and will be erased after reencryption is finished. The token
association will be carried over to refreshed keyslots.

The third new method available in this patch is support for reencryption
by passing volume keys directly. The LUKS2 device may be reencrypted
by passing volume keys by --volume-key-file, --new-volume-key-file,
--volume-key-keyring or --new-volume-key-keyring options. With this
options user may reencrypt device with no active keyslots. If there's
any active keyslot and volume keys are passed directly user may enforce
volume key based reencryption by passing --force-no-keyslots option.
If --force-no-keyslots option is passed all active keyslots will be
erased after reencryption operation is finished and the device may be
unlocked only by passing new volume key directly.

Fixes: #774, #780.
2025-05-20 15:29:14 +02:00
Ondrej Kozina
0dc630b911 Allow reencryption resume by new methods.
The reencryption operation can now be resumed
using tokens or by specifying volume keys
directly.
2025-05-20 15:29:14 +02:00
Ondrej Kozina
cbcb8c6ee3 Allow device in reencryption to be activated by volume keys in files.
Allow to use up to two --volume-key-file options (paired with
two --key-size options) for device in-reencryption activation.
2025-05-20 15:29:14 +02:00
nl6720
52c63b5de1 Note the need to omit separator characters from the PSID 2025-02-19 12:42:27 +02:00
Milan Broz
b201a62987 Add a note about OPAL PSID sensitivity to manual pages. 2024-12-12 22:44:35 +00:00
Milan Broz
491f31c4d4 Add --integrity-key-size option to cryptsetup.
This patch adds support for --integrity-key-size option that can be used
to setup non-standard HMAC integrity key size.
2024-12-03 20:25:54 +01:00
Milan Broz
768bca1df5 Support plain resize with keyring key. 2024-11-25 14:55:51 +01:00
Milan Broz
0cc686af59 TCRYPT: Clear mapping of system encrypted partitions.
TrueCrypt/VeraCrypt supports full system encryption (only a partition
table is not encrypted) or system partition encryption
(only a system partition is encrypted).
The metadata header then contains the offset and size of the encrypted area.
Cryptsetup needs to know the specific partition offset to calculate encryption parameters.
To properly map a partition, you must specify a real partition device so cryptsetup can calculate this offset.

As user can specify various combination, we need to determine the proper
IV and data offsets.

The logic for CRYPT_TCRYPT_SYSTEM_HEADER flag should be (in this order):
- if data device is a real partition, calculate offset from it.
- if --header is a real partition , calculate offset from it.
- if device is a real disk, try to search for partition using decrypted offset and size
(works only for system partition-only encryption).
- if data and metadata (header) device is the same, map whole encrypted area
(this is the ost confusing for user)
- if data and metadata (header) divice differs, expect data image contains
only partition (setting offset to 0, but using IV offset from header).

There are still situation that can end with wrong mapping, but user now has the option
to setup it properly.

Also this patch fixes use of stored encryption size in header,
so we do not map larger area.

Fixes:#889
2024-07-02 13:04:30 +00:00
Milan Broz
98b4243432 Add support for high-priority dm-crypt flag.
This patch add new --perf-high_priority cryptsetup option
for flga added in Linux kernel 6.10, dm-crypt target version 1.26.
2024-06-18 11:00:38 +00:00
Milan Broz
bd8cfe1efb Mention need for possible PSID reset for some OPAL drives in man page.
Fixes: #879
2024-05-23 06:29:20 +00:00
Milan Broz
1e58ad570e Add --key-description and --new-key-description for luksAddKey command. 2024-05-10 10:54:59 +02:00
Milan Broz
73975857a3 Add --key-description for luksResume command. 2024-05-10 10:54:55 +02:00
Milan Broz
3c79fd6c4b Add --key-description for open command. 2024-05-10 10:54:50 +02:00
Milan Broz
82118bdd5f Add --key-description for resize command. 2024-05-10 10:54:47 +02:00
Milan Broz
3e01e151f8 Add --key-description for luksFormat command. 2024-05-10 10:54:43 +02:00
Milan Broz
e085ae461f Add --key-description for luksDump command. 2024-05-10 10:54:37 +02:00
Milan Broz
4a40d79322 Fix --key-description actions and define --new-key-description. 2024-05-10 10:54:32 +02:00
Milan Broz
bc62204a41 Add warning about OPAL admin PIN to man page and release notes. 2024-04-09 10:46:13 +02:00
Ondrej Kozina
3e29dbe6f2 Add --hw-opal-factory-reset switch in erase options explicitly. 2024-03-26 12:01:27 +00:00
Ondrej Kozina
5a0208cd06 Allow --link-vk-to-keyring with --test-passphrase option.
To make it possible to upload volume key in user specified kernel
keyring without need to (re)activate the device.
2024-02-29 16:25:17 +01:00
Milan Broz
82f37d7a10 Sort options in man pages alphabetically. 2024-02-22 20:58:35 +00:00
Milan Broz
cbf818a660 Fix JSON exampe in progress-frequency option. 2024-02-22 20:58:35 +00:00
Milan Broz
e1ef5214e7 Fix some typos found by lintian. 2023-11-29 09:49:55 +01:00
Ondrej Kozina
836e5e4539 Add --external-tokens-path parameter in cryptsetup. 2023-11-16 17:49:09 +01:00
Ondrej Kozina
32fbac17b1 Improve cmd line options man pages related to SED OPAL. 2023-10-31 11:13:58 +01:00
Ondrej Kozina
4081037bdb Add --key-file support in luksErase action with LUKS2 opal. 2023-10-31 11:13:58 +01:00
Ondrej Kozina
51a1e218cf Split logic for uploading keys in kernel key service.
We can not link internal VK kernel key in custom user
keyring. There are two reasons for it:

The internal VK kernel key description can not be
acquired via API and it may change over time
(LUKS2 reencryption).

With recent SED OPAL support volume key becomes a 'blob'
containing up to two keys (dm-crypt key for SWE and key
for unlocking SED OPAL locking range). The internal
kernel key contains only dm-crypt (if required) but
custom user keyring needs to be provided with whole
volume key (blob).

Added user specified key description for the linked key
in custom user keyring. The linked key can be reached by
the specified description after successful activation (resume).
2023-09-25 18:59:09 +00:00
Milan Broz
1c31b93e5c Add --disable-blkid CLI option.
To be used with luksFormat if blkid fails for unknown reason.
2023-09-12 22:09:06 +02:00
Daniel Zatovic
1aab3afcba Allow activation, resume and luksAddKey using VK stored in keyring.
Add --volume-key-keyring option, which takes a name of a key in keyring,
which will be used as a VK during device activation. The key can be
specified in keyctl-compatible syntax "%<key_type>:<key_name>".
2023-08-16 14:17:34 +02:00
Ondrej Kozina
b65fb6072e Do not mention --new-keyfile option in luksChangeKey action man page. 2023-08-15 15:23:17 +02:00
Milan Broz
d173514b81 Do not decrease PBKDF parameters if a user forces them.
If a user explicitly specifies PBKDF parameters (like iterations,
used memory of threads), do not limit them, even if it can cause
resource exhaustion.

The only limits are hard limits per the PBKDF algorithm.

The force options were mostly used for decreasing parameters,
but it should work even opposite - despite the fact it can mean
shooting yourself in the foot (OOM).

Fixes: #812
2023-04-24 13:09:34 +02:00
Ondrej Kozina
93c5013577 Clarify when cryptsetup asks for LUKS2 token PINs. 2023-02-09 12:40:50 +00:00
Milan Broz
9f8fe3da16 Fix some typos. 2022-10-01 22:35:52 +02:00
Ondrej Kozina
5fce0c2ad1 Extend luksAddKey action options via crypt_keyslot_add_by_keyslot_context API.
In practice luksAddKey action does two operations. It unlocks existing
device volume key and stores unlocked volume key in a new keyslot.
Previously the options were limited to key files and passphrases.
With this patch user may combine freely following options:

To unlock keyslot with volume key user may:
- provide existing passphrase via interactive prompt (default method)
- use --key-file option to provide file with a valid passphrase to existing keyslot
- provide volume key directly via --volume-key-file
- unlock keyslot via all available LUKS2 tokens by --token-only
- unlock keyslot via specific token with --token-id
- unlock keyslot via specific token type by --token-type

To provide the passphrase for a new keyslot user may:
- provide existing passphrase via interactive prompt (default method)
- use --new-keyfile parameter or positional parameter to read the
  passphrase from file.
- use --new-token-id to select specific LUKS2 token to get passphrase
  for new keyslot. New keyslot is assigned to selected token id if
  operation is succesfull.

Fixes: #725.
2022-09-29 17:31:29 +02:00
Ondrej Kozina
2e29eb7906 cryptsetup-luksAddKey man page cleanup. 2022-09-22 17:45:20 +02:00