aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2024-02-24 09:34:05 -0700
committerTheo Buehler <tb@openbsd.org>2024-02-24 10:39:06 -0700
commit2548f2479d96f0a3d67ca01f9759bedb69163e13 (patch)
tree7101225d651c7a953f6cd5ca8cc87e506362e783
parent9394a1b775f60d69c3996252a995852358bae31b (diff)
downloadportable-2548f2479d96f0a3d67ca01f9759bedb69163e13.tar.gz
portable-2548f2479d96f0a3d67ca01f9759bedb69163e13.tar.bz2
portable-2548f2479d96f0a3d67ca01f9759bedb69163e13.zip
The endbr64.patch is now upstream
-rw-r--r--patches/asm/endbr64.patch1215
1 files changed, 0 insertions, 1215 deletions
diff --git a/patches/asm/endbr64.patch b/patches/asm/endbr64.patch
deleted file mode 100644
index 05cf0eb..0000000
--- a/patches/asm/endbr64.patch
+++ /dev/null
@@ -1,1215 +0,0 @@
1Replace uses of endbr64 with _CET_ENDBR from cet.h
2
3cet.h is needed for other platforms to emit the relevant .gnu.properties
4sections that are necessary for them to enable IBT. It also avoids issues
5with older toolchains on macOS that explode on encountering endbr64.
6
7based on a diff by kettenis
8ok beck kettenis tb
9
10Index: x86_64cpuid.pl
11===================================================================
12RCS file: /cvs/src/lib/libcrypto/x86_64cpuid.pl,v
13diff -u -p -r1.15 x86_64cpuid.pl
14--- x86_64cpuid.pl 25 Apr 2023 04:42:25 -0000 1.15
15+++ x86_64cpuid.pl 3 Dec 2023 20:18:30 -0000
16@@ -18,7 +18,7 @@ print<<___;
17 .extern OPENSSL_cpuid_setup
18 .hidden OPENSSL_cpuid_setup
19 .section .init
20- endbr64
21+ _CET_ENDBR
22 call OPENSSL_cpuid_setup
23
24 .extern OPENSSL_ia32cap_P
25@@ -30,7 +30,7 @@ print<<___;
26 .type OPENSSL_ia32_cpuid,\@abi-omnipotent
27 .align 16
28 OPENSSL_ia32_cpuid:
29- endbr64
30+ _CET_ENDBR
31 mov %rbx,%r8 # save %rbx
32
33 xor %eax,%eax
34Index: aes/asm/aes-x86_64.pl
35===================================================================
36RCS file: /cvs/src/lib/libcrypto/aes/asm/aes-x86_64.pl,v
37diff -u -p -r1.12 aes-x86_64.pl
38--- aes/asm/aes-x86_64.pl 25 Apr 2023 04:42:25 -0000 1.12
39+++ aes/asm/aes-x86_64.pl 3 Dec 2023 20:18:30 -0000
40@@ -318,7 +318,7 @@ $code.=<<___;
41 .type _x86_64_AES_encrypt,\@abi-omnipotent
42 .align 16
43 _x86_64_AES_encrypt:
44- endbr64
45+ _CET_ENDBR
46 xor 0($key),$s0 # xor with key
47 xor 4($key),$s1
48 xor 8($key),$s2
49@@ -549,7 +549,7 @@ $code.=<<___;
50 .type _x86_64_AES_encrypt_compact,\@abi-omnipotent
51 .align 16
52 _x86_64_AES_encrypt_compact:
53- endbr64
54+ _CET_ENDBR
55 lea 128($sbox),$inp # size optimization
56 mov 0-128($inp),$acc1 # prefetch Te4
57 mov 32-128($inp),$acc2
58@@ -595,7 +595,7 @@ $code.=<<___;
59 .hidden asm_AES_encrypt
60 asm_AES_encrypt:
61 AES_encrypt:
62- endbr64
63+ _CET_ENDBR
64 push %rbx
65 push %rbp
66 push %r12
67@@ -887,7 +887,7 @@ $code.=<<___;
68 .type _x86_64_AES_decrypt,\@abi-omnipotent
69 .align 16
70 _x86_64_AES_decrypt:
71- endbr64
72+ _CET_ENDBR
73 xor 0($key),$s0 # xor with key
74 xor 4($key),$s1
75 xor 8($key),$s2
76@@ -1142,7 +1142,7 @@ $code.=<<___;
77 .type _x86_64_AES_decrypt_compact,\@abi-omnipotent
78 .align 16
79 _x86_64_AES_decrypt_compact:
80- endbr64
81+ _CET_ENDBR
82 lea 128($sbox),$inp # size optimization
83 mov 0-128($inp),$acc1 # prefetch Td4
84 mov 32-128($inp),$acc2
85@@ -1197,7 +1197,7 @@ $code.=<<___;
86 .hidden asm_AES_decrypt
87 asm_AES_decrypt:
88 AES_decrypt:
89- endbr64
90+ _CET_ENDBR
91 push %rbx
92 push %rbp
93 push %r12
94@@ -1297,7 +1297,7 @@ $code.=<<___;
95 .type AES_set_encrypt_key,\@function,3
96 .align 16
97 AES_set_encrypt_key:
98- endbr64
99+ _CET_ENDBR
100 push %rbx
101 push %rbp
102 push %r12 # redundant, but allows to share
103@@ -1323,7 +1323,7 @@ AES_set_encrypt_key:
104 .type _x86_64_AES_set_encrypt_key,\@abi-omnipotent
105 .align 16
106 _x86_64_AES_set_encrypt_key:
107- endbr64
108+ _CET_ENDBR
109 mov %esi,%ecx # %ecx=bits
110 mov %rdi,%rsi # %rsi=userKey
111 mov %rdx,%rdi # %rdi=key
112@@ -1569,7 +1569,7 @@ $code.=<<___;
113 .type AES_set_decrypt_key,\@function,3
114 .align 16
115 AES_set_decrypt_key:
116- endbr64
117+ _CET_ENDBR
118 push %rbx
119 push %rbp
120 push %r12
121@@ -1669,7 +1669,7 @@ $code.=<<___;
122 .hidden asm_AES_cbc_encrypt
123 asm_AES_cbc_encrypt:
124 AES_cbc_encrypt:
125- endbr64
126+ _CET_ENDBR
127 cmp \$0,%rdx # check length
128 je .Lcbc_epilogue
129 pushfq
130@@ -2561,7 +2561,7 @@ $code.=<<___;
131 .type block_se_handler,\@abi-omnipotent
132 .align 16
133 block_se_handler:
134- endbr64
135+ _CET_ENDBR
136 push %rsi
137 push %rdi
138 push %rbx
139@@ -2620,7 +2620,7 @@ block_se_handler:
140 .type key_se_handler,\@abi-omnipotent
141 .align 16
142 key_se_handler:
143- endbr64
144+ _CET_ENDBR
145 push %rsi
146 push %rdi
147 push %rbx
148@@ -2678,7 +2678,7 @@ key_se_handler:
149 .type cbc_se_handler,\@abi-omnipotent
150 .align 16
151 cbc_se_handler:
152- endbr64
153+ _CET_ENDBR
154 push %rsi
155 push %rdi
156 push %rbx
157Index: aes/asm/aesni-sha1-x86_64.pl
158===================================================================
159RCS file: /cvs/src/lib/libcrypto/aes/asm/aesni-sha1-x86_64.pl,v
160diff -u -p -r1.8 aesni-sha1-x86_64.pl
161--- aes/asm/aesni-sha1-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.8
162+++ aes/asm/aesni-sha1-x86_64.pl 3 Dec 2023 20:18:30 -0000
163@@ -89,7 +89,7 @@ $code.=<<___;
164 .type aesni_cbc_sha1_enc,\@abi-omnipotent
165 .align 16
166 aesni_cbc_sha1_enc:
167- endbr64
168+ _CET_ENDBR
169 # caller should check for SSSE3 and AES-NI bits
170 mov OPENSSL_ia32cap_P+0(%rip),%r10d
171 mov OPENSSL_ia32cap_P+4(%rip),%r11d
172@@ -133,7 +133,7 @@ $code.=<<___;
173 .type aesni_cbc_sha1_enc_ssse3,\@function,6
174 .align 16
175 aesni_cbc_sha1_enc_ssse3:
176- endbr64
177+ _CET_ENDBR
178 mov `($win64?56:8)`(%rsp),$inp # load 7th argument
179 #shr \$6,$len # debugging artefact
180 #jz .Lepilogue_ssse3 # debugging artefact
181@@ -652,7 +652,7 @@ $code.=<<___;
182 .type aesni_cbc_sha1_enc_avx,\@function,6
183 .align 16
184 aesni_cbc_sha1_enc_avx:
185- endbr64
186+ _CET_ENDBR
187 mov `($win64?56:8)`(%rsp),$inp # load 7th argument
188 #shr \$6,$len # debugging artefact
189 #jz .Lepilogue_avx # debugging artefact
190@@ -1103,7 +1103,7 @@ $code.=<<___;
191 .type ssse3_handler,\@abi-omnipotent
192 .align 16
193 ssse3_handler:
194- endbr64
195+ _CET_ENDBR
196 push %rsi
197 push %rdi
198 push %rbx
199Index: aes/asm/aesni-x86_64.pl
200===================================================================
201RCS file: /cvs/src/lib/libcrypto/aes/asm/aesni-x86_64.pl,v
202diff -u -p -r1.12 aesni-x86_64.pl
203--- aes/asm/aesni-x86_64.pl 18 Sep 2023 22:38:16 -0000 1.12
204+++ aes/asm/aesni-x86_64.pl 3 Dec 2023 20:18:30 -0000
205@@ -242,7 +242,7 @@ $code.=<<___;
206 .type ${PREFIX}_encrypt,\@abi-omnipotent
207 .align 16
208 ${PREFIX}_encrypt:
209- endbr64
210+ _CET_ENDBR
211 movups ($inp),$inout0 # load input
212 mov 240($key),$rounds # key->rounds
213 ___
214@@ -256,7 +256,7 @@ $code.=<<___;
215 .type ${PREFIX}_decrypt,\@abi-omnipotent
216 .align 16
217 ${PREFIX}_decrypt:
218- endbr64
219+ _CET_ENDBR
220 movups ($inp),$inout0 # load input
221 mov 240($key),$rounds # key->rounds
222 ___
223@@ -286,7 +286,7 @@ $code.=<<___;
224 .type _aesni_${dir}rypt3,\@abi-omnipotent
225 .align 16
226 _aesni_${dir}rypt3:
227- endbr64
228+ _CET_ENDBR
229 $movkey ($key),$rndkey0
230 shr \$1,$rounds
231 $movkey 16($key),$rndkey1
232@@ -331,7 +331,7 @@ $code.=<<___;
233 .type _aesni_${dir}rypt4,\@abi-omnipotent
234 .align 16
235 _aesni_${dir}rypt4:
236- endbr64
237+ _CET_ENDBR
238 $movkey ($key),$rndkey0
239 shr \$1,$rounds
240 $movkey 16($key),$rndkey1
241@@ -377,7 +377,7 @@ $code.=<<___;
242 .type _aesni_${dir}rypt6,\@abi-omnipotent
243 .align 16
244 _aesni_${dir}rypt6:
245- endbr64
246+ _CET_ENDBR
247 $movkey ($key),$rndkey0
248 shr \$1,$rounds
249 $movkey 16($key),$rndkey1
250@@ -442,7 +442,7 @@ $code.=<<___;
251 .type _aesni_${dir}rypt8,\@abi-omnipotent
252 .align 16
253 _aesni_${dir}rypt8:
254- endbr64
255+ _CET_ENDBR
256 $movkey ($key),$rndkey0
257 shr \$1,$rounds
258 $movkey 16($key),$rndkey1
259@@ -531,7 +531,7 @@ $code.=<<___;
260 .type aesni_ecb_encrypt,\@function,5
261 .align 16
262 aesni_ecb_encrypt:
263- endbr64
264+ _CET_ENDBR
265 and \$-16,$len
266 jz .Lecb_ret
267
268@@ -837,7 +837,7 @@ $code.=<<___;
269 .type aesni_ccm64_encrypt_blocks,\@function,6
270 .align 16
271 aesni_ccm64_encrypt_blocks:
272- endbr64
273+ _CET_ENDBR
274 ___
275 $code.=<<___ if ($win64);
276 lea -0x58(%rsp),%rsp
277@@ -1025,7 +1025,7 @@ $code.=<<___;
278 .type aesni_ctr32_encrypt_blocks,\@function,5
279 .align 16
280 aesni_ctr32_encrypt_blocks:
281- endbr64
282+ _CET_ENDBR
283 lea (%rsp),%rax
284 push %rbp
285 sub \$$frame_size,%rsp
286@@ -2487,7 +2487,7 @@ $code.=<<___;
287 .type ${PREFIX}_set_decrypt_key,\@abi-omnipotent
288 .align 16
289 ${PREFIX}_set_decrypt_key:
290- endbr64
291+ _CET_ENDBR
292 sub \$8,%rsp
293 call __aesni_set_encrypt_key
294 shl \$4,$bits # rounds-1 after _aesni_set_encrypt_key
295@@ -2538,7 +2538,7 @@ $code.=<<___;
296 .type ${PREFIX}_set_encrypt_key,\@abi-omnipotent
297 .align 16
298 ${PREFIX}_set_encrypt_key:
299- endbr64
300+ _CET_ENDBR
301 __aesni_set_encrypt_key:
302 sub \$8,%rsp
303 mov \$-1,%rax
304@@ -2760,7 +2760,7 @@ $code.=<<___ if ($PREFIX eq "aesni");
305 .type ecb_se_handler,\@abi-omnipotent
306 .align 16
307 ecb_se_handler:
308- endbr64
309+ _CET_ENDBR
310 push %rsi
311 push %rdi
312 push %rbx
313@@ -2780,7 +2780,7 @@ ecb_se_handler:
314 .type ccm64_se_handler,\@abi-omnipotent
315 .align 16
316 ccm64_se_handler:
317- endbr64
318+ _CET_ENDBR
319 push %rsi
320 push %rdi
321 push %rbx
322@@ -2822,7 +2822,7 @@ ccm64_se_handler:
323 .type ctr32_se_handler,\@abi-omnipotent
324 .align 16
325 ctr32_se_handler:
326- endbr64
327+ _CET_ENDBR
328 push %rsi
329 push %rdi
330 push %rbx
331@@ -2858,7 +2858,7 @@ ctr32_se_handler:
332 .type xts_se_handler,\@abi-omnipotent
333 .align 16
334 xts_se_handler:
335- endbr64
336+ _CET_ENDBR
337 push %rsi
338 push %rdi
339 push %rbx
340@@ -2900,7 +2900,7 @@ $code.=<<___;
341 .type cbc_se_handler,\@abi-omnipotent
342 .align 16
343 cbc_se_handler:
344- endbr64
345+ _CET_ENDBR
346 push %rsi
347 push %rdi
348 push %rbx
349Index: aes/asm/bsaes-x86_64.pl
350===================================================================
351RCS file: /cvs/src/lib/libcrypto/aes/asm/bsaes-x86_64.pl,v
352diff -u -p -r1.6 bsaes-x86_64.pl
353--- aes/asm/bsaes-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.6
354+++ aes/asm/bsaes-x86_64.pl 3 Dec 2023 20:18:30 -0000
355@@ -813,7 +813,7 @@ $code.=<<___;
356 .type _bsaes_encrypt8,\@abi-omnipotent
357 .align 64
358 _bsaes_encrypt8:
359- endbr64
360+ _CET_ENDBR
361 lea .LBS0(%rip), $const # constants table
362
363 movdqa ($key), @XMM[9] # round 0 key
364@@ -878,7 +878,7 @@ $code.=<<___;
365 .type _bsaes_decrypt8,\@abi-omnipotent
366 .align 64
367 _bsaes_decrypt8:
368- endbr64
369+ _CET_ENDBR
370 lea .LBS0(%rip), $const # constants table
371
372 movdqa ($key), @XMM[9] # round 0 key
373@@ -970,7 +970,7 @@ $code.=<<___;
374 .type _bsaes_key_convert,\@abi-omnipotent
375 .align 16
376 _bsaes_key_convert:
377- endbr64
378+ _CET_ENDBR
379 lea .Lmasks(%rip), $const
380 movdqu ($inp), %xmm7 # load round 0 key
381 lea 0x10($inp), $inp
382@@ -1060,7 +1060,7 @@ $code.=<<___;
383 .type bsaes_enc_key_convert,\@function,2
384 .align 16
385 bsaes_enc_key_convert:
386- endbr64
387+ _CET_ENDBR
388 mov 240($inp),%r10d # pass rounds
389 mov $inp,%rcx # pass key
390 mov $out,%rax # pass key schedule
391@@ -1075,7 +1075,7 @@ bsaes_enc_key_convert:
392 .align 16
393 bsaes_encrypt_128:
394 .Lenc128_loop:
395- endbr64
396+ _CET_ENDBR
397 movdqu 0x00($inp), @XMM[0] # load input
398 movdqu 0x10($inp), @XMM[1]
399 movdqu 0x20($inp), @XMM[2]
400@@ -1108,7 +1108,7 @@ bsaes_encrypt_128:
401 .type bsaes_dec_key_convert,\@function,2
402 .align 16
403 bsaes_dec_key_convert:
404- endbr64
405+ _CET_ENDBR
406 mov 240($inp),%r10d # pass rounds
407 mov $inp,%rcx # pass key
408 mov $out,%rax # pass key schedule
409@@ -1123,7 +1123,7 @@ bsaes_dec_key_convert:
410 .type bsaes_decrypt_128,\@function,4
411 .align 16
412 bsaes_decrypt_128:
413- endbr64
414+ _CET_ENDBR
415 .Ldec128_loop:
416 movdqu 0x00($inp), @XMM[0] # load input
417 movdqu 0x10($inp), @XMM[1]
418@@ -1169,7 +1169,7 @@ $code.=<<___;
419 .type bsaes_ecb_encrypt_blocks,\@abi-omnipotent
420 .align 16
421 bsaes_ecb_encrypt_blocks:
422- endbr64
423+ _CET_ENDBR
424 mov %rsp, %rax
425 .Lecb_enc_prologue:
426 push %rbp
427@@ -1371,7 +1371,7 @@ $code.=<<___;
428 .type bsaes_ecb_decrypt_blocks,\@abi-omnipotent
429 .align 16
430 bsaes_ecb_decrypt_blocks:
431- endbr64
432+ _CET_ENDBR
433 mov %rsp, %rax
434 .Lecb_dec_prologue:
435 push %rbp
436@@ -1577,7 +1577,7 @@ $code.=<<___;
437 .type bsaes_cbc_encrypt,\@abi-omnipotent
438 .align 16
439 bsaes_cbc_encrypt:
440- endbr64
441+ _CET_ENDBR
442 ___
443 $code.=<<___ if ($win64);
444 mov 48(%rsp),$arg6 # pull direction flag
445@@ -1865,7 +1865,7 @@ $code.=<<___;
446 .type bsaes_ctr32_encrypt_blocks,\@abi-omnipotent
447 .align 16
448 bsaes_ctr32_encrypt_blocks:
449- endbr64
450+ _CET_ENDBR
451 mov %rsp, %rax
452 .Lctr_enc_prologue:
453 push %rbp
454@@ -2107,7 +2107,7 @@ $code.=<<___;
455 .type bsaes_xts_encrypt,\@abi-omnipotent
456 .align 16
457 bsaes_xts_encrypt:
458- endbr64
459+ _CET_ENDBR
460 mov %rsp, %rax
461 .Lxts_enc_prologue:
462 push %rbp
463@@ -2489,7 +2489,7 @@ $code.=<<___;
464 .type bsaes_xts_decrypt,\@abi-omnipotent
465 .align 16
466 bsaes_xts_decrypt:
467- endbr64
468+ _CET_ENDBR
469 mov %rsp, %rax
470 .Lxts_dec_prologue:
471 push %rbp
472@@ -2966,7 +2966,7 @@ $code.=<<___;
473 .type se_handler,\@abi-omnipotent
474 .align 16
475 se_handler:
476- endbr64
477+ _CET_ENDBR
478 push %rsi
479 push %rdi
480 push %rbx
481Index: aes/asm/vpaes-x86_64.pl
482===================================================================
483RCS file: /cvs/src/lib/libcrypto/aes/asm/vpaes-x86_64.pl,v
484diff -u -p -r1.5 vpaes-x86_64.pl
485--- aes/asm/vpaes-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.5
486+++ aes/asm/vpaes-x86_64.pl 3 Dec 2023 20:18:30 -0000
487@@ -82,7 +82,7 @@ $code.=<<___;
488 .type _vpaes_encrypt_core,\@abi-omnipotent
489 .align 16
490 _vpaes_encrypt_core:
491- endbr64
492+ _CET_ENDBR
493 mov %rdx, %r9
494 mov \$16, %r11
495 mov 240(%rdx),%eax
496@@ -173,7 +173,7 @@ _vpaes_encrypt_core:
497 .type _vpaes_decrypt_core,\@abi-omnipotent
498 .align 16
499 _vpaes_decrypt_core:
500- endbr64
501+ _CET_ENDBR
502 mov %rdx, %r9 # load key
503 mov 240(%rdx),%eax
504 movdqa %xmm9, %xmm1
505@@ -281,7 +281,7 @@ _vpaes_decrypt_core:
506 .type _vpaes_schedule_core,\@abi-omnipotent
507 .align 16
508 _vpaes_schedule_core:
509- endbr64
510+ _CET_ENDBR
511 # rdi = key
512 # rsi = size in bits
513 # rdx = buffer
514@@ -467,7 +467,7 @@ _vpaes_schedule_core:
515 .type _vpaes_schedule_192_smear,\@abi-omnipotent
516 .align 16
517 _vpaes_schedule_192_smear:
518- endbr64
519+ _CET_ENDBR
520 pshufd \$0x80, %xmm6, %xmm0 # d c 0 0 -> c 0 0 0
521 pxor %xmm0, %xmm6 # -> c+d c 0 0
522 pshufd \$0xFE, %xmm7, %xmm0 # b a _ _ -> b b b a
523@@ -499,7 +499,7 @@ _vpaes_schedule_192_smear:
524 .type _vpaes_schedule_round,\@abi-omnipotent
525 .align 16
526 _vpaes_schedule_round:
527- endbr64
528+ _CET_ENDBR
529 # extract rcon from xmm8
530 pxor %xmm1, %xmm1
531 palignr \$15, %xmm8, %xmm1
532@@ -567,7 +567,7 @@ _vpaes_schedule_low_round:
533 .type _vpaes_schedule_transform,\@abi-omnipotent
534 .align 16
535 _vpaes_schedule_transform:
536- endbr64
537+ _CET_ENDBR
538 movdqa %xmm9, %xmm1
539 pandn %xmm0, %xmm1
540 psrld \$4, %xmm1
541@@ -606,7 +606,7 @@ _vpaes_schedule_transform:
542 .type _vpaes_schedule_mangle,\@abi-omnipotent
543 .align 16
544 _vpaes_schedule_mangle:
545- endbr64
546+ _CET_ENDBR
547 movdqa %xmm0, %xmm4 # save xmm0 for later
548 movdqa .Lk_mc_forward(%rip),%xmm5
549 test %rcx, %rcx
550@@ -680,7 +680,7 @@ _vpaes_schedule_mangle:
551 .type ${PREFIX}_set_encrypt_key,\@function,3
552 .align 16
553 ${PREFIX}_set_encrypt_key:
554- endbr64
555+ _CET_ENDBR
556 ___
557 $code.=<<___ if ($win64);
558 lea -0xb8(%rsp),%rsp
559@@ -729,7 +729,7 @@ $code.=<<___;
560 .type ${PREFIX}_set_decrypt_key,\@function,3
561 .align 16
562 ${PREFIX}_set_decrypt_key:
563- endbr64
564+ _CET_ENDBR
565 ___
566 $code.=<<___ if ($win64);
567 lea -0xb8(%rsp),%rsp
568@@ -783,7 +783,7 @@ $code.=<<___;
569 .type ${PREFIX}_encrypt,\@function,3
570 .align 16
571 ${PREFIX}_encrypt:
572- endbr64
573+ _CET_ENDBR
574 ___
575 $code.=<<___ if ($win64);
576 lea -0xb8(%rsp),%rsp
577@@ -827,7 +827,7 @@ $code.=<<___;
578 .type ${PREFIX}_decrypt,\@function,3
579 .align 16
580 ${PREFIX}_decrypt:
581- endbr64
582+ _CET_ENDBR
583 ___
584 $code.=<<___ if ($win64);
585 lea -0xb8(%rsp),%rsp
586@@ -877,7 +877,7 @@ $code.=<<___;
587 .type ${PREFIX}_cbc_encrypt,\@function,6
588 .align 16
589 ${PREFIX}_cbc_encrypt:
590- endbr64
591+ _CET_ENDBR
592 xchg $key,$len
593 ___
594 ($len,$key)=($key,$len);
595@@ -961,7 +961,7 @@ $code.=<<___;
596 .type _vpaes_preheat,\@abi-omnipotent
597 .align 16
598 _vpaes_preheat:
599- endbr64
600+ _CET_ENDBR
601 lea .Lk_s0F(%rip), %r10
602 movdqa -0x20(%r10), %xmm10 # .Lk_inv
603 movdqa -0x10(%r10), %xmm11 # .Lk_inv+16
604@@ -1092,7 +1092,7 @@ $code.=<<___;
605 .type se_handler,\@abi-omnipotent
606 .align 16
607 se_handler:
608- endbr64
609+ _CET_ENDBR
610 push %rsi
611 push %rdi
612 push %rbx
613Index: bn/s2n_bignum_internal.h
614===================================================================
615RCS file: /cvs/src/lib/libcrypto/bn/s2n_bignum_internal.h,v
616diff -u -p -r1.2 s2n_bignum_internal.h
617--- bn/s2n_bignum_internal.h 21 Jan 2023 15:53:54 -0000 1.2
618+++ bn/s2n_bignum_internal.h 3 Dec 2023 20:22:18 -0000
619@@ -18,6 +18,12 @@
620 # define S2N_BN_SYMBOL(name) name
621 #endif
622
623+#ifdef __CET__
624+# include <cet.h>
625+#else
626+# define _CET_ENDBR
627+#endif
628+
629 #define S2N_BN_SYM_VISIBILITY_DIRECTIVE(name) .globl S2N_BN_SYMBOL(name)
630 #ifdef S2N_BN_HIDE_SYMBOLS
631 # ifdef __APPLE__
632Index: bn/arch/amd64/bignum_add.S
633===================================================================
634RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_add.S,v
635diff -u -p -r1.4 bignum_add.S
636--- bn/arch/amd64/bignum_add.S 25 Apr 2023 04:42:26 -0000 1.4
637+++ bn/arch/amd64/bignum_add.S 3 Dec 2023 20:18:30 -0000
638@@ -49,7 +49,7 @@
639
640
641 S2N_BN_SYMBOL(bignum_add):
642- endbr64
643+ _CET_ENDBR
644
645 #if WINDOWS_ABI
646 push rdi
647Index: bn/arch/amd64/bignum_cmadd.S
648===================================================================
649RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_cmadd.S,v
650diff -u -p -r1.4 bignum_cmadd.S
651--- bn/arch/amd64/bignum_cmadd.S 25 Apr 2023 04:42:26 -0000 1.4
652+++ bn/arch/amd64/bignum_cmadd.S 3 Dec 2023 20:18:30 -0000
653@@ -54,7 +54,7 @@
654
655
656 S2N_BN_SYMBOL(bignum_cmadd):
657- endbr64
658+ _CET_ENDBR
659
660 #if WINDOWS_ABI
661 push rdi
662Index: bn/arch/amd64/bignum_cmul.S
663===================================================================
664RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_cmul.S,v
665diff -u -p -r1.4 bignum_cmul.S
666--- bn/arch/amd64/bignum_cmul.S 25 Apr 2023 04:42:26 -0000 1.4
667+++ bn/arch/amd64/bignum_cmul.S 3 Dec 2023 20:18:30 -0000
668@@ -51,7 +51,7 @@
669
670
671 S2N_BN_SYMBOL(bignum_cmul):
672- endbr64
673+ _CET_ENDBR
674
675 #if WINDOWS_ABI
676 push rdi
677Index: bn/arch/amd64/bignum_mul.S
678===================================================================
679RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_mul.S,v
680diff -u -p -r1.4 bignum_mul.S
681--- bn/arch/amd64/bignum_mul.S 25 Apr 2023 04:42:26 -0000 1.4
682+++ bn/arch/amd64/bignum_mul.S 3 Dec 2023 20:18:30 -0000
683@@ -59,7 +59,7 @@
684
685
686 S2N_BN_SYMBOL(bignum_mul):
687- endbr64
688+ _CET_ENDBR
689
690 #if WINDOWS_ABI
691 push rdi
692Index: bn/arch/amd64/bignum_mul_4_8_alt.S
693===================================================================
694RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_mul_4_8_alt.S,v
695diff -u -p -r1.4 bignum_mul_4_8_alt.S
696--- bn/arch/amd64/bignum_mul_4_8_alt.S 25 Apr 2023 04:42:26 -0000 1.4
697+++ bn/arch/amd64/bignum_mul_4_8_alt.S 3 Dec 2023 20:18:30 -0000
698@@ -72,7 +72,7 @@
699 adc h, rdx
700
701 S2N_BN_SYMBOL(bignum_mul_4_8_alt):
702- endbr64
703+ _CET_ENDBR
704
705 #if WINDOWS_ABI
706 push rdi
707Index: bn/arch/amd64/bignum_mul_8_16_alt.S
708===================================================================
709RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_mul_8_16_alt.S,v
710diff -u -p -r1.4 bignum_mul_8_16_alt.S
711--- bn/arch/amd64/bignum_mul_8_16_alt.S 25 Apr 2023 04:42:26 -0000 1.4
712+++ bn/arch/amd64/bignum_mul_8_16_alt.S 3 Dec 2023 20:18:30 -0000
713@@ -72,7 +72,7 @@
714 adc h, rdx
715
716 S2N_BN_SYMBOL(bignum_mul_8_16_alt):
717- endbr64
718+ _CET_ENDBR
719
720 #if WINDOWS_ABI
721 push rdi
722Index: bn/arch/amd64/bignum_sqr.S
723===================================================================
724RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sqr.S,v
725diff -u -p -r1.4 bignum_sqr.S
726--- bn/arch/amd64/bignum_sqr.S 25 Apr 2023 04:42:26 -0000 1.4
727+++ bn/arch/amd64/bignum_sqr.S 3 Dec 2023 20:18:30 -0000
728@@ -62,7 +62,7 @@
729 #define llshort ebp
730
731 S2N_BN_SYMBOL(bignum_sqr):
732- endbr64
733+ _CET_ENDBR
734
735 #if WINDOWS_ABI
736 push rdi
737Index: bn/arch/amd64/bignum_sqr_4_8_alt.S
738===================================================================
739RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_4_8_alt.S,v
740diff -u -p -r1.4 bignum_sqr_4_8_alt.S
741--- bn/arch/amd64/bignum_sqr_4_8_alt.S 25 Apr 2023 04:42:26 -0000 1.4
742+++ bn/arch/amd64/bignum_sqr_4_8_alt.S 3 Dec 2023 20:18:30 -0000
743@@ -71,7 +71,7 @@
744 adc c, 0
745
746 S2N_BN_SYMBOL(bignum_sqr_4_8_alt):
747- endbr64
748+ _CET_ENDBR
749
750 #if WINDOWS_ABI
751 push rdi
752Index: bn/arch/amd64/bignum_sqr_8_16_alt.S
753===================================================================
754RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sqr_8_16_alt.S,v
755diff -u -p -r1.4 bignum_sqr_8_16_alt.S
756--- bn/arch/amd64/bignum_sqr_8_16_alt.S 25 Apr 2023 04:42:26 -0000 1.4
757+++ bn/arch/amd64/bignum_sqr_8_16_alt.S 3 Dec 2023 20:18:30 -0000
758@@ -103,7 +103,7 @@
759 adc c, 0
760
761 S2N_BN_SYMBOL(bignum_sqr_8_16_alt):
762- endbr64
763+ _CET_ENDBR
764
765 #if WINDOWS_ABI
766 push rdi
767Index: bn/arch/amd64/bignum_sub.S
768===================================================================
769RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/bignum_sub.S,v
770diff -u -p -r1.4 bignum_sub.S
771--- bn/arch/amd64/bignum_sub.S 25 Apr 2023 04:42:26 -0000 1.4
772+++ bn/arch/amd64/bignum_sub.S 3 Dec 2023 20:18:30 -0000
773@@ -49,7 +49,7 @@
774
775
776 S2N_BN_SYMBOL(bignum_sub):
777- endbr64
778+ _CET_ENDBR
779
780 #if WINDOWS_ABI
781 push rdi
782Index: bn/arch/amd64/word_clz.S
783===================================================================
784RCS file: /cvs/src/lib/libcrypto/bn/arch/amd64/word_clz.S,v
785diff -u -p -r1.4 word_clz.S
786--- bn/arch/amd64/word_clz.S 25 Apr 2023 04:42:26 -0000 1.4
787+++ bn/arch/amd64/word_clz.S 3 Dec 2023 20:18:30 -0000
788@@ -30,7 +30,7 @@
789 .text
790
791 S2N_BN_SYMBOL(word_clz):
792- endbr64
793+ _CET_ENDBR
794
795 #if WINDOWS_ABI
796 push rdi
797Index: bn/asm/modexp512-x86_64.pl
798===================================================================
799RCS file: /cvs/src/lib/libcrypto/bn/asm/modexp512-x86_64.pl,v
800diff -u -p -r1.4 modexp512-x86_64.pl
801--- bn/asm/modexp512-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.4
802+++ bn/asm/modexp512-x86_64.pl 3 Dec 2023 20:18:30 -0000
803@@ -347,7 +347,7 @@ $code.=<<___;
804 .type MULADD_128x512,\@abi-omnipotent
805 .align 16
806 MULADD_128x512:
807- endbr64
808+ _CET_ENDBR
809 ___
810 &MULSTEP_512([map("%r$_",(8..15))], "(+8*0)(%rcx)", "%rsi", "%rbp", "%rbx");
811 $code.=<<___;
812@@ -415,7 +415,7 @@ $code.=<<___;
813 .type mont_reduce,\@abi-omnipotent
814 .align 16
815 mont_reduce:
816- endbr64
817+ _CET_ENDBR
818 ___
819
820 my $STACK_DEPTH = 8;
821@@ -678,7 +678,7 @@ $code.=<<___;
822 .type mont_mul_a3b,\@abi-omnipotent
823 .align 16
824 mont_mul_a3b:
825- endbr64
826+ _CET_ENDBR
827 #
828 # multiply tmp = src1 * src2
829 # For multiply: dst = rcx, src1 = rdi, src2 = rsi
830@@ -1080,7 +1080,7 @@ $code.=<<___;
831 .type sqr_reduce,\@abi-omnipotent
832 .align 16
833 sqr_reduce:
834- endbr64
835+ _CET_ENDBR
836 mov (+$pResult_offset+8)(%rsp), %rcx
837 ___
838 &SQR_512("%rsp+$tmp16_offset+8", "%rcx", [map("%r$_",(10..15,8..9))], "%rbx", "%rbp", "%rsi", "%rdi");
839@@ -1110,7 +1110,7 @@ $code.=<<___;
840 .globl mod_exp_512
841 .type mod_exp_512,\@function,4
842 mod_exp_512:
843- endbr64
844+ _CET_ENDBR
845 push %rbp
846 push %rbx
847 push %r12
848Index: bn/asm/x86_64-mont.pl
849===================================================================
850RCS file: /cvs/src/lib/libcrypto/bn/asm/x86_64-mont.pl,v
851diff -u -p -r1.5 x86_64-mont.pl
852--- bn/asm/x86_64-mont.pl 25 Apr 2023 04:42:26 -0000 1.5
853+++ bn/asm/x86_64-mont.pl 3 Dec 2023 20:18:30 -0000
854@@ -63,7 +63,7 @@ $code=<<___;
855 .type bn_mul_mont,\@function,6
856 .align 16
857 bn_mul_mont:
858- endbr64
859+ _CET_ENDBR
860 test \$3,${num}d
861 jnz .Lmul_enter
862 cmp \$8,${num}d
863@@ -279,7 +279,7 @@ $code.=<<___;
864 .align 16
865 bn_mul4x_mont:
866 .Lmul4x_enter:
867- endbr64
868+ _CET_ENDBR
869 push %rbx
870 push %rbp
871 push %r12
872@@ -707,7 +707,7 @@ $code.=<<___;
873 .align 16
874 bn_sqr4x_mont:
875 .Lsqr4x_enter:
876- endbr64
877+ _CET_ENDBR
878 push %rbx
879 push %rbp
880 push %r12
881Index: bn/asm/x86_64-mont5.pl
882===================================================================
883RCS file: /cvs/src/lib/libcrypto/bn/asm/x86_64-mont5.pl,v
884diff -u -p -r1.8 x86_64-mont5.pl
885--- bn/asm/x86_64-mont5.pl 25 Apr 2023 04:42:26 -0000 1.8
886+++ bn/asm/x86_64-mont5.pl 3 Dec 2023 20:18:30 -0000
887@@ -57,7 +57,7 @@ $code=<<___;
888 .type bn_mul_mont_gather5,\@function,6
889 .align 64
890 bn_mul_mont_gather5:
891- endbr64
892+ _CET_ENDBR
893 test \$3,${num}d
894 jnz .Lmul_enter
895 cmp \$8,${num}d
896@@ -388,7 +388,7 @@ $code.=<<___;
897 .type bn_mul4x_mont_gather5,\@function,6
898 .align 16
899 bn_mul4x_mont_gather5:
900- endbr64
901+ _CET_ENDBR
902 .Lmul4x_enter:
903 mov ${num}d,${num}d
904 movd `($win64?56:8)`(%rsp),%xmm5 # load 7th argument
905@@ -927,7 +927,7 @@ $code.=<<___;
906 .type bn_scatter5,\@abi-omnipotent
907 .align 16
908 bn_scatter5:
909- endbr64
910+ _CET_ENDBR
911 cmp \$0, $num
912 jz .Lscatter_epilogue
913 lea ($tbl,$idx,8),$tbl
914@@ -946,7 +946,7 @@ bn_scatter5:
915 .type bn_gather5,\@abi-omnipotent
916 .align 16
917 bn_gather5:
918- endbr64
919+ _CET_ENDBR
920 .LSEH_begin_bn_gather5: # Win64 thing, but harmless in other cases
921 # I can't trust assembler to use specific encoding:-(
922 .byte 0x4c,0x8d,0x14,0x24 # lea (%rsp),%r10
923@@ -1057,7 +1057,7 @@ $code.=<<___;
924 .type mul_handler,\@abi-omnipotent
925 .align 16
926 mul_handler:
927- endbr64
928+ _CET_ENDBR
929 push %rsi
930 push %rdi
931 push %rbx
932Index: camellia/asm/cmll-x86_64.pl
933===================================================================
934RCS file: /cvs/src/lib/libcrypto/camellia/asm/cmll-x86_64.pl,v
935diff -u -p -r1.7 cmll-x86_64.pl
936--- camellia/asm/cmll-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.7
937+++ camellia/asm/cmll-x86_64.pl 3 Dec 2023 20:18:30 -0000
938@@ -116,7 +116,7 @@ $code=<<___;
939 .type Camellia_EncryptBlock,\@abi-omnipotent
940 .align 16
941 Camellia_EncryptBlock:
942- endbr64
943+ _CET_ENDBR
944 movl \$128,%eax
945 subl $arg0d,%eax
946 movl \$3,$arg0d
947@@ -129,7 +129,7 @@ Camellia_EncryptBlock:
948 .align 16
949 .Lenc_rounds:
950 Camellia_EncryptBlock_Rounds:
951- endbr64
952+ _CET_ENDBR
953 push %rbx
954 push %rbp
955 push %r13
956@@ -178,7 +178,7 @@ Camellia_EncryptBlock_Rounds:
957 .type _x86_64_Camellia_encrypt,\@abi-omnipotent
958 .align 16
959 _x86_64_Camellia_encrypt:
960- endbr64
961+ _CET_ENDBR
962 xor 0($key),@S[1]
963 xor 4($key),@S[0] # ^=key[0-3]
964 xor 8($key),@S[3]
965@@ -229,7 +229,7 @@ $code.=<<___;
966 .type Camellia_DecryptBlock,\@abi-omnipotent
967 .align 16
968 Camellia_DecryptBlock:
969- endbr64
970+ _CET_ENDBR
971 movl \$128,%eax
972 subl $arg0d,%eax
973 movl \$3,$arg0d
974@@ -242,7 +242,7 @@ Camellia_DecryptBlock:
975 .align 16
976 .Ldec_rounds:
977 Camellia_DecryptBlock_Rounds:
978- endbr64
979+ _CET_ENDBR
980 push %rbx
981 push %rbp
982 push %r13
983@@ -291,7 +291,7 @@ Camellia_DecryptBlock_Rounds:
984 .type _x86_64_Camellia_decrypt,\@abi-omnipotent
985 .align 16
986 _x86_64_Camellia_decrypt:
987- endbr64
988+ _CET_ENDBR
989 xor 0($key),@S[1]
990 xor 4($key),@S[0] # ^=key[0-3]
991 xor 8($key),@S[3]
992@@ -406,7 +406,7 @@ $code.=<<___;
993 .type Camellia_Ekeygen,\@function,3
994 .align 16
995 Camellia_Ekeygen:
996- endbr64
997+ _CET_ENDBR
998 push %rbx
999 push %rbp
1000 push %r13
1001@@ -637,7 +637,7 @@ $code.=<<___;
1002 .type Camellia_cbc_encrypt,\@function,6
1003 .align 16
1004 Camellia_cbc_encrypt:
1005- endbr64
1006+ _CET_ENDBR
1007 cmp \$0,%rdx
1008 je .Lcbc_abort
1009 push %rbx
1010Index: md5/asm/md5-x86_64.pl
1011===================================================================
1012RCS file: /cvs/src/lib/libcrypto/md5/asm/md5-x86_64.pl,v
1013diff -u -p -r1.3 md5-x86_64.pl
1014--- md5/asm/md5-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.3
1015+++ md5/asm/md5-x86_64.pl 3 Dec 2023 20:18:30 -0000
1016@@ -128,7 +128,7 @@ $code .= <<EOF;
1017 .globl md5_block_asm_data_order
1018 .type md5_block_asm_data_order,\@function,3
1019 md5_block_asm_data_order:
1020- endbr64
1021+ _CET_ENDBR
1022 push %rbp
1023 push %rbx
1024 push %r12
1025Index: modes/asm/ghash-x86_64.pl
1026===================================================================
1027RCS file: /cvs/src/lib/libcrypto/modes/asm/ghash-x86_64.pl,v
1028diff -u -p -r1.5 ghash-x86_64.pl
1029--- modes/asm/ghash-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.5
1030+++ modes/asm/ghash-x86_64.pl 3 Dec 2023 20:18:30 -0000
1031@@ -412,7 +412,7 @@ $code.=<<___;
1032 .type gcm_init_clmul,\@abi-omnipotent
1033 .align 16
1034 gcm_init_clmul:
1035- endbr64
1036+ _CET_ENDBR
1037 movdqu ($Xip),$Hkey
1038 pshufd \$0b01001110,$Hkey,$Hkey # dword swap
1039
1040@@ -450,7 +450,7 @@ $code.=<<___;
1041 .type gcm_gmult_clmul,\@abi-omnipotent
1042 .align 16
1043 gcm_gmult_clmul:
1044- endbr64
1045+ _CET_ENDBR
1046 movdqu ($Xip),$Xi
1047 movdqa .Lbswap_mask(%rip),$T3
1048 movdqu ($Htbl),$Hkey
1049@@ -478,7 +478,7 @@ $code.=<<___;
1050 .type gcm_ghash_clmul,\@abi-omnipotent
1051 .align 16
1052 gcm_ghash_clmul:
1053- endbr64
1054+ _CET_ENDBR
1055 ___
1056 $code.=<<___ if ($win64);
1057 .LSEH_begin_gcm_ghash_clmul:
1058@@ -689,7 +689,7 @@ $code.=<<___;
1059 .type se_handler,\@abi-omnipotent
1060 .align 16
1061 se_handler:
1062- endbr64
1063+ _CET_ENDBR
1064 push %rsi
1065 push %rdi
1066 push %rbx
1067Index: perlasm/x86_64-xlate.pl
1068===================================================================
1069RCS file: /cvs/src/lib/libcrypto/perlasm/x86_64-xlate.pl,v
1070diff -u -p -r1.16 x86_64-xlate.pl
1071--- perlasm/x86_64-xlate.pl 23 Feb 2023 08:49:02 -0000 1.16
1072+++ perlasm/x86_64-xlate.pl 3 Dec 2023 20:17:16 -0000
1073@@ -781,6 +781,22 @@ ___
1074 OPTION DOTNAME
1075 ___
1076 }
1077+
1078+if ($nasm) {
1079+ print <<___;
1080+\%define _CET_ENDBR
1081+___
1082+} else {
1083+ print <<___;
1084+#if defined(__CET__)
1085+#include <cet.h>
1086+#else
1087+#define _CET_ENDBR
1088+#endif
1089+
1090+___
1091+}
1092+
1093 print "#include \"x86_arch.h\"\n";
1094
1095 while($line=<>) {
1096Index: rc4/asm/rc4-md5-x86_64.pl
1097===================================================================
1098RCS file: /cvs/src/lib/libcrypto/rc4/asm/rc4-md5-x86_64.pl,v
1099diff -u -p -r1.4 rc4-md5-x86_64.pl
1100--- rc4/asm/rc4-md5-x86_64.pl 28 Jul 2023 10:35:14 -0000 1.4
1101+++ rc4/asm/rc4-md5-x86_64.pl 3 Dec 2023 20:18:30 -0000
1102@@ -109,7 +109,7 @@ $code.=<<___;
1103 .globl $func
1104 .type $func,\@function,$nargs
1105 $func:
1106- endbr64
1107+ _CET_ENDBR
1108 cmp \$0,$len
1109 je .Labort
1110 push %rbx
1111@@ -454,7 +454,7 @@ $code.=<<___;
1112 .type RC4_set_key,\@function,3
1113 .align 16
1114 RC4_set_key:
1115- endbr64
1116+ _CET_ENDBR
1117 lea 8($dat),$dat
1118 lea ($inp,$len),$inp
1119 neg $len
1120Index: rc4/asm/rc4-x86_64.pl
1121===================================================================
1122RCS file: /cvs/src/lib/libcrypto/rc4/asm/rc4-x86_64.pl,v
1123diff -u -p -r1.16 rc4-x86_64.pl
1124--- rc4/asm/rc4-x86_64.pl 28 Jul 2023 10:35:14 -0000 1.16
1125+++ rc4/asm/rc4-x86_64.pl 3 Dec 2023 20:18:30 -0000
1126@@ -128,7 +128,7 @@ $code=<<___;
1127 .type RC4,\@function,4
1128 .align 16
1129 RC4:
1130- endbr64
1131+ _CET_ENDBR
1132 or $len,$len
1133 jne .Lentry
1134 ret
1135@@ -435,7 +435,7 @@ $code.=<<___;
1136 .type RC4_set_key,\@function,3
1137 .align 16
1138 RC4_set_key:
1139- endbr64
1140+ _CET_ENDBR
1141 lea 8($dat),$dat
1142 lea ($inp,$len),$inp
1143 neg $len
1144Index: sha/asm/sha1-x86_64.pl
1145===================================================================
1146RCS file: /cvs/src/lib/libcrypto/sha/asm/sha1-x86_64.pl,v
1147diff -u -p -r1.7 sha1-x86_64.pl
1148--- sha/asm/sha1-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.7
1149+++ sha/asm/sha1-x86_64.pl 3 Dec 2023 20:18:30 -0000
1150@@ -222,7 +222,7 @@ $code.=<<___;
1151 .type sha1_block_data_order,\@function,3
1152 .align 16
1153 sha1_block_data_order:
1154- endbr64
1155+ _CET_ENDBR
1156 mov OPENSSL_ia32cap_P+0(%rip),%r9d
1157 mov OPENSSL_ia32cap_P+4(%rip),%r8d
1158 test \$IA32CAP_MASK1_SSSE3,%r8d # check SSSE3 bit
1159@@ -310,7 +310,7 @@ $code.=<<___;
1160 .align 16
1161 sha1_block_data_order_ssse3:
1162 _ssse3_shortcut:
1163- endbr64
1164+ _CET_ENDBR
1165 push %rbx
1166 push %rbp
1167 push %r12
1168@@ -731,7 +731,7 @@ $code.=<<___;
1169 .align 16
1170 sha1_block_data_order_avx:
1171 _avx_shortcut:
1172- endbr64
1173+ _CET_ENDBR
1174 push %rbx
1175 push %rbp
1176 push %r12
1177@@ -1102,7 +1102,7 @@ $code.=<<___;
1178 .type se_handler,\@abi-omnipotent
1179 .align 16
1180 se_handler:
1181- endbr64
1182+ _CET_ENDBR
1183 push %rsi
1184 push %rdi
1185 push %rbx
1186Index: sha/asm/sha512-x86_64.pl
1187===================================================================
1188RCS file: /cvs/src/lib/libcrypto/sha/asm/sha512-x86_64.pl,v
1189diff -u -p -r1.7 sha512-x86_64.pl
1190--- sha/asm/sha512-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.7
1191+++ sha/asm/sha512-x86_64.pl 3 Dec 2023 20:18:30 -0000
1192@@ -175,7 +175,7 @@ $code=<<___;
1193 .type $func,\@function,4
1194 .align 16
1195 $func:
1196- endbr64
1197+ _CET_ENDBR
1198 push %rbx
1199 push %rbp
1200 push %r12
1201Index: whrlpool/asm/wp-x86_64.pl
1202===================================================================
1203RCS file: /cvs/src/lib/libcrypto/whrlpool/asm/wp-x86_64.pl,v
1204diff -u -p -r1.5 wp-x86_64.pl
1205--- whrlpool/asm/wp-x86_64.pl 25 Apr 2023 04:42:26 -0000 1.5
1206+++ whrlpool/asm/wp-x86_64.pl 3 Dec 2023 20:18:30 -0000
1207@@ -57,7 +57,7 @@ $code=<<___;
1208 .type $func,\@function,3
1209 .align 16
1210 $func:
1211- endbr64
1212+ _CET_ENDBR
1213 push %rbx
1214 push %rbp
1215 push %r12