]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup: drop an unused variable
authorFrantisek Sumsal <frantisek@sumsal.cz>
Thu, 26 Aug 2021 08:38:46 +0000 (10:38 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 26 Aug 2021 12:13:08 +0000 (13:13 +0100)
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;
...
```

src/cryptsetup/cryptsetup-tokens/luks2-fido2.c

index 442a57b63fea93676f8e26530e07bbd9710bcaae..a0e1ccbeeb88fb8596546c4e8c6535bfc82dda18 100644 (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);