From 6dab013e4991d604146e15f67554b6c1e22c4acc Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Thu, 23 Mar 2023 11:08:15 -0400 Subject: [PATCH] loader.c: Minor module key check simplification. Change-Id: I65aefd4434a783096165c179b5f94f2e4810dffe --- main/loader.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/main/loader.c b/main/loader.c index 208e5a2c6f..1c06d6e648 100644 --- a/main/loader.c +++ b/main/loader.c @@ -885,17 +885,7 @@ static int printdigest(const unsigned char *d) return 0; } -static int key_matches(const unsigned char *key1, const unsigned char *key2) -{ - int x; - - for (x = 0; x < 16; x++) { - if (key1[x] != key2[x]) - return 0; - } - - return 1; -} +#define key_matches(a, b) (memcmp((a), (b), 16) == 0) static int verify_key(const unsigned char *key) {