blkid_loff_t offset = 0, size = 0;
blkid_partlist pl;
bool found = false;
- int r, i, n;
+ int r, n;
assert(fd >= 0);
assert(label);
if (n < 0)
return errno > 0 ? -errno : -EIO;
- for (i = 0; i < n; i++) {
+ for (int i = 0; i < n; i++) {
blkid_partition pp;
sd_id128_t id;
const char *sid;
PasswordCache *cache,
UserRecord **ret_luks_home_record) {
- int r, token;
+ int r;
assert(cd);
assert(h);
- for (token = 0;; token++) {
+ for (int token = 0;; token++) {
_cleanup_(json_variant_unrefp) JsonVariant *v = NULL, *rr = NULL;
_cleanup_(EVP_CIPHER_CTX_freep) EVP_CIPHER_CTX *context = NULL;
_cleanup_(user_record_unrefp) UserRecord *lhr = NULL;
_cleanup_(fdisk_unref_contextp) struct fdisk_context *c = NULL;
_cleanup_(fdisk_unref_tablep) struct fdisk_table *t = NULL;
_cleanup_free_ char *path = NULL, *disk_uuid_as_string = NULL;
- size_t n_partitions, i;
+ size_t n_partitions;
sd_id128_t disk_uuid;
bool found = false;
int r;
return log_error_errno(r, "Failed to acquire partition table: %m");
n_partitions = fdisk_table_get_nents(t);
- for (i = 0; i < n_partitions; i++) {
+ for (size_t i = 0; i < n_partitions; i++) {
struct fdisk_partition *p;
p = fdisk_table_get_partition(t, i);
PasswordCache *cache, /* the passwords acquired via PKCS#11/FIDO2 security tokens */
char **effective_passwords /* new passwords */) {
- size_t volume_key_size, i, max_key_slots, n_effective;
+ size_t volume_key_size, max_key_slots, n_effective;
_cleanup_(erase_and_freep) void *volume_key = NULL;
struct crypt_pbkdf_type good_pbkdf, minimal_pbkdf;
const char *type;
build_good_pbkdf(&good_pbkdf, h);
build_minimal_pbkdf(&minimal_pbkdf, h);
- for (i = 0; i < max_key_slots; i++) {
+ for (size_t i = 0; i < max_key_slots; i++) {
r = crypt_keyslot_destroy(setup->crypt_device, i);
if (r < 0 && !IN_SET(r, -ENOENT, -EINVAL)) /* Returns EINVAL or ENOENT if there's no key in this slot already */
return log_error_errno(r, "Failed to destroy LUKS password: %m");