]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
loader.c: Minor module key check simplification.
authorSean Bright <sean@seanbright.com>
Thu, 23 Mar 2023 15:08:15 +0000 (11:08 -0400)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Mon, 3 Apr 2023 12:11:36 +0000 (07:11 -0500)
Change-Id: I65aefd4434a783096165c179b5f94f2e4810dffe

main/loader.c

index 208e5a2c6f18f5606f93621c41414584f07c6a41..1c06d6e648f940a7ef1490ae6738822a37f209e1 100644 (file)
@@ -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)
 {