259 Commits

Author SHA1 Message Date
Ondrej Kozina
f3a9e95dd8 Add simple API for token assignment reporting. 2018-02-22 15:21:37 +01:00
Milan Broz
1fe014dbae Update copyright year. 2018-01-20 17:55:21 +01:00
Milan Broz
f34ce81f25 Introduce new 64bit *keyfile_device_offset functions.
The keyfile interface was designed, well, for keyfiles.

Unfortunately, a keyfile can be placed on a device and the size_t offset
can overflow.

We have to introduce new set of fucntions that allows 64bit offsets even on 32bit systems:
 - crypt_resume_by_keyfile_device_offset
 - crypt_keyslot_add_by_keyfile_device_offset
 - crypt_activate_by_keyfile_device_offset
 - crypt_keyfile_device_read

The new functions have added _device_ in name.

Old functions are just internall wrappers around these.

Also cryptsetup --keyfile-offset and --new-keyfile-offset must now
process 64bit offsets.

For more info see issue 359.
2018-01-17 22:07:23 +01:00
Ondrej Kozina
e4520693dd API docs cleanup and clarifications 2017-12-18 19:32:44 +01:00
Ondrej Kozina
d799c8bd1e update crypt_resize api docs 2017-12-12 14:02:41 +01:00
Andrea Gelmini
a97de38b6b Fix typos. 2017-11-08 10:22:49 +01:00
Ondrej Kozina
76947fa835 luks2: add offline reencrypt requriement 2017-10-28 22:29:28 +02:00
Michal Virgovic
956ea10f56 Integritysetup manual correction (key size).
Also mention key size in header struct doc.
2017-10-14 19:46:37 +02:00
Milan Broz
38d53db6e9 Reformat and fix libcryptsetup.h / Doxygen doc.
No functional change in this patch.
2017-09-26 16:35:20 +02:00
Milan Broz
19a1852e4b Support sector size option even for plain devices. 2017-09-24 19:50:28 +02:00
Milan Broz
9f2727bb77 Add libLUKS2. 2017-09-24 19:50:12 +02:00
Milan Broz
64e91951b2 Add generic LUKS format define.
It means "load any LUKS version".
2017-09-24 19:49:56 +02:00
Milan Broz
5536b3a58d Add implementation of device/file locking for metadata.
To be used later.
2017-09-24 19:49:46 +02:00
Milan Broz
c56bdee177 Add backend support for new device-mapper kernel options.
This patch adds support for using keyring for volume key
and support for new integrity fields for dm-crypt.

Also helpers for searching disk by id.

To be used later.
2017-09-24 19:49:35 +02:00
Milan Broz
66db5b39bb Change PBKDF insterface to allow forced iterations (time cost) count.
Also move functions to separate utils_pbkdf.c file.

PBKDF can be now set for any context.

TODO: new setting is not covered by tests.
2017-09-24 19:49:21 +02:00
Milan Broz
87dd427d79 Make benchmark progress parameter the same as the internal unsigned type. 2017-08-12 17:55:01 +02:00
Milan Broz
5fc79f5627 Move PBKDF internal benchmark to one place.
Also cache its value in active context, so we run benchmark
only once.

The patch also changes calculated value for LUKS1 key digest
to 125 miliseconds (it means that for full 8 used slots
the additional slow-down is circa 1 second).

Note that there is no need to have too high iteration count
for key digest; if it is too computationally expensive, attacker
will better decrypt of one sector with candidate key anyway.
(Check for a known signature.)

The reason to have some delay for key digest check was
to complicate brute-force search for volume key with LUKS header
only (and if RNG used to generate volumekey was flawed
allowing such a search i reasonable time).
2017-08-12 17:50:02 +02:00
Milan Broz
4125beb0fb Add callback for PBKDF benchmark.
Also change API so the kdf structure is continuously updated
with the benchmarked data (callback can see progress or debug).
2017-08-10 12:44:24 +02:00
Milan Broz
3435f9cb2c Use only crypt_get_integrity_info in API.
Some other functions remain internal only.

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2017-08-06 21:34:01 +02:00
Milan Broz
0abf57be5d Change PBKDF interface API.
Prepare API for PBKDF that can set three costs
  - time (similar to iterations in PBKDF2)
  - memory (required memory for memory-hard function)
  - threads (required number of threads/CPUs).

This patch also removes wrongly designed API call
crypt_benchmark_kdf and replaces it with the new call
crypt_benchmark_pbkdf.

Two functions for PBKDF per context setting
are introduced: crypt_set_pbkdf_type and crypt_get_pbkdf_type.

The patch should be backward compatible when using
crypt_set_iteration_time function (works only for PBKDF2).

Signed-off-by: Milan Broz <gmazyland@gmail.com>
2017-08-06 21:24:05 +02:00
Milan Broz
9bd06be43b Add info function for integrity devices and print info about journal attributes. 2017-07-31 16:49:19 +02:00
Milan Broz
01598028c4 Aff info function for integrity device and print info ion status. 2017-07-31 16:48:29 +02:00
Milan Broz
dbdb611bcc Document crypt_params_integrity struct members. 2017-07-26 13:21:19 +02:00
Milan Broz
32d5e59ab6 Implement deferred removal of device.
This can be used in some automated systems and allows device
to be removed after the last user mapping closes it.
2017-06-23 14:41:54 +02:00
Milan Broz
a58ed1ada3 Better specify error codes from crypt_wipe. 2017-06-22 13:32:05 +02:00
Milan Broz
3a27c84d98 Rewrite and export crypt_wipe function.
The crypt_wipe can be used to wipe any part of the device,
and also to initialize integrity based device (to reset checksum).
2017-06-07 15:31:13 +02:00
Milan Broz
0bb7098fd8 Add integritysetup command line tool for the dm-integrity standalone setting.
The dm-integrity target is intended to be used for authenticated
encryption through LUKS and dm-crypt.

