Commit Graph

13 Commits

Author SHA1 Message Date
Milan Broz
f5bbc499d4 Move LUKS_STRIPES definition to macros definitions.
To be used in repair code later.
2025-05-22 16:09:50 +02:00
Milan Broz
e936d4395b Opal: limit PSID keyfile read if not set otherwise
PSID length is de-facto always 32 alphanumeric characters.

Limit the read of PSID from keyfile to this limit
(if not set by explicit size option).

This eliminates mistakes when the keyfile contains EOL characters.

Also, some OPAL drives accepts PSID with any suffix, this patch
unifies processing (it works everywhere the same).
2025-04-22 15:30:38 +02:00
Milan Broz
8364178b38 Update copyright year. 2025-01-15 23:09:36 +01:00
Milan Broz
021e5c31fd Check for bad device-mapper name early
There is no need to unlock keyslot if the provided name
has wrong format. Let's check for length and '/' in name early.

Note that other commands could accept path to the device
as libdevmapper translate it to the name (status /dev/mapper/xxx).
Add early check only to activate commands.

It still can fail later because of mangled characters.

Fixes: #893
2024-07-16 08:05:13 +00:00
Milan Broz
661f57def4 Use SPDX license identifiers.
This patch switches code to SPDX one-line license identifiers according to
https://spdx.dev/learn/handling-license-info/
and replacing long license text headers.

I used C++ format on the first line in style
// SPDX-License-Identifier: <id>
except exported libcryptsetup.h, when only C comments are used.

The only additional changes are:
- switch backend utf8.c from LGPL2+ to LGPL2.1+ (as in systemd)
- add some additional formatting lines.
2024-06-03 16:38:15 +00:00
Milan Broz
bd0ef58b3a Update copyright notice to include 2024 year. 2024-01-23 16:10:44 +01:00
Milan Broz
72f799b393 Update Copyright year. 2023-02-09 17:11:18 +01:00
Milan Broz
773fc0195f Fix typos found by codespell.
Thanks Dimitri Papadopoulos Orfanos for the patch.

Fixes: #734.
2022-04-20 14:37:13 +00:00
Milan Broz
ab975bc1c4 Update copyright year.
And unify format in several places.
2022-01-29 10:43:02 +01:00
Milan Broz
0b2c4187b0 Workaround clang alignment warnings (Wcast-align) when working with byt arrays.
This should silence similar warnings like
  warning: cast from 'char *' to 'struct xyz *' increases required alignment from 1 to X
when we try to calclulate byte pointer offsets in a buffer.
2022-01-26 10:28:57 +00:00
Ondrej Kozina
796b901912 Do not retry tokens that already returned -ENOANO.
In token based activation loop (token_id == CRYPT_ANY_TOKEN)
we do not want retry tokens that already returned -ENOANO (wrong pin)
once.
2021-07-26 14:10:08 +02:00
Milan Broz
2d9c0b507d Remove VLAs from UUID block parsing code. 2021-02-18 11:10:20 +00:00
Milan Broz
76301cef4c Use one file for macros and basic constants for the whole project.
And avoid some dual definitions between tools and library.
2021-02-11 11:12:11 +00:00