From: Frantisek Sumsal Date: Thu, 26 Aug 2021 08:38:46 +0000 (+0200) Subject: cryptsetup: drop an unused variable X-Git-Tag: v250-rc1~771 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=061f0084eb48f7f593041f99bc084eb8a1d420c6;p=thirdparty%2Fsystemd.git 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; ... ``` --- diff --git a/src/cryptsetup/cryptsetup-tokens/luks2-fido2.c b/src/cryptsetup/cryptsetup-tokens/luks2-fido2.c index 442a57b63fe..a0e1ccbeeb8 100644 --- a/src/cryptsetup/cryptsetup-tokens/luks2-fido2.c +++ b/src/cryptsetup/cryptsetup-tokens/luks2-fido2.c @@ -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);