]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libfido2-util: remove superfluous asserts
authornikstur <nikstur@outlook.com>
Tue, 2 Jun 2026 21:38:55 +0000 (23:38 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 3 Jun 2026 11:01:17 +0000 (12:01 +0100)
These asserts don't make sense and actually break the FIDO2 support in
systemd-cryptsetup.

Follow-up for bd141bd818fcb2e35638f963b0680a1218776f5d

src/shared/libfido2-util.c

index 371acf92333c47fef4428a03734700f9eff82707..5e6a29016d1c8f82d527c3f294c168dd650d67a9 100644 (file)
@@ -1154,12 +1154,6 @@ static int check_device_is_fido2_with_hmac_secret(
         _cleanup_(fido_dev_free_wrapper) fido_dev_t *d = NULL;
         int r;
 
-        assert(ret_has_rk);
-        assert(ret_has_client_pin);
-        assert(ret_has_up);
-        assert(ret_has_uv);
-        assert(ret_has_always_uv);
-
         d = sym_fido_dev_new();
         if (!d)
                 return log_oom();
@@ -1171,7 +1165,16 @@ static int check_device_is_fido2_with_hmac_secret(
 
         r = verify_features(d, path, LOG_DEBUG, ret_has_rk, ret_has_client_pin, ret_has_up, ret_has_uv, ret_has_always_uv);
         if (r == -ENODEV) { /* Not a FIDO2 device, or not implementing 'hmac-secret' */
-                *ret_has_rk = *ret_has_client_pin = *ret_has_up = *ret_has_uv = *ret_has_always_uv = false;
+                if (ret_has_rk)
+                        *ret_has_rk = false;
+                if (ret_has_client_pin)
+                        *ret_has_client_pin = false;
+                if (ret_has_up)
+                        *ret_has_up = false;
+                if (ret_has_uv)
+                        *ret_has_uv = false;
+                if (ret_has_always_uv)
+                        *ret_has_always_uv = false;
                 return false;
         }
         if (r < 0)