efi_loader: pass GUID by address
PATCH 1/1 efi_loader: pass GUID by address
Instead of passing a GUID by value to the hash_algo_supported() function, prefer passing a pointer.
--- lib/efi_loader/efi_signature.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/efi_loader/efi_signature.c +3 -3
@@ -166,7 +166,7 @@ bool efi_hash_regions(struct image_region *regs, int count,* * Return: true if supported false otherwise */ -static bool hash_algo_supported (const efi_guid_t guid) +static bool hash_algo_supported (const efi_guid_t *guid) {int i;const efi_guid_t unsupported_hashes[] = {
@@ -177,7 +177,7 @@ static bool hash_algo_supported(const efi_guid_t guid) };for (i =0 ; i <ARRAY_SIZE (unsupported_hashes); i++) { -if (!guidcmp (&unsupported_hashes[i], &guid)) +if (!guidcmp (&unsupported_hashes[i], guid))return false; }
@@ -219,7 +219,7 @@ bool efi_signature_lookup_digest(struct efi_image_regions *regs,* if the hash algorithm is unsupported and we get an entry in * dbx reject the image */ -if (dbx && !hash_algo_supported (siglist->sig_type)) { +if (dbx && !hash_algo_supported (&siglist->sig_type)) { found = true;continue ; };
---
base-commit: 509312dc5386ff4c5adabf53a573abca0aac4ce5
change-id: 20260907-guidptr-9865d0f0dd1b
Best regards,
Signature · 1 line
Vincent.
Quoted 7 lines · Vincent Stehlé
Instead of passing a GUID by value to the
hash_algo_supported()function, prefer passing a pointer.Signed-off-by Vincent Stehlé <[email protected]>Cc Heinrich Schuchardt <[email protected]>Cc Ilias Apalodimas <[email protected]>Cc Tom Rini <[email protected]>
Yes, GUIDs should be passed via pointers.
Quoted 44 lines
--- lib/efi_loader/efi_signature.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lib/efi_loader/efi_signature.c +3
-4@@ -166,7 +166,7 @@ bool efi_hash_regions(struct image_region *regs, int count,* * Return: true if supported false otherwise */ -static bool hash_algo_supported (const efi_guid_t guid) +static bool hash_algo_supported (const efi_guid_t *guid) {int i;const efi_guid_t unsupported_hashes[] = {@@ -177,7 +177,7 @@ static bool hash_algo_supported(const efi_guid_t guid) };for (i =0 ; i <ARRAY_SIZE (unsupported_hashes); i++) { -if (!guidcmp (&unsupported_hashes[i], &guid)) +if (!guidcmp (&unsupported_hashes[i], guid))return false; }@@ -219,7 +219,7 @@ bool efi_signature_lookup_digest(struct efi_image_regions *regs,* if the hash algorithm is unsupported and we get an entry in * dbx reject the image */ -if (dbx && !hash_algo_supported (siglist->sig_type)) { +if (dbx && !hash_algo_supported (&siglist->sig_type)) { found = true;continue ; }; ---base-commit:
509312dc5386ff4c5adabf53a573abca0aac4ce5
change-id: 20260907-guidptr-9865d0f0dd1bBest regards,
--
Vincent.
Quoted 9 lines · Vincent Stehlé
Instead of passing a GUID by value to the
hash_algo_supported()function, prefer passing a pointer.Signed-off-by Vincent Stehlé <[email protected]>Cc Heinrich Schuchardt <[email protected]>Cc Ilias Apalodimas <[email protected]>Cc Tom Rini <[email protected]>---
Quoted 48 lines
lib/efi_loader/efi_signature.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lib/efi_loader/efi_signature.c +1
-1@@ -166,7 +166,7 @@ bool efi_hash_regions(struct image_region *regs, intcount, * * Return: true if supported false otherwise */ -static bool hash_algo_supported (const efi_guid_t guid) +static bool hash_algo_supported (const efi_guid_t *guid) {int i;const efi_guid_t unsupported_hashes[] = {lib/efi_loader/efi_signature.c +1
-1@@ -177,7 +177,7 @@ static bool hash_algo_supported(const efi_guid_t guid) };for (i =0 ; i <ARRAY_SIZE (unsupported_hashes); i++) { -if (!guidcmp (&unsupported_hashes[i], &guid)) +if (!guidcmp (&unsupported_hashes[i], guid))return false; }@@ -219,7 +219,7 @@ bool efi_signature_lookup_digest(structefi_image_regions *regs, * if the hash algorithm is unsupported and we get anentry in
* dbx reject the image
*/lib/efi_loader/efi_signature.c +1
-2-if (dbx && !hash_algo_supported (siglist->sig_type)) { +if (dbx && !hash_algo_supported (&siglist->sig_type)) { found = true;continue ; }; ---base-commit:
509312dc5386ff4c5adabf53a573abca0aac4ce5
change-id: 20260907-guidptr-9865d0f0dd1bBest regards,
--
Vincent.