33 Commits

Author SHA1 Message Date
Funda Wang
1c75cd0dc4 meson: install binaries 2025-07-29 12:23:22 +02:00
Milan Broz
8364178b38 Update copyright year. 2025-01-15 23:09:36 +01:00
Milan Broz
beef8e325a Fix clang undefined version error for ssh token
We use common libcryptsetup-token.sym version script that contain
all symbols, but some of them are optional.

As clang linker treats missing symbols as errors, the linker
phase for ssh token fails as optional cryptsetup_token_buffer_free
is not defined.
(Most of distros has this option still disabled, though).

As the sym file is also example for token authors, removing symbols
there is not an option. For clang, we can use --undefined-version option,
but it is not supported by other linkers, so it requires non-trivial
checks for usable LDFLAGS (for both autoconf and meson).

Instead, fix it by simply defining the symbol in ssh token, which
duplicates the internal libcryptsetup functionality.

Fixes: #830
2024-09-01 00:38:57 +02: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
Ondrej Kozina
5ef1878b34 Do not use fake-token-path in ssh and systemd plugin tests. 2023-11-17 10:42:23 +01:00
Milan Broz
9d5e45be54 Add header guard to ssh-utils.h. 2023-03-10 11:41:47 +01:00
Daniel Zatovic
114a13af84 Add support for meson build system.
For now, let's keep support for both - autotools and meson.
2023-03-03 13:49:47 +00:00
wangzhiqiang
1f805cb35a Update file cryptsetup-ssh.c 2023-02-10 16:48:19 +00:00
wangzhiqiang
ec0efe7068 fix potential null pointer dereference.
Signed-off-by: wangzhiqiang <wangzhiqiang95@huawei.com>
2023-02-10 19:49:48 +08:00
Milan Broz
72f799b393 Update Copyright year. 2023-02-09 17:11:18 +01:00
Ondrej Kozina
09ac5321f4 Fix memory leak in ssh token example. 2022-08-23 15:53:25 +02:00
Milan Broz
97a22c27dd Make crypt_load quiet if metadata is not detected.
Ths will allow automatic scan of known formats.

Errors are printed only if something is wrong with already detected metadata.

This change means that it is responsibility of the caller to print an error
message if needed.

Also fix some places without a message.

Fixes: #642
2022-05-26 10:17:32 +02:00
Milan Broz
677e06c48a Check all snprintf calls for returning values. 2022-02-24 20:28:18 +01:00
Milan Broz
33d8605924 Fix duplicate ssh plugin error message. 2022-02-08 22:12:31 +01:00
Milan Broz
ab975bc1c4 Update copyright year.
And unify format in several places.
2022-01-29 10:43:02 +01:00
Yuri Chornoivan
b00946d449 Fix minor typo: assing -> assign 2021-07-30 16:19:36 +00:00
Milan Broz
508284cd28 Support build with older libssh.
The function ssh_session_is_known_server() was introduced later,
fallback to older version if libssh is available.
2021-07-25 21:57:09 +02:00
Vojtech Trefny
7c76d17a9c ssh token: Make strings in the plugin translatable 2021-07-25 18:08:22 +02:00
Vojtech Trefny
b4670ce7f0 ssh token: Change license to LGPL
The cryptsetup-ssh binary stays under GPL.
2021-06-29 16:19:04 +02:00
Vojtech Trefny
3589f9578a ssh token: Fix -Wmissing-prototypes warnings 2021-06-29 15:11:46 +02:00
Vojtech Trefny
3dc7dff2b2 ssh token: Fix return code when adding multiple tokens
token_add returns ID of the added token so we can't use it as a
return code for the binary.
2021-06-29 15:11:46 +02:00
Vojtech Trefny
35793c24f0 ssh token: Allow specifying key slot when adding the token 2021-06-29 15:11:46 +02:00
Vojtech Trefny
ff958d376e ssh token: Remove unused sshplugin_context struct 2021-06-29 15:11:46 +02:00
Vojtech Trefny
6545523df3 ssh token: Add the token to the first keyslot with matching passphrase
Currently the "add" action adds the token to all keyslots, this
changes the behaviour to make sure the token is added to the first
keyslot that can be unlocked using the provided passphrase.
2021-06-29 15:11:46 +02:00
Vojtech Trefny
3e52aa820c ssh token: Move SSH code to a separate utils file 2021-06-29 15:11:43 +02:00
Milan Broz
8f752a2bd7 Fix a Coverity warning. 2021-06-17 13:02:42 +02:00
Vojtech Trefny
52cc01c977 cryptsetup-ssh: Add debug and verbose options 2021-06-16 12:30:53 +02:00
Vojtech Trefny
b8d2218720 cryptsetup-ssh: Better argument parsing and help for the options 2021-06-16 12:30:49 +02:00
Ondrej Kozina
5d0a11a21b Add pin size parameter in crypt_active_by_pin_token.
Well, after all it really should have supported binary data
of arbitrary length.
2021-03-18 18:06:13 +01:00
Milan Broz
d703301fe8 Mark or remove unused parameters.
Mark unused parameters with proper attribute where it is a part
of API or some internal logic.

And remove other unused parameters completely.
2021-02-11 11:12:11 +00:00
Milan Broz
bb6d522198 Mark ssh token as experimental. 2021-02-03 15:17:07 +01:00
Milan Broz
89b3105493 Add example SSH token handler.
Provides example of loadable token handler for activation
json validation and metadata dump.

For creating new ssh example token use special cryptsetup-ssh
binary.
2021-02-03 11:43:04 +00:00