Remove some stale FIXME markings.

This commit is contained in:
Milan Broz
2021-02-05 12:27:39 +01:00
parent d703301fe8
commit 4471452105
17 changed files with 9 additions and 30 deletions

View File

@@ -31,7 +31,6 @@ struct cipher_alg {
bool wrapped_key;
};
/* FIXME: Getting block size should be dynamic from cipher backend. */
static const struct cipher_alg cipher_algs[] = {
{ "cipher_null", NULL, 16, false },
{ "aes", NULL, 16, false },

View File

@@ -99,7 +99,7 @@ int crypt_backend_init(void)
return -ENOSYS;
}
/* FIXME: If gcrypt compiled to support POSIX 1003.1e capabilities,
/* If gcrypt compiled to support POSIX 1003.1e capabilities,
* it drops all privileges during secure memory initialisation.
* For now, the only workaround is to disable secure memory in gcrypt.
* cryptsetup always need at least cap_sys_admin privilege for dm-ioctl

View File

@@ -29,7 +29,6 @@
#include <linux/if_alg.h>
#include "crypto_backend_internal.h"
/* FIXME: remove later */
#ifndef AF_ALG
#define AF_ALG 38
#endif

View File

@@ -74,7 +74,7 @@ static long time_ms(struct rusage *start, struct rusage *end)
count_kernel_time = 1;
/*
* FIXME: if there is no self usage info, count system time.
* If there is no self usage info, count system time.
* This seem like getrusage() bug in some hypervisors...
*/
if (!end->ru_utime.tv_sec && !start->ru_utime.tv_sec &&
@@ -412,7 +412,6 @@ int crypt_pbkdf_perf(const char *kdf, const char *hash,
if (!kdf || !iterations_out || !memory_out)
return -EINVAL;
/* FIXME: whole limits propagation should be more clear here */
r = crypt_pbkdf_get_limits(kdf, &pbkdf_limits);
if (r < 0)
return r;

View File

@@ -189,7 +189,7 @@ int INTEGRITY_tag_size(struct crypt_device *cd __attribute__((unused)),
if (!integrity || !strcmp(integrity, "none"))
auth_tag_size = 0;
else if (!strcmp(integrity, "aead"))
auth_tag_size = 16; //FIXME gcm- mode only
auth_tag_size = 16; /* gcm- mode only */
else if (!strcmp(integrity, "cmac(aes)"))
auth_tag_size = 16;
else if (!strcmp(integrity, "hmac(sha1)"))

View File

@@ -298,7 +298,6 @@ static int _dm_check_versions(struct crypt_device *cd, dm_target_type target_typ
_dm_check_target(target_type);
/* FIXME: add support to DM so it forces crypt target module load here */
if (!(dmt = dm_task_create(DM_DEVICE_LIST_VERSIONS)))
goto out;
@@ -396,10 +395,7 @@ void dm_backend_exit(struct crypt_device *cd)
}
}
/*
* libdevmapper is not context friendly, switch context on every DM call.
* FIXME: this is not safe if called in parallel but neither is DM lib.
*/
/* libdevmapper is not context friendly, switch context on every DM call. */
static int dm_init_context(struct crypt_device *cd, dm_target_type target)
{
_context = cd;

View File

@@ -254,7 +254,6 @@ int LUKS2_digest_assign(struct crypt_device *cd, struct luks2_hdr *hdr,
if (r < 0)
return r;
// FIXME: do not write header in nothing changed
return commit ? LUKS2_hdr_write(cd, hdr) : 0;
}
@@ -349,7 +348,6 @@ int LUKS2_digest_segment_assign(struct crypt_device *cd, struct luks2_hdr *hdr,
if (r < 0)
return r;
// FIXME: do not write header in nothing changed
return commit ? LUKS2_hdr_write(cd, hdr) : 0;
}

View File

@@ -301,8 +301,6 @@ static int hdr_write_disk(struct crypt_device *cd,
log_dbg(cd, "Trying to write LUKS2 header (%zu bytes) at offset %" PRIu64 ".",
hdr->hdr_size, offset);
/* FIXME: read-only device silent fail? */
devfd = device_open_locked(cd, device, O_RDWR);
if (devfd < 0)
return devfd == -1 ? -EINVAL : devfd;

View File

@@ -30,7 +30,7 @@ struct area {
static size_t get_area_size(size_t keylength)
{
//FIXME: calculate this properly, for now it is AF_split_sectors
/* for now it is AF_split_sectors */
return size_round_up(keylength * 4000, 4096);
}
@@ -380,7 +380,6 @@ int LUKS2_wipe_header_areas(struct crypt_device *cd,
offset, length, wipe_block, NULL, NULL);
}
/* FIXME: what if user wanted to keep original keyslots size? */
int LUKS2_set_keyslots_size(struct crypt_device *cd __attribute__((unused)),
struct luks2_hdr *hdr,
uint64_t data_offset)

View File

@@ -607,7 +607,6 @@ int LUKS2_keyslot_reencrypt_create(struct crypt_device *cd,
if (keyslot == CRYPT_ANY_SLOT)
return -EINVAL;
/* FIXME: find keyslot by type */
h = LUKS2_keyslot_handler_type(cd, "reencrypt");
if (!h)
return -EINVAL;

View File

@@ -2882,7 +2882,7 @@ static int reencrypt_load_by_passphrase(struct crypt_device *cd,
}
device_release_excl(cd, crypt_data_device(cd));
/* FIXME: There's a race for dm device activation not managed by cryptsetup.
/* There's a race for dm device activation not managed by cryptsetup.
*
* 1) excl close
* 2) rogue dm device activation

View File

@@ -663,7 +663,6 @@ int LUKS2_token_assign(struct crypt_device *cd, struct luks2_hdr *hdr,
if (r < 0)
return r;
// FIXME: do not write header in nothing changed
if (commit)
return LUKS2_hdr_write(cd, hdr) ?: token;

View File

@@ -64,9 +64,6 @@ struct crypt_device {
bool memory_hard_pbkdf_lock_enabled;
struct crypt_lock_handle *pbkdf_memory_hard_lock;
// FIXME: private binary headers and access it properly
// through sub-library (LUKS1, TCRYPT)
union {
struct { /* used in CRYPT_LUKS1 */
struct luks_phdr hdr;
@@ -888,7 +885,6 @@ static int _crypt_load_verity(struct crypt_device *cd, struct crypt_params_verit
if (r < 0)
return r;
//FIXME: use crypt_free
if (!cd->type && !(cd->type = strdup(CRYPT_VERITY))) {
free(CONST_CAST(void*)cd->u.verity.hdr.hash_name);
free(CONST_CAST(void*)cd->u.verity.hdr.salt);
@@ -4644,7 +4640,7 @@ uint64_t crypt_get_active_integrity_failures(struct crypt_device *cd, const char
if (!name)
return 0;
/* FIXME: LUKS2 / dm-crypt does not provide this count. */
/* LUKS2 / dm-crypt does not provide this count. */
if (dm_query_device(cd, name, 0, &dmd) < 0)
return 0;

View File

@@ -100,8 +100,6 @@ int crypt_parse_integrity_mode(const char *s, char *integrity,
if (!s || !integrity)
return -EINVAL;
// FIXME: do not hardcode it here
/* AEAD modes */
if (!strcmp(s, "aead") ||
!strcmp(s, "poly1305") ||

View File

@@ -173,7 +173,7 @@ static int acquire_lock_handle(struct crypt_device *cd, struct device *device, s
h->u.bdev.devno = st.st_rdev;
h->mode = DEV_LOCK_BDEV;
} else if (S_ISREG(st.st_mode)) {
// FIXME: workaround for nfsv4
/* workaround for nfsv4 */
fd = open(device_path(device), O_RDWR | O_NONBLOCK | O_CLOEXEC);
if (fd < 0)
h->flock_fd = dev_fd;

View File

@@ -150,7 +150,7 @@ int crypt_wipe_device(struct crypt_device *cd,
if (!bsize || !alignment || !wipe_block_size)
return -EINVAL;
/* FIXME: if wipe_block_size < bsize, then a wipe is highly ineffective */
/* if wipe_block_size < bsize, then a wipe is highly ineffective */
/* Everything must be aligned to SECTOR_SIZE */
if (MISALIGNED_512(offset) || MISALIGNED_512(length) || MISALIGNED_512(wipe_block_size))

View File

@@ -387,7 +387,6 @@ static void tools_time_progress(uint64_t device_size, uint64_t bytes, struct too
mbytes = bytes / 1024 / 1024;
uib = (double)(bytes - parms->start_offset) / tdiff;
/* FIXME: calculate this from last minute only. */
eta = (unsigned long long)(device_size / uib - tdiff);
if (uib > 1073741824.0f) {