Skip to content

Commit d52f8e4

Browse files
MingcongBaiCAB233
authored andcommitted
perl-crypt-des: fix build with GCC >= 14
Track patches at AOSC-Tracking/perl-crypt-des @ aosc/v2.07 (HEAD: 242092cca4f5c0fca2cab67118dcde53f456081d).
1 parent d2d1a8e commit d52f8e4

File tree

3 files changed

+271
-0
lines changed

3 files changed

+271
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From 8840da3fd4375618cd51b44ea82ecd5f303c3531 Mon Sep 17 00:00:00 2001
2+
From: DJ Delorie <[email protected]>
3+
Date: Sun, 5 Oct 2025 17:16:21 +0800
4+
Subject: [PATCH 1/2] FEDORA: Fix C99 compatibility issue
5+
6+
Related to:
7+
8+
<https://fedoraproject.org/wiki/Changes/PortingToModernC>
9+
<https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
10+
11+
Bug reported to upstream tracker via email to [email protected]
12+
https://rt.cpan.org/Public/Dist/Display.html?Name=Crypt-DES
13+
14+
Link: https://src.fedoraproject.org/rpms/perl-Crypt-DES/blob/0a4557f6b118387730b895037e4a17c90f212e68/f/perl-Crypt-DES-fedora-c99.patch
15+
Signed-off-by: DJ Delorie <[email protected]>
16+
Signed-off-by: Mingcong Bai <[email protected]>
17+
---
18+
DES.xs | 5 +++--
19+
_des.h | 2 ++
20+
2 files changed, 5 insertions(+), 2 deletions(-)
21+
22+
diff --git a/DES.xs b/DES.xs
23+
index 68db703..b3d6c1a 100644
24+
--- a/DES.xs
25+
+++ b/DES.xs
26+
@@ -36,7 +36,7 @@ _des_expand_key(key)
27+
if (key_len != sizeof(des_user_key))
28+
croak("Invalid key");
29+
30+
- perl_des_expand_key((i8 *)key, ks);
31+
+ perl_des_expand_key((unsigned char *)key, ks);
32+
33+
ST(0) = sv_2mortal(newSVpv((char *)ks, sizeof(ks)));
34+
}
35+
@@ -66,7 +66,8 @@ _des_crypt(input, output, ks, enc_flag)
36+
37+
(SvUPGRADE(output, SVt_PV));
38+
39+
- perl_des_crypt(input, SvGROW(output, output_len), (i32 *)ks, enc_flag);
40+
+ perl_des_crypt((unsigned char *)input, (unsigned char *)SvGROW(output, output_len),
41+
+ (unsigned long *)ks, enc_flag);
42+
43+
SvCUR_set(output, output_len);
44+
*SvEND(output) = '\0';
45+
diff --git a/_des.h b/_des.h
46+
index ec56b27..ac0da94 100644
47+
--- a/_des.h
48+
+++ b/_des.h
49+
@@ -5,3 +5,5 @@ typedef unsigned long des_ks[32];
50+
void _des_crypt( des_cblock in, des_cblock out, des_ks key, int encrypt );
51+
void _des_expand_key( des_user_key userKey, des_ks key );
52+
53+
+void perl_des_expand_key(des_user_key userKey, des_ks ks);
54+
+void perl_des_crypt( des_cblock input, des_cblock output, des_ks ks, int encrypt );
55+
--
56+
2.51.0
57+
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
From 242092cca4f5c0fca2cab67118dcde53f456081d Mon Sep 17 00:00:00 2001
2+
From: Paul Howarth <[email protected]>
3+
Date: Sun, 5 Oct 2025 17:17:53 +0800
4+
Subject: [PATCH 2/2] FEDORA: Fix "warning: missing braces around initializer
5+
[-Wmissing-braces]"
6+
7+
Link: https://src.fedoraproject.org/rpms/perl-Crypt-DES/blob/4c6c9cc117e28e87b7679ba63a3a45b35597163f/f/perl-Crypt-DES-init-braces.patch
8+
Signed-off-by: Paul Howarth <[email protected]>
9+
Signed-off-by: Mingcong Bai <[email protected]>
10+
---
11+
_des.c | 65 +++++++++++++++++++++++++++++-----------------------------
12+
1 file changed, 33 insertions(+), 32 deletions(-)
13+
14+
diff --git a/_des.c b/_des.c
15+
index 1c6ede0..a97e122 100644
16+
--- a/_des.c
17+
+++ b/_des.c
18+
@@ -77,7 +77,7 @@
19+
20+
21+
unsigned long des_SPtrans_x[8][64]={
22+
-/* nibble 0 */
23+
+{ /* nibble 0 */
24+
0x00820200, 0x00020000, 0x80800000, 0x80820200,
25+
0x00800000, 0x80020200, 0x80020000, 0x80800000,
26+
0x80020200, 0x00820200, 0x00820000, 0x80000200,
27+
@@ -93,9 +93,9 @@ unsigned long des_SPtrans_x[8][64]={
28+
0x80820200, 0x00020200, 0x00820000, 0x80800200,
29+
0x00800000, 0x80000200, 0x80020000, 0x00000000,
30+
0x00020000, 0x00800000, 0x80800200, 0x00820200,
31+
-0x80000000, 0x80820000, 0x00000200, 0x80020200,
32+
+0x80000000, 0x80820000, 0x00000200, 0x80020200 },
33+
34+
-/* nibble 1 */
35+
+{ /* nibble 1 */
36+
0x10042004, 0x00000000, 0x00042000, 0x10040000,
37+
0x10000004, 0x00002004, 0x10002000, 0x00042000,
38+
0x00002000, 0x10040004, 0x00000004, 0x10002000,
39+
@@ -111,9 +111,9 @@ unsigned long des_SPtrans_x[8][64]={
40+
0x10042000, 0x00002000, 0x00000000, 0x10000004,
41+
0x00000004, 0x10042004, 0x00042000, 0x10040000,
42+
0x10040004, 0x00040000, 0x00002004, 0x10002000,
43+
-0x10002004, 0x00000004, 0x10040000, 0x00042000,
44+
+0x10002004, 0x00000004, 0x10040000, 0x00042000 },
45+
46+
-/* nibble 2 */
47+
+{ /* nibble 2 */
48+
0x41000000, 0x01010040, 0x00000040, 0x41000040,
49+
0x40010000, 0x01000000, 0x41000040, 0x00010040,
50+
0x01000040, 0x00010000, 0x01010000, 0x40000000,
51+
@@ -129,9 +129,9 @@ unsigned long des_SPtrans_x[8][64]={
52+
0x40010040, 0x41000000, 0x01000000, 0x41010040,
53+
0x00010000, 0x01000040, 0x41000040, 0x00010040,
54+
0x01000040, 0x00000000, 0x41010000, 0x40000040,
55+
-0x41000000, 0x40010040, 0x00000040, 0x01010000,
56+
+0x41000000, 0x40010040, 0x00000040, 0x01010000 },
57+
58+
-/* nibble 3 */
59+
+{ /* nibble 3 */
60+
0x00100402, 0x04000400, 0x00000002, 0x04100402,
61+
0x00000000, 0x04100000, 0x04000402, 0x00100002,
62+
0x04100400, 0x04000002, 0x04000000, 0x00000402,
63+
@@ -147,9 +147,9 @@ unsigned long des_SPtrans_x[8][64]={
64+
0x04000000, 0x04100402, 0x00100402, 0x00100000,
65+
0x04100402, 0x00000002, 0x04000400, 0x00100402,
66+
0x00100002, 0x00100400, 0x04100000, 0x04000402,
67+
-0x00000402, 0x04000000, 0x04000002, 0x04100400,
68+
+0x00000402, 0x04000000, 0x04000002, 0x04100400 },
69+
70+
-/* nibble 4 */
71+
+{ /* nibble 4 */
72+
0x02000000, 0x00004000, 0x00000100, 0x02004108,
73+
0x02004008, 0x02000100, 0x00004108, 0x02004000,
74+
0x00004000, 0x00000008, 0x02000008, 0x00004100,
75+
@@ -165,9 +165,9 @@ unsigned long des_SPtrans_x[8][64]={
76+
0x02000108, 0x00000100, 0x00000000, 0x02004108,
77+
0x02004008, 0x02004100, 0x00000108, 0x00004000,
78+
0x00004100, 0x02004008, 0x02000100, 0x00000108,
79+
-0x00000008, 0x00004108, 0x02004000, 0x02000008,
80+
+0x00000008, 0x00004108, 0x02004000, 0x02000008 },
81+
82+
-/* nibble 5 */
83+
+{ /* nibble 5 */
84+
0x20000010, 0x00080010, 0x00000000, 0x20080800,
85+
0x00080010, 0x00000800, 0x20000810, 0x00080000,
86+
0x00000810, 0x20080810, 0x00080800, 0x20000000,
87+
@@ -183,9 +183,9 @@ unsigned long des_SPtrans_x[8][64]={
88+
0x20080810, 0x00080800, 0x00080000, 0x20000810,
89+
0x20000010, 0x20080000, 0x00080810, 0x00000000,
90+
0x00000800, 0x20000010, 0x20000810, 0x20080800,
91+
-0x20080000, 0x00000810, 0x00000010, 0x20080010,
92+
+0x20080000, 0x00000810, 0x00000010, 0x20080010 },
93+
94+
-/* nibble 6 */
95+
+{ /* nibble 6 */
96+
0x00001000, 0x00000080, 0x00400080, 0x00400001,
97+
0x00401081, 0x00001001, 0x00001080, 0x00000000,
98+
0x00400000, 0x00400081, 0x00000081, 0x00401000,
99+
@@ -201,9 +201,9 @@ unsigned long des_SPtrans_x[8][64]={
100+
0x00000000, 0x00400081, 0x00400080, 0x00001080,
101+
0x00000081, 0x00001000, 0x00401081, 0x00400000,
102+
0x00401080, 0x00000001, 0x00001001, 0x00401081,
103+
-0x00400001, 0x00401080, 0x00401000, 0x00001001,
104+
+0x00400001, 0x00401080, 0x00401000, 0x00001001 },
105+
106+
-/* nibble 7 */
107+
+{ /* nibble 7 */
108+
0x08200020, 0x08208000, 0x00008020, 0x00000000,
109+
0x08008000, 0x00200020, 0x08200000, 0x08208020,
110+
0x00000020, 0x08000000, 0x00208000, 0x00008020,
111+
@@ -219,10 +219,11 @@ unsigned long des_SPtrans_x[8][64]={
112+
0x08208020, 0x00200000, 0x08200000, 0x08000020,
113+
0x00208000, 0x00008020, 0x08008020, 0x08200000,
114+
0x00000020, 0x08208000, 0x00208020, 0x00000000,
115+
-0x08000000, 0x08200020, 0x00008000, 0x00208020};
116+
+0x08000000, 0x08200020, 0x00008000, 0x00208020 }
117+
+};
118+
119+
unsigned long des_skb[8][64]={
120+
-/* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
121+
+{ /* for C bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
122+
0x00000000,0x00000010,0x20000000,0x20000010,
123+
0x00010000,0x00010010,0x20010000,0x20010010,
124+
0x00000800,0x00000810,0x20000800,0x20000810,
125+
@@ -238,8 +239,8 @@ unsigned long des_skb[8][64]={
126+
0x00080020,0x00080030,0x20080020,0x20080030,
127+
0x00090020,0x00090030,0x20090020,0x20090030,
128+
0x00080820,0x00080830,0x20080820,0x20080830,
129+
-0x00090820,0x00090830,0x20090820,0x20090830,
130+
-/* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */
131+
+0x00090820,0x00090830,0x20090820,0x20090830 },
132+
+{ /* for C bits (numbered as per FIPS 46) 7 8 10 11 12 13 */
133+
0x00000000,0x02000000,0x00002000,0x02002000,
134+
0x00200000,0x02200000,0x00202000,0x02202000,
135+
0x00000004,0x02000004,0x00002004,0x02002004,
136+
@@ -255,8 +256,8 @@ unsigned long des_skb[8][64]={
137+
0x10000400,0x12000400,0x10002400,0x12002400,
138+
0x10200400,0x12200400,0x10202400,0x12202400,
139+
0x10000404,0x12000404,0x10002404,0x12002404,
140+
-0x10200404,0x12200404,0x10202404,0x12202404,
141+
-/* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */
142+
+0x10200404,0x12200404,0x10202404,0x12202404 },
143+
+{ /* for C bits (numbered as per FIPS 46) 14 15 16 17 19 20 */
144+
0x00000000,0x00000001,0x00040000,0x00040001,
145+
0x01000000,0x01000001,0x01040000,0x01040001,
146+
0x00000002,0x00000003,0x00040002,0x00040003,
147+
@@ -272,8 +273,8 @@ unsigned long des_skb[8][64]={
148+
0x08000200,0x08000201,0x08040200,0x08040201,
149+
0x09000200,0x09000201,0x09040200,0x09040201,
150+
0x08000202,0x08000203,0x08040202,0x08040203,
151+
-0x09000202,0x09000203,0x09040202,0x09040203,
152+
-/* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */
153+
+0x09000202,0x09000203,0x09040202,0x09040203 },
154+
+{ /* for C bits (numbered as per FIPS 46) 21 23 24 26 27 28 */
155+
0x00000000,0x00100000,0x00000100,0x00100100,
156+
0x00000008,0x00100008,0x00000108,0x00100108,
157+
0x00001000,0x00101000,0x00001100,0x00101100,
158+
@@ -289,8 +290,8 @@ unsigned long des_skb[8][64]={
159+
0x04020000,0x04120000,0x04020100,0x04120100,
160+
0x04020008,0x04120008,0x04020108,0x04120108,
161+
0x04021000,0x04121000,0x04021100,0x04121100,
162+
-0x04021008,0x04121008,0x04021108,0x04121108,
163+
-/* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
164+
+0x04021008,0x04121008,0x04021108,0x04121108 },
165+
+{ /* for D bits (numbered as per FIPS 46) 1 2 3 4 5 6 */
166+
0x00000000,0x10000000,0x00010000,0x10010000,
167+
0x00000004,0x10000004,0x00010004,0x10010004,
168+
0x20000000,0x30000000,0x20010000,0x30010000,
169+
@@ -306,8 +307,8 @@ unsigned long des_skb[8][64]={
170+
0x00101000,0x10101000,0x00111000,0x10111000,
171+
0x00101004,0x10101004,0x00111004,0x10111004,
172+
0x20101000,0x30101000,0x20111000,0x30111000,
173+
-0x20101004,0x30101004,0x20111004,0x30111004,
174+
-/* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */
175+
+0x20101004,0x30101004,0x20111004,0x30111004 },
176+
+{ /* for D bits (numbered as per FIPS 46) 8 9 11 12 13 14 */
177+
0x00000000,0x08000000,0x00000008,0x08000008,
178+
0x00000400,0x08000400,0x00000408,0x08000408,
179+
0x00020000,0x08020000,0x00020008,0x08020008,
180+
@@ -323,8 +324,8 @@ unsigned long des_skb[8][64]={
181+
0x02000001,0x0A000001,0x02000009,0x0A000009,
182+
0x02000401,0x0A000401,0x02000409,0x0A000409,
183+
0x02020001,0x0A020001,0x02020009,0x0A020009,
184+
-0x02020401,0x0A020401,0x02020409,0x0A020409,
185+
-/* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */
186+
+0x02020401,0x0A020401,0x02020409,0x0A020409 },
187+
+{ /* for D bits (numbered as per FIPS 46) 16 17 18 19 20 21 */
188+
0x00000000,0x00000100,0x00080000,0x00080100,
189+
0x01000000,0x01000100,0x01080000,0x01080100,
190+
0x00000010,0x00000110,0x00080010,0x00080110,
191+
@@ -340,8 +341,8 @@ unsigned long des_skb[8][64]={
192+
0x00200200,0x00200300,0x00280200,0x00280300,
193+
0x01200200,0x01200300,0x01280200,0x01280300,
194+
0x00200210,0x00200310,0x00280210,0x00280310,
195+
-0x01200210,0x01200310,0x01280210,0x01280310,
196+
-/* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */
197+
+0x01200210,0x01200310,0x01280210,0x01280310 },
198+
+{ /* for D bits (numbered as per FIPS 46) 22 23 24 25 27 28 */
199+
0x00000000,0x04000000,0x00040000,0x04040000,
200+
0x00000002,0x04000002,0x00040002,0x04040002,
201+
0x00002000,0x04002000,0x00042000,0x04042000,
202+
@@ -357,7 +358,7 @@ unsigned long des_skb[8][64]={
203+
0x00000820,0x04000820,0x00040820,0x04040820,
204+
0x00000822,0x04000822,0x00040822,0x04040822,
205+
0x00002820,0x04002820,0x00042820,0x04042820,
206+
-0x00002822,0x04002822,0x00042822,0x04042822,
207+
+0x00002822,0x04002822,0x00042822,0x04042822 }
208+
};
209+
210+
211+
--
212+
2.51.0
213+

lang-perl/perl-crypt-des/spec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
VER=2.07
2+
REL=1
23
SRCS="tbl::https://cpan.metacpan.org/authors/id/D/DP/DPARIS/Crypt-DES-$VER.tar.gz"
34
CHKSUMS="sha256::2db1ebb5837b4cb20051c0ee5b733b4453e3137df0a92306034c867621edd7e7"
45
CHKUPDATE="anitya::id=6724"

0 commit comments

Comments
 (0)