It can be used in standalone as well; for this use case there
is a simple configuration utility called integritysetup
(similar to veritysetup to dm-verity).
2017-05-28 09:22:17 +02:00
Milan Broz
fc0bef732b Add FEC offset parameter for verity. 2017-04-03 12:34:50 +02:00
Milan Broz
7307293c87 Use explicit 32bit value in API for FEC roots. 2017-04-03 10:15:44 +02:00
Sami Tolvanen
c2cf33af24 WIP: Add support for verity FEC. 2017-04-01 21:23:10 +02:00
Milan Broz
98368c4770 Update copyright years. 2017-03-12 13:17:15 +01:00
Daniel Reichelt
9a798a766e support PIM parameter for VeraCrypt compatible devices
This patch adds the --veracrypt-pim=INT and --veracrypt-query-pim command-
line parameters to support specification of or being queried for a custom
Personal Iteration Multiplier respectively. This affects the number of
iterations for key derivation from the entered password. The manpage is
also updated accordingly.

Fixes Issue #307.
2017-03-02 09:11:23 +01:00
Milan Broz
4dd703ea6c Support activation options for error handling modes in dm-verity.
This patch adds veritysetup support for these Linux kernel dm-verity options:

  --ignore-corruption - dm-verity just logs detected corruption
  --restart-on-corruption - dm-verity restarts the kernel if corruption is detected

  If the options above are not specified, default behaviour for dm-verity remains.
  Default is that I/O operation fails with I/O error if corrupted block is detected.

  --ignore-zero-blocks - Instructs dm-verity to not verify blocks that are expected
   to contain zeroes and always return zeroes directly instead.

NOTE that these options could have serious security or functional impacts,
do not use them without assessing the risks!
2016-05-04 10:07:47 +02:00
Milan Broz
9cbe74c2db Remove last error handling (error is logged). 2015-11-20 09:18:58 +01:00
Milan Broz
d293de579a Fix various backward incompatibilities in password processing. 2015-11-20 09:18:31 +01:00
Milan Broz
4aea3b81ee Remove password callback interface.
This was a design mistake and should not be handled inside libcryptsetup code.
2015-11-20 09:18:31 +01:00
Milan Broz
f0986be2e3 Export crypt_keyfile_read(). 2015-11-20 09:18:31 +01:00
Milan Broz
f238e8c075 Add 1.6.8 release notes. 2015-09-08 12:26:54 +02:00
Milan Broz
def397d0c8 Update libcryptsetup.h comments. 2015-08-26 16:10:10 +02:00
Milan Broz
8aee4f95fb Clarify using of VeraCrypt modes in libcryptsetup.h. 2015-02-25 10:55:24 +01:00
Milan Broz
1f2d8de95f Support VeraCrypt devices (TrueCrypt extension).
Add CRYPT_TCRYPT_VERA_MODES libcryptswtup flag and
--veracrypt option.

Fixes issue#245.
2015-02-24 22:04:15 +01:00
Milan Broz
4f7b413638 Add low-level performance options for dmcrypt tuning.
The patch adds the two options
  --perf-same_cpu_crypt
  --perf-submit_from_crypt_cpus
that set the same named options inside dmcrypt
(available in Linux kernel 3.20 and later).
2015-02-20 16:46:34 +01:00
Milan Broz
3add769b51 Add deprecation warning about internal terminal password query. 2014-06-28 13:49:26 +02:00
Milan Broz
bb8dbfdf5b Update author name. 2014-06-23 21:40:12 +02:00
Milan Broz
2e97d8f8e8 Prepare version 1.6.4. 2014-02-27 14:36:13 +01:00
Milan Broz
f3e398afc5 Rewrite cipher benchmark loop.
Using getrusage seems toi give not adequate precision,
so use clock_gettime and try to scale buffer size a bit
on high performance systems.

If it still fail, return ERANGE error instead calculating
completely unreliable numbers.

Should fix Issue#186.
2013-12-01 10:55:35 +01:00
Milan Broz
e600024908 Fix passphrase pool overflow for TCRYPT device id passphrase > pool size.
TCRYPT format limits passphrase length to max. 64 characters so simply error in this case.
2013-02-14 14:37:50 +01:00
Milan Broz
5cb5aeba36 Fix doxygen doc for libcryptsetup.h. 2013-01-14 00:22:50 +01:00
Milan Broz
29f21208a0 Change License from GPLv2 only to GPLv2+ ("or any later").
Agreed by all copyright authors.
2012-12-29 11:33:54 +01:00
Milan Broz
e4c4049741 Add basic support for system TCRYPT device.
Rename option hidden to tcrypt-hidden.
2012-12-22 22:34:09 +01:00