mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Better name routine verifying any available digest.
also drop unused parameter from internal routine.
This commit is contained in:
@@ -314,8 +314,7 @@ void crypt_token_unload_external_all(struct crypt_device *cd);
|
||||
/*
|
||||
* Generic LUKS2 digest
|
||||
*/
|
||||
int LUKS2_digest_any_matching(struct crypt_device *cd,
|
||||
struct luks2_hdr *hdr,
|
||||
int LUKS2_digest_verify_by_any_matching(struct crypt_device *cd,
|
||||
const struct volume_key *vk);
|
||||
|
||||
int LUKS2_digest_verify_by_segment(struct crypt_device *cd,
|
||||
|
||||
@@ -143,8 +143,7 @@ int LUKS2_digest_dump(struct crypt_device *cd, int digest)
|
||||
return h->dump(cd, digest);
|
||||
}
|
||||
|
||||
int LUKS2_digest_any_matching(struct crypt_device *cd,
|
||||
struct luks2_hdr *hdr __attribute__((unused)),
|
||||
int LUKS2_digest_verify_by_any_matching(struct crypt_device *cd,
|
||||
const struct volume_key *vk)
|
||||
{
|
||||
int digest;
|
||||
|
||||
@@ -5556,7 +5556,7 @@ static int _verify_key(struct crypt_device *cd,
|
||||
}
|
||||
|
||||
if (segment == CRYPT_ANY_SEGMENT)
|
||||
r = LUKS2_digest_any_matching(cd, &cd->u.luks2.hdr, vk);
|
||||
r = LUKS2_digest_verify_by_any_matching(cd, vk);
|
||||
else {
|
||||
r = LUKS2_digest_verify_by_segment(cd, &cd->u.luks2.hdr, segment, vk);
|
||||
if (r == -EPERM || r == -ENOENT)
|
||||
@@ -7525,7 +7525,7 @@ static int keyslot_add_by_key(struct crypt_device *cd,
|
||||
else {
|
||||
/* if key matches any existing digest, do not create new digest */
|
||||
if ((flags & CRYPT_VOLUME_KEY_DIGEST_REUSE))
|
||||
digest = LUKS2_digest_any_matching(cd, &cd->u.luks2.hdr, vk);
|
||||
digest = LUKS2_digest_verify_by_any_matching(cd, vk);
|
||||
|
||||
/* no segment flag or new vk flag requires new key digest */
|
||||
if (flags & (CRYPT_VOLUME_KEY_NO_SEGMENT | CRYPT_VOLUME_KEY_SET)) {
|
||||
|
||||
Reference in New Issue
Block a user