diff --git a/lib/internal.h b/lib/internal.h index 7540d20c..b0e49dac 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -222,8 +222,8 @@ int PLAIN_activate(struct crypt_device *cd, uint32_t flags); void *crypt_get_hdr(struct crypt_device *cd, const char *type); -void crypt_set_reenc_context(struct crypt_device *cd, struct luks2_reenc_context *rh); -struct luks2_reenc_context *crypt_get_reenc_context(struct crypt_device *cd); +void crypt_set_luks2_reencrypt(struct crypt_device *cd, struct luks2_reenc_context *rh); +struct luks2_reenc_context *crypt_get_luks2_reencrypt(struct crypt_device *cd); int onlyLUKS2(struct crypt_device *cd); int onlyLUKS2mask(struct crypt_device *cd, uint32_t mask); diff --git a/lib/luks2/luks2_disk_metadata.c b/lib/luks2/luks2_disk_metadata.c index 52eec160..3f6b3aeb 100644 --- a/lib/luks2/luks2_disk_metadata.c +++ b/lib/luks2/luks2_disk_metadata.c @@ -385,7 +385,7 @@ int LUKS2_device_write_lock(struct crypt_device *cd, struct luks2_hdr *hdr, stru } /* run sequence id check only on first write lock (r == 1) and w/o LUKS2 reencryption in-progress */ - if (r == 1 && !crypt_get_reenc_context(cd)) { + if (r == 1 && !crypt_get_luks2_reencrypt(cd)) { log_dbg(cd, "Checking context sequence id matches value stored on disk."); if (LUKS2_check_sequence_id(cd, hdr, device)) { device_write_unlock(cd, device); diff --git a/lib/luks2/luks2_reencrypt.c b/lib/luks2/luks2_reencrypt.c index cceddb4a..f0828be4 100644 --- a/lib/luks2/luks2_reencrypt.c +++ b/lib/luks2/luks2_reencrypt.c @@ -2789,10 +2789,10 @@ static int reencrypt_load_by_passphrase(struct crypt_device *cd, log_dbg(cd, "Loading LUKS2 reencryption context."); - rh = crypt_get_reenc_context(cd); + rh = crypt_get_luks2_reencrypt(cd); if (rh) { LUKS2_reencrypt_free(cd, rh); - crypt_set_reenc_context(cd, NULL); + crypt_set_luks2_reencrypt(cd, NULL); rh = NULL; } @@ -2930,7 +2930,7 @@ static int reencrypt_load_by_passphrase(struct crypt_device *cd, MOVE_REF(rh->vks, *vks); MOVE_REF(rh->reenc_lock, reencrypt_lock); - crypt_set_reenc_context(cd, rh); + crypt_set_luks2_reencrypt(cd, rh); return 0; err: @@ -3337,7 +3337,7 @@ static int reencrypt_teardown(struct crypt_device *cd, struct luks2_hdr *hdr, /* this frees reencryption lock */ LUKS2_reencrypt_free(cd, rh); - crypt_set_reenc_context(cd, NULL); + crypt_set_luks2_reencrypt(cd, NULL); return r; } @@ -3363,7 +3363,7 @@ int crypt_reencrypt(struct crypt_device *cd, return -EINVAL; } - rh = crypt_get_reenc_context(cd); + rh = crypt_get_luks2_reencrypt(cd); if (!rh || (!rh->reenc_lock && crypt_metadata_locking_enabled())) { log_err(cd, _("Missing or invalid reencrypt context.")); return -EINVAL; diff --git a/lib/setup.c b/lib/setup.c index 51bb892a..73ac3aa6 100644 --- a/lib/setup.c +++ b/lib/setup.c @@ -662,7 +662,7 @@ int crypt_set_data_device(struct crypt_device *cd, const char *device) return -EINVAL; } - if (isLUKS2(cd->type) && crypt_get_reenc_context(cd)) { + if (isLUKS2(cd->type) && crypt_get_luks2_reencrypt(cd)) { log_err(cd, _("Illegal operation with reencryption in-progress.")); return -EINVAL; } @@ -5533,13 +5533,13 @@ void *crypt_get_hdr(struct crypt_device *cd, const char *type) } /* internal only */ -struct luks2_reenc_context *crypt_get_reenc_context(struct crypt_device *cd) +struct luks2_reenc_context *crypt_get_luks2_reencrypt(struct crypt_device *cd) { return cd->u.luks2.rh; } /* internal only */ -void crypt_set_reenc_context(struct crypt_device *cd, struct luks2_reenc_context *rh) +void crypt_set_luks2_reencrypt(struct crypt_device *cd, struct luks2_reenc_context *rh) { cd->u.luks2.rh = rh; }