1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

cryptsetup: drop an unused variable

This fixes compilation with new-enough libcryptsetup (2.4.0+) & clang:

```
$ CC=clang CXX=clang++ meson build --werror -Dlibcryptsetup-plugins=true
...
$ ninja -C build
...
../src/cryptsetup/cryptsetup-tokens/luks2-fido2.c:23:53: error: unused variable 'v' [-Werror,-Wunused-variable]
        _cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
...
```
This commit is contained in:
Frantisek Sumsal 2021-08-26 10:38:46 +02:00 committed by Luca Boccassi
parent f7327a485b
commit 061f0084eb

View File

@ -20,7 +20,6 @@ int acquire_luks2_key(
int r;
Fido2EnrollFlags required;
size_t cid_size, salt_size, decrypted_key_size;
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL;
_cleanup_free_ void *cid = NULL, *salt = NULL;
_cleanup_free_ char *rp_id = NULL;
_cleanup_(erase_and_freep) void *decrypted_key = NULL;
@ -53,7 +52,7 @@ int acquire_luks2_key(
required,
&decrypted_key,
&decrypted_key_size);
if (r == -ENOLCK) /* libcryptsetup returns -ENOANO also on wrong pin */
if (r == -ENOLCK) /* libcryptsetup returns -ENOANO also on wrong PIN */
r = -ENOANO;
if (r < 0)
return r;
@ -61,7 +60,7 @@ int acquire_luks2_key(
/* Before using this key as passphrase we base64 encode it, for compat with homed */
r = base64mem(decrypted_key, decrypted_key_size, &base64_encoded);
if (r < 0)
return crypt_log_error_errno(cd, r, "Can not base64 encode key: %m");
return crypt_log_error_errno(cd, r, "Failed to base64 encode key: %m");
*ret_keyslot_passphrase = TAKE_PTR(base64_encoded);
*ret_keyslot_passphrase_size = strlen(*ret_keyslot_passphrase);