mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Fix some compiler warnings.
This commit is contained in:
@@ -324,7 +324,7 @@ int crypt_pbkdf(const char *kdf, const char *hash,
|
||||
return -EINVAL;
|
||||
|
||||
if (!PKCS5_PBKDF2_HMAC(password, (int)password_length,
|
||||
(unsigned char *)salt, (int)salt_length,
|
||||
(const unsigned char *)salt, (int)salt_length,
|
||||
(int)iterations, hash_id, (int)key_length, (unsigned char *)key))
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
|
||||
@@ -1550,7 +1550,6 @@ static int dm_status_dmi(const char *name, struct dm_info *dmi,
|
||||
struct dm_task *dmt;
|
||||
uint64_t start, length;
|
||||
char *target_type, *params = NULL;
|
||||
void *next = NULL;
|
||||
int r = -EINVAL;
|
||||
|
||||
if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
|
||||
@@ -1573,7 +1572,7 @@ static int dm_status_dmi(const char *name, struct dm_info *dmi,
|
||||
goto out;
|
||||
}
|
||||
|
||||
next = dm_get_next_target(dmt, next, &start, &length,
|
||||
dm_get_next_target(dmt, NULL, &start, &length,
|
||||
&target_type, ¶ms);
|
||||
|
||||
if (!target_type || start != 0)
|
||||
@@ -2416,7 +2415,7 @@ int dm_query_device(struct crypt_device *cd, const char *name,
|
||||
|
||||
dmd->size += length;
|
||||
t = t->next;
|
||||
} while (next);
|
||||
} while (next && t);
|
||||
|
||||
if (dmi.read_only)
|
||||
dmd->flags |= CRYPT_ACTIVATE_READONLY;
|
||||
|
||||
@@ -170,7 +170,6 @@ int crypt_wipe_device(struct crypt_device *cd,
|
||||
|
||||
if (dev_size <= offset)
|
||||
return -EINVAL;
|
||||
length = dev_size - offset;
|
||||
}
|
||||
|
||||
r = posix_memalign((void **)&sf, alignment, wipe_block_size);
|
||||
|
||||
@@ -931,7 +931,7 @@ static int set_pbkdf_params(struct crypt_device *cd, const char *dev_type)
|
||||
|
||||
pbkdf.type = opt_pbkdf ?: pbkdf_default->type;
|
||||
pbkdf.hash = opt_hash ?: pbkdf_default->hash;
|
||||
pbkdf.time_ms = opt_iteration_time ?: pbkdf_default->time_ms;
|
||||
pbkdf.time_ms = (uint32_t)opt_iteration_time ?: pbkdf_default->time_ms;
|
||||
if (strcmp(pbkdf.type, CRYPT_KDF_PBKDF2)) {
|
||||
pbkdf.max_memory_kb = opt_pbkdf_memory ?: pbkdf_default->max_memory_kb;
|
||||
pbkdf.parallel_threads = opt_pbkdf_parallel ?: pbkdf_default->parallel_threads;
|
||||
|
||||
@@ -484,7 +484,7 @@ static int set_pbkdf_params(struct crypt_device *cd, const char *dev_type)
|
||||
|
||||
pbkdf.type = opt_pbkdf ?: pbkdf_default->type;
|
||||
pbkdf.hash = opt_hash ?: pbkdf_default->hash;
|
||||
pbkdf.time_ms = opt_iteration_time ?: pbkdf_default->time_ms;
|
||||
pbkdf.time_ms = (uint32_t)opt_iteration_time ?: pbkdf_default->time_ms;
|
||||
if (strcmp(pbkdf.type, CRYPT_KDF_PBKDF2)) {
|
||||
pbkdf.max_memory_kb = opt_pbkdf_memory ?: pbkdf_default->max_memory_kb;
|
||||
pbkdf.parallel_threads = opt_pbkdf_parallel ?: pbkdf_default->parallel_threads;
|
||||
|
||||
Reference in New Issue
Block a user