Arne de Bruijn f7f708dc7b community/libmcrypt: fix build with gcc-15
Fix prototypes in des.c/tripledes.c and fix call with array argument.

Ref #17311
2025-08-07 09:27:40 +00:00

50 lines
1.6 KiB
Diff

diff --git a/modules/algorithms/des.c b/modules/algorithms/des.c
index 5810811..2ce51a8 100644
--- a/modules/algorithms/des.c
+++ b/modules/algorithms/des.c
@@ -35,9 +35,12 @@
/* #define NULL 0 */
-static void permute_ip(), permute_fp(), perminit_ip(), spinit(),
-perminit_fp();
-static word32 f();
+static void permute_ip(char *inblock, DES_KEY * key, char *outblock);
+static void permute_fp(char *inblock, DES_KEY * key, char *outblock);
+static void perminit_ip(DES_KEY * key);
+static void spinit(DES_KEY * key);
+static void perminit_fp(DES_KEY * key);
+static word32 f(DES_KEY * key, register word32 r, register char *subkey);
/* Tables defined in the Data Encryption Standard documents */
diff --git a/modules/algorithms/tripledes.c b/modules/algorithms/tripledes.c
index 7b3c324..8a8d8a7 100644
--- a/modules/algorithms/tripledes.c
+++ b/modules/algorithms/tripledes.c
@@ -36,8 +36,11 @@
/* #define NULL 0 */
-static void permute(), perminit(), spinit();
-static word32 f();
+static void permute(char *inblock, char perm[16][16][8], char *outblock);
+static void perminit(char perm[16][16][8], char p[64]);
+static void spinit(TRIPLEDES_KEY * key, int pos);
+static word32 f(TRIPLEDES_KEY * key, int pos, register word32 r,
+ register char *subkey);
/* Tables defined in the Data Encryption Standard documents */
@@ -199,8 +202,8 @@ static int _mcrypt_desinit(TRIPLEDES_KEY * key)
spinit(key, 0);
spinit(key, 1);
spinit(key, 2);
- perminit(&key->iperm, ip);
- perminit(&key->fperm, fp);
+ perminit(key->iperm, ip);
+ perminit(key->fperm, fp);
return 0;