summaryrefslogtreecommitdiff
path: root/src/shared/cryptsetup-util.c
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: fix typoYu Watanabe2022-12-021-1/+1
|
* dlfcn-util: add static asserts ensuring our sym_xyz() func ptrs match the ↵Lennart Poettering2022-11-211-0/+10
| | | | | | | | | | | | | | | | | types from the official headers Make sure that the sym_xyz function pointers have the types that the functions we'll assign them have. And of course, this found a number of incompatibilities right-away, in particular in the bpf hookup. (Doing this will trigger deprecation warnings from libbpf. I simply turned them off locally now, since we are well aware of what we are doing in that regard.) There's one return type fix (bool → int), that actually matters I think, as it might have created an incompatibility on some archs.
* repart: Do offline encryption instead of onlineDaan De Meyer2022-11-151-1/+25
| | | | | | | | | | Offline encryption can be done without mounting the luks device. For now we still use loop devices to split out the partition we want to write to but in a later commit we'll replace this with a regular file. For offline encryption, we need to keep 2x the luks header size space free at the end of the partition, so this means our encrypted partitions will be 16M larger than before.
* cryptsetup-util: Always define dlopen_cryptsetup()Daan De Meyer2022-10-111-57/+61
|
* tpm2-util: add common parser for the LUKS2 TPM2 JSON structureLennart Poettering2022-09-081-23/+23
| | | | | | | | | | This splits out the JSON parser used by the systemd-cryptsetup code. This is preparation for later work to reuse it in the tpm2 cryptsetup token module, which currently uses a separate but very similar parser for the same data. No change in behaviour.
* various: convert to the new dlopen_or_warn() helperZbigniew Jędrzejewski-Szmek2021-06-241-19/+4
|
* dlfcn-util: invert function naming and add helper that does the whole jobZbigniew Jędrzejewski-Szmek2021-06-241-1/+1
| | | | | | | | | | | | | We warn when the operation fails, not when it succeeds. Hence this should be "<do>_or_<handle failure>", not "<do>_and_<handle failure>". We *could* use whatever convention we want, but rust and perl are rather consistent in using the logical convention. We don't care about perl that much, but having a naming convention inverted wrt. rust would be rather confusing. Also, pretty much every implementation does similar steps, so add a nice wrapper which combines opening of the library and loading of the symbols. Also add missing sentinel attribute in dlopen_or_warn().
* cryptsetup: fix typoYu Watanabe2021-06-021-1/+1
|
* Merge pull request #19768 from poettering/homectl-fido2-lock-withLennart Poettering2021-06-011-12/+53
|\ | | | | homed: catch up with FIDO2 features in cryptsetup + other fixes
| * cryptsetup: implicitly set global log functions when loading libcryptsetup ↵Lennart Poettering2021-06-011-7/+18
| | | | | | | | | | | | | | | | dynamically So far we only set the per-crypt_device log functions, but some libcryptsetup calls we invoke without a crypt_device objects, and we want those to redirect to our infra too.
| * homework: make libcryptsetup dep runtime optionalLennart Poettering2021-06-011-5/+35
| |
* | cryptsetup-util: disable pbkdf benchmark in cryptsetup_set_minimal_pbkdf.Ondrej Kozina2021-06-011-2/+6
|/ | | | | | | | | | | | No need to benchmark pbkdf when asking for minimal values anyway. 1000 iterations count is minimum for both LUKS1 and LUKS2 pbkdf2 keyslot parameters according to NIST SP 800-132, ch. 5.2. Iterations count can not be lower than recommended minimum when benchmark is disabled. The time_ms member is ignored with benchmark disabled.
* cryptsetup: use crypt_token_max if availableLuca Boccassi2021-01-051-0/+6
| | | | | | New API added upstream: https://gitlab.com/cryptsetup/cryptsetup/-/commit/8a12f6dc2c75f8fd0c4969fbdc421895eb418072
* cryptsetup-util: add helper for setting minimal PBKDFLennart Poettering2020-12-171-0/+26
|
* cryptsetup-util: add helper call for extracting/parsing token JSONLennart Poettering2020-12-171-0/+103
|
* tree-wide: make use of new DLSYM_ARG() macro everywhereLennart Poettering2020-12-041-17/+17
|
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* shared: make libcryptsetup dep dlopenLennart Poettering2020-09-021-2/+79
| | | | | | | | | | | | | | Let's make libcryptsetup a dlopen() style dep for PID 1 (i.e. for RootImage= and stuff), systemd-growfs and systemd-repart. (But leave to be a regulra dep in systemd-cryptsetup, systemd-veritysetup and systemd-homed since for them the libcryptsetup support is not auxiliary but pretty much at the core of what they do.) This should be useful for container images that want systemd in the payload but don't care for the cryptsetup logic since dm-crypt and stuff isn't available in containers anyway. Fixes: #8249
* shared: rename crypt-util.c → cryptsetup-util.cLennart Poettering2020-09-021-0/+34
"crypt-util.c" is such a generic name, let's avoid that, in particular as libc's/libcrypt's crypt() function is so generically named too that one might thing this is about that. Let's hence be more precise, and make clear that this is about cryptsetup, and nothing else. We already had cryptsetup-util.[ch] in src/cryptsetup/ doing keyfile management. To avoid the needless confusion, let's rename that file to cryptsetup-keyfile.[ch].