diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/CMakeLists.txt | 176 | ||||
-rw-r--r-- | crypto/Makefile.am | 114 | ||||
-rw-r--r-- | crypto/Makefile.am.elf-arm | 3 | ||||
-rw-r--r-- | crypto/Makefile.am.elf-mips | 3 | ||||
-rw-r--r-- | crypto/Makefile.am.elf-mips64 | 3 | ||||
-rw-r--r-- | crypto/Makefile.am.elf-x86_64 | 16 | ||||
-rw-r--r-- | crypto/Makefile.am.macosx-x86_64 | 16 | ||||
-rw-r--r-- | crypto/Makefile.am.masm-x86_64 | 16 | ||||
-rw-r--r-- | crypto/Makefile.am.mingw64-x86_64 | 16 | ||||
-rw-r--r-- | crypto/arch/loongarch64/crypto_arch.h | 21 | ||||
-rw-r--r-- | crypto/arch/mips/crypto_arch.h | 21 | ||||
-rw-r--r-- | crypto/bn/arch/loongarch64/bn_arch.h | 23 | ||||
-rw-r--r-- | crypto/compat/getdelim.c | 78 | ||||
-rw-r--r-- | crypto/compat/getline.c | 40 | ||||
-rw-r--r-- | crypto/compat/posix_win.c | 91 | ||||
-rw-r--r-- | crypto/compat/ui_openssl_win.c | 4 |
16 files changed, 349 insertions, 292 deletions
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 5ee20ff..64bccd8 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
@@ -15,11 +15,7 @@ if(HOST_ASM_ELF_ARMV4) | |||
15 | add_definitions(-DAES_ASM) | 15 | add_definitions(-DAES_ASM) |
16 | add_definitions(-DOPENSSL_BN_ASM_MONT) | 16 | add_definitions(-DOPENSSL_BN_ASM_MONT) |
17 | add_definitions(-DGHASH_ASM) | 17 | add_definitions(-DGHASH_ASM) |
18 | add_definitions(-DSHA1_ASM) | ||
19 | add_definitions(-DSHA256_ASM) | ||
20 | add_definitions(-DSHA512_ASM) | ||
21 | add_definitions(-DOPENSSL_CPUID_OBJ) | 18 | add_definitions(-DOPENSSL_CPUID_OBJ) |
22 | set_property(SOURCE ${ASM_ARMV4_ELF_SRC} PROPERTY LANGUAGE C) | ||
23 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_ARMV4_ELF_SRC}) | 19 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_ARMV4_ELF_SRC}) |
24 | endif() | 20 | endif() |
25 | 21 | ||
@@ -33,13 +29,8 @@ if(HOST_ASM_ELF_X86_64) | |||
33 | bn/modexp512-elf-x86_64.S | 29 | bn/modexp512-elf-x86_64.S |
34 | bn/mont-elf-x86_64.S | 30 | bn/mont-elf-x86_64.S |
35 | bn/mont5-elf-x86_64.S | 31 | bn/mont5-elf-x86_64.S |
36 | md5/md5-elf-x86_64.S | ||
37 | modes/ghash-elf-x86_64.S | 32 | modes/ghash-elf-x86_64.S |
38 | rc4/rc4-elf-x86_64.S | 33 | rc4/rc4-elf-x86_64.S |
39 | sha/sha1-elf-x86_64.S | ||
40 | sha/sha256-elf-x86_64.S | ||
41 | sha/sha512-elf-x86_64.S | ||
42 | cpuid-elf-x86_64.S | ||
43 | 34 | ||
44 | bn/arch/amd64/bignum_add.S | 35 | bn/arch/amd64/bignum_add.S |
45 | bn/arch/amd64/bignum_cmadd.S | 36 | bn/arch/amd64/bignum_cmadd.S |
@@ -57,24 +48,12 @@ if(HOST_ASM_ELF_X86_64) | |||
57 | add_definitions(-DAES_ASM) | 48 | add_definitions(-DAES_ASM) |
58 | add_definitions(-DBSAES_ASM) | 49 | add_definitions(-DBSAES_ASM) |
59 | add_definitions(-DVPAES_ASM) | 50 | add_definitions(-DVPAES_ASM) |
60 | add_definitions(-DHAVE_AES_CBC_ENCRYPT_INTERNAL) | ||
61 | add_definitions(-DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL) | ||
62 | add_definitions(-DHAVE_AES_SET_DECRYPT_KEY_INTERNAL) | ||
63 | add_definitions(-DHAVE_AES_ENCRYPT_INTERNAL) | ||
64 | add_definitions(-DHAVE_AES_DECRYPT_INTERNAL) | ||
65 | add_definitions(-DOPENSSL_IA32_SSE2) | 51 | add_definitions(-DOPENSSL_IA32_SSE2) |
66 | add_definitions(-DOPENSSL_BN_ASM_MONT) | 52 | add_definitions(-DOPENSSL_BN_ASM_MONT) |
67 | add_definitions(-DOPENSSL_BN_ASM_MONT5) | 53 | add_definitions(-DOPENSSL_BN_ASM_MONT5) |
68 | add_definitions(-DMD5_ASM) | ||
69 | add_definitions(-DGHASH_ASM) | 54 | add_definitions(-DGHASH_ASM) |
70 | add_definitions(-DRSA_ASM) | 55 | add_definitions(-DRSA_ASM) |
71 | add_definitions(-DSHA1_ASM) | ||
72 | add_definitions(-DSHA256_ASM) | ||
73 | add_definitions(-DSHA512_ASM) | ||
74 | add_definitions(-DWHIRLPOOL_ASM) | ||
75 | add_definitions(-DOPENSSL_CPUID_OBJ) | ||
76 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_ELF_SRC}) | 56 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_ELF_SRC}) |
77 | set_property(SOURCE ${ASM_X86_64_ELF_SRC} PROPERTY LANGUAGE C) | ||
78 | endif() | 57 | endif() |
79 | 58 | ||
80 | if(HOST_ASM_MACOSX_X86_64) | 59 | if(HOST_ASM_MACOSX_X86_64) |
@@ -87,13 +66,8 @@ if(HOST_ASM_MACOSX_X86_64) | |||
87 | bn/modexp512-macosx-x86_64.S | 66 | bn/modexp512-macosx-x86_64.S |
88 | bn/mont-macosx-x86_64.S | 67 | bn/mont-macosx-x86_64.S |
89 | bn/mont5-macosx-x86_64.S | 68 | bn/mont5-macosx-x86_64.S |
90 | md5/md5-macosx-x86_64.S | ||
91 | modes/ghash-macosx-x86_64.S | 69 | modes/ghash-macosx-x86_64.S |
92 | rc4/rc4-macosx-x86_64.S | 70 | rc4/rc4-macosx-x86_64.S |
93 | sha/sha1-macosx-x86_64.S | ||
94 | sha/sha256-macosx-x86_64.S | ||
95 | sha/sha512-macosx-x86_64.S | ||
96 | cpuid-macosx-x86_64.S | ||
97 | 71 | ||
98 | bn/arch/amd64/bignum_add.S | 72 | bn/arch/amd64/bignum_add.S |
99 | bn/arch/amd64/bignum_cmadd.S | 73 | bn/arch/amd64/bignum_cmadd.S |
@@ -111,24 +85,12 @@ if(HOST_ASM_MACOSX_X86_64) | |||
111 | add_definitions(-DAES_ASM) | 85 | add_definitions(-DAES_ASM) |
112 | add_definitions(-DBSAES_ASM) | 86 | add_definitions(-DBSAES_ASM) |
113 | add_definitions(-DVPAES_ASM) | 87 | add_definitions(-DVPAES_ASM) |
114 | add_definitions(-DHAVE_AES_CBC_ENCRYPT_INTERNAL) | ||
115 | add_definitions(-DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL) | ||
116 | add_definitions(-DHAVE_AES_SET_DECRYPT_KEY_INTERNAL) | ||
117 | add_definitions(-DHAVE_AES_ENCRYPT_INTERNAL) | ||
118 | add_definitions(-DHAVE_AES_DECRYPT_INTERNAL) | ||
119 | add_definitions(-DOPENSSL_IA32_SSE2) | 88 | add_definitions(-DOPENSSL_IA32_SSE2) |
120 | add_definitions(-DOPENSSL_BN_ASM_MONT) | 89 | add_definitions(-DOPENSSL_BN_ASM_MONT) |
121 | add_definitions(-DOPENSSL_BN_ASM_MONT5) | 90 | add_definitions(-DOPENSSL_BN_ASM_MONT5) |
122 | add_definitions(-DMD5_ASM) | ||
123 | add_definitions(-DGHASH_ASM) | 91 | add_definitions(-DGHASH_ASM) |
124 | add_definitions(-DRSA_ASM) | 92 | add_definitions(-DRSA_ASM) |
125 | add_definitions(-DSHA1_ASM) | ||
126 | add_definitions(-DSHA256_ASM) | ||
127 | add_definitions(-DSHA512_ASM) | ||
128 | add_definitions(-DWHIRLPOOL_ASM) | ||
129 | add_definitions(-DOPENSSL_CPUID_OBJ) | ||
130 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MACOSX_SRC}) | 93 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MACOSX_SRC}) |
131 | set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY LANGUAGE C) | ||
132 | set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY XCODE_EXPLICIT_FILE_TYPE "sourcecode.asm") | 94 | set_property(SOURCE ${ASM_X86_64_MACOSX_SRC} PROPERTY XCODE_EXPLICIT_FILE_TYPE "sourcecode.asm") |
133 | endif() | 95 | endif() |
134 | 96 | ||
@@ -142,34 +104,18 @@ if(HOST_ASM_MASM_X86_64) | |||
142 | #bn/modexp512-masm-x86_64.S | 104 | #bn/modexp512-masm-x86_64.S |
143 | #bn/mont-masm-x86_64.S | 105 | #bn/mont-masm-x86_64.S |
144 | #bn/mont5-masm-x86_64.S | 106 | #bn/mont5-masm-x86_64.S |
145 | md5/md5-masm-x86_64.S | ||
146 | modes/ghash-masm-x86_64.S | 107 | modes/ghash-masm-x86_64.S |
147 | rc4/rc4-masm-x86_64.S | 108 | rc4/rc4-masm-x86_64.S |
148 | sha/sha1-masm-x86_64.S | ||
149 | sha/sha256-masm-x86_64.S | ||
150 | sha/sha512-masm-x86_64.S | ||
151 | cpuid-masm-x86_64.S | ||
152 | ) | 109 | ) |
153 | add_definitions(-Dendbr64=) | 110 | add_definitions(-Dendbr64=) |
154 | add_definitions(-DAES_ASM) | 111 | add_definitions(-DAES_ASM) |
155 | add_definitions(-DBSAES_ASM) | 112 | add_definitions(-DBSAES_ASM) |
156 | add_definitions(-DVPAES_ASM) | 113 | add_definitions(-DVPAES_ASM) |
157 | add_definitions(-DHAVE_AES_CBC_ENCRYPT_INTERNAL) | ||
158 | add_definitions(-DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL) | ||
159 | add_definitions(-DHAVE_AES_SET_DECRYPT_KEY_INTERNAL) | ||
160 | add_definitions(-DHAVE_AES_ENCRYPT_INTERNAL) | ||
161 | add_definitions(-DHAVE_AES_DECRYPT_INTERNAL) | ||
162 | add_definitions(-DOPENSSL_IA32_SSE2) | 114 | add_definitions(-DOPENSSL_IA32_SSE2) |
163 | #add_definitions(-DOPENSSL_BN_ASM_MONT) | 115 | #add_definitions(-DOPENSSL_BN_ASM_MONT) |
164 | #add_definitions(-DOPENSSL_BN_ASM_MONT5) | 116 | #add_definitions(-DOPENSSL_BN_ASM_MONT5) |
165 | add_definitions(-DMD5_ASM) | ||
166 | add_definitions(-DGHASH_ASM) | 117 | add_definitions(-DGHASH_ASM) |
167 | add_definitions(-DRSA_ASM) | 118 | add_definitions(-DRSA_ASM) |
168 | add_definitions(-DSHA1_ASM) | ||
169 | add_definitions(-DSHA256_ASM) | ||
170 | add_definitions(-DSHA512_ASM) | ||
171 | add_definitions(-DWHIRLPOOL_ASM) | ||
172 | add_definitions(-DOPENSSL_CPUID_OBJ) | ||
173 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MASM_SRC}) | 119 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MASM_SRC}) |
174 | set_property(SOURCE ${ASM_X86_64_MASM_SRC} PROPERTY LANGUAGE ASM_MASM) | 120 | set_property(SOURCE ${ASM_X86_64_MASM_SRC} PROPERTY LANGUAGE ASM_MASM) |
175 | endif() | 121 | endif() |
@@ -184,50 +130,37 @@ if(HOST_ASM_MINGW64_X86_64) | |||
184 | #bn/modexp512-mingw64-x86_64.S | 130 | #bn/modexp512-mingw64-x86_64.S |
185 | #bn/mont-mingw64-x86_64.S | 131 | #bn/mont-mingw64-x86_64.S |
186 | #bn/mont5-mingw64-x86_64.S | 132 | #bn/mont5-mingw64-x86_64.S |
187 | md5/md5-mingw64-x86_64.S | ||
188 | modes/ghash-mingw64-x86_64.S | 133 | modes/ghash-mingw64-x86_64.S |
189 | rc4/rc4-mingw64-x86_64.S | 134 | rc4/rc4-mingw64-x86_64.S |
190 | sha/sha1-mingw64-x86_64.S | ||
191 | sha/sha256-mingw64-x86_64.S | ||
192 | sha/sha512-mingw64-x86_64.S | ||
193 | cpuid-mingw64-x86_64.S | ||
194 | ) | 135 | ) |
195 | add_definitions(-Dendbr32=endbr64) | 136 | add_definitions(-Dendbr32=endbr64) |
196 | add_definitions(-DAES_ASM) | 137 | add_definitions(-DAES_ASM) |
197 | add_definitions(-DBSAES_ASM) | 138 | add_definitions(-DBSAES_ASM) |
198 | add_definitions(-DVPAES_ASM) | 139 | add_definitions(-DVPAES_ASM) |
199 | add_definitions(-DHAVE_AES_CBC_ENCRYPT_INTERNAL) | ||
200 | add_definitions(-DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL) | ||
201 | add_definitions(-DHAVE_AES_SET_DECRYPT_KEY_INTERNAL) | ||
202 | add_definitions(-DHAVE_AES_ENCRYPT_INTERNAL) | ||
203 | add_definitions(-DHAVE_AES_DECRYPT_INTERNAL) | ||
204 | add_definitions(-DOPENSSL_IA32_SSE2) | 140 | add_definitions(-DOPENSSL_IA32_SSE2) |
205 | #add_definitions(-DOPENSSL_BN_ASM_MONT) | 141 | #add_definitions(-DOPENSSL_BN_ASM_MONT) |
206 | #add_definitions(-DOPENSSL_BN_ASM_MONT5) | 142 | #add_definitions(-DOPENSSL_BN_ASM_MONT5) |
207 | add_definitions(-DMD5_ASM) | ||
208 | add_definitions(-DGHASH_ASM) | 143 | add_definitions(-DGHASH_ASM) |
209 | add_definitions(-DRSA_ASM) | 144 | add_definitions(-DRSA_ASM) |
210 | add_definitions(-DSHA1_ASM) | ||
211 | add_definitions(-DSHA256_ASM) | ||
212 | add_definitions(-DSHA512_ASM) | ||
213 | add_definitions(-DWHIRLPOOL_ASM) | ||
214 | add_definitions(-DOPENSSL_CPUID_OBJ) | ||
215 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MINGW64_SRC}) | 145 | set(CRYPTO_SRC ${CRYPTO_SRC} ${ASM_X86_64_MINGW64_SRC}) |
216 | set_property(SOURCE ${ASM_X86_64_MINGW64_SRC} PROPERTY LANGUAGE C) | 146 | endif() |
147 | |||
148 | if(HOST_AARCH64) | ||
149 | set(CRYPTO_SRC ${CRYPTO_SRC} arch/aarch64/crypto_cpu_caps.c) | ||
150 | elseif(HOST_X86_64) | ||
151 | set(CRYPTO_SRC ${CRYPTO_SRC} arch/amd64/crypto_cpu_caps.c) | ||
152 | elseif(HOST_I386) | ||
153 | set(CRYPTO_SRC ${CRYPTO_SRC} arch/i386/crypto_cpu_caps.c) | ||
217 | endif() | 154 | endif() |
218 | 155 | ||
219 | set( | 156 | set( |
220 | CRYPTO_SRC | 157 | CRYPTO_SRC |
221 | ${CRYPTO_SRC} | 158 | ${CRYPTO_SRC} |
222 | cpt_err.c | 159 | crypto_err.c |
223 | cryptlib.c | 160 | crypto_ex_data.c |
224 | crypto_init.c | 161 | crypto_init.c |
225 | cversion.c | 162 | crypto_legacy.c |
226 | ex_data.c | 163 | crypto_memory.c |
227 | malloc-wrapper.c | ||
228 | mem_clr.c | ||
229 | mem_dbg.c | ||
230 | o_fips.c | ||
231 | aes/aes.c | 164 | aes/aes.c |
232 | aes/aes_core.c | 165 | aes/aes_core.c |
233 | aes/aes_ige.c | 166 | aes/aes_ige.c |
@@ -364,7 +297,6 @@ set( | |||
364 | conf/conf_def.c | 297 | conf/conf_def.c |
365 | conf/conf_err.c | 298 | conf/conf_err.c |
366 | conf/conf_lib.c | 299 | conf/conf_lib.c |
367 | conf/conf_mall.c | ||
368 | conf/conf_mod.c | 300 | conf/conf_mod.c |
369 | conf/conf_sap.c | 301 | conf/conf_sap.c |
370 | ct/ct_b64.c | 302 | ct/ct_b64.c |
@@ -379,26 +311,11 @@ set( | |||
379 | ct/ct_x509v3.c | 311 | ct/ct_x509v3.c |
380 | curve25519/curve25519-generic.c | 312 | curve25519/curve25519-generic.c |
381 | curve25519/curve25519.c | 313 | curve25519/curve25519.c |
382 | des/cbc_cksm.c | 314 | des/des.c |
383 | des/cbc_enc.c | 315 | des/des_cksum.c |
384 | des/cfb64ede.c | ||
385 | des/cfb64enc.c | ||
386 | des/cfb_enc.c | ||
387 | des/des_enc.c | 316 | des/des_enc.c |
388 | des/ecb3_enc.c | 317 | des/des_fcrypt.c |
389 | des/ecb_enc.c | 318 | des/des_key.c |
390 | des/ede_cbcm_enc.c | ||
391 | des/enc_read.c | ||
392 | des/fcrypt.c | ||
393 | des/fcrypt_b.c | ||
394 | des/ofb64ede.c | ||
395 | des/ofb64enc.c | ||
396 | des/ofb_enc.c | ||
397 | des/pcbc_enc.c | ||
398 | des/qud_cksm.c | ||
399 | des/set_key.c | ||
400 | des/str2key.c | ||
401 | des/xcbc_enc.c | ||
402 | dh/dh_ameth.c | 319 | dh/dh_ameth.c |
403 | dh/dh_asn1.c | 320 | dh/dh_asn1.c |
404 | dh/dh_check.c | 321 | dh/dh_check.c |
@@ -419,21 +336,15 @@ set( | |||
419 | dsa/dsa_prn.c | 336 | dsa/dsa_prn.c |
420 | ec/ec_ameth.c | 337 | ec/ec_ameth.c |
421 | ec/ec_asn1.c | 338 | ec/ec_asn1.c |
422 | ec/ec_check.c | 339 | ec/ec_convert.c |
423 | ec/ec_curve.c | 340 | ec/ec_curve.c |
424 | ec/ec_cvt.c | ||
425 | ec/ec_err.c | 341 | ec/ec_err.c |
426 | ec/ec_key.c | 342 | ec/ec_key.c |
427 | ec/ec_kmeth.c | ||
428 | ec/ec_lib.c | 343 | ec/ec_lib.c |
429 | ec/ec_mult.c | 344 | ec/ec_mult.c |
430 | ec/ec_oct.c | ||
431 | ec/ec_pmeth.c | 345 | ec/ec_pmeth.c |
432 | ec/ec_print.c | ||
433 | ec/eck_prn.c | 346 | ec/eck_prn.c |
434 | ec/ecp_mont.c | 347 | ec/ecp_methods.c |
435 | ec/ecp_oct.c | ||
436 | ec/ecp_smpl.c | ||
437 | ec/ecx_methods.c | 348 | ec/ecx_methods.c |
438 | ecdh/ecdh.c | 349 | ecdh/ecdh.c |
439 | ecdsa/ecdsa.c | 350 | ecdsa/ecdsa.c |
@@ -476,7 +387,6 @@ set( | |||
476 | evp/m_sha3.c | 387 | evp/m_sha3.c |
477 | evp/m_sigver.c | 388 | evp/m_sigver.c |
478 | evp/m_sm3.c | 389 | evp/m_sm3.c |
479 | evp/m_wp.c | ||
480 | evp/p_legacy.c | 390 | evp/p_legacy.c |
481 | evp/p_lib.c | 391 | evp/p_lib.c |
482 | evp/p_sign.c | 392 | evp/p_sign.c |
@@ -495,6 +405,8 @@ set( | |||
495 | lhash/lhash.c | 405 | lhash/lhash.c |
496 | md4/md4.c | 406 | md4/md4.c |
497 | md5/md5.c | 407 | md5/md5.c |
408 | mlkem/mlkem768.c | ||
409 | mlkem/mlkem1024.c | ||
498 | modes/cbc128.c | 410 | modes/cbc128.c |
499 | modes/ccm128.c | 411 | modes/ccm128.c |
500 | modes/cfb128.c | 412 | modes/cfb128.c |
@@ -599,8 +511,6 @@ set( | |||
599 | ui/ui_err.c | 511 | ui/ui_err.c |
600 | ui/ui_lib.c | 512 | ui/ui_lib.c |
601 | ui/ui_null.c | 513 | ui/ui_null.c |
602 | ui/ui_util.c | ||
603 | whrlpool/whirlpool.c | ||
604 | x509/by_dir.c | 514 | x509/by_dir.c |
605 | x509/by_file.c | 515 | x509/by_file.c |
606 | x509/by_mem.c | 516 | x509/by_mem.c |
@@ -641,6 +551,7 @@ set( | |||
641 | x509/x509_r2x.c | 551 | x509/x509_r2x.c |
642 | x509/x509_req.c | 552 | x509/x509_req.c |
643 | x509/x509_set.c | 553 | x509/x509_set.c |
554 | x509/x509_siginfo.c | ||
644 | x509/x509_skey.c | 555 | x509/x509_skey.c |
645 | x509/x509_trs.c | 556 | x509/x509_trs.c |
646 | x509/x509_txt.c | 557 | x509/x509_txt.c |
@@ -685,6 +596,14 @@ if(NOT HAVE_FREEZERO) | |||
685 | set(COMPAT_SRC ${COMPAT_SRC} compat/freezero.c) | 596 | set(COMPAT_SRC ${COMPAT_SRC} compat/freezero.c) |
686 | endif() | 597 | endif() |
687 | 598 | ||
599 | if(NOT HAVE_GETDELIM) | ||
600 | set(COMPAT_SRC ${COMPAT_SRC} compat/getdelim.c) | ||
601 | endif() | ||
602 | |||
603 | if(NOT HAVE_GETLINE) | ||
604 | set(COMPAT_SRC ${COMPAT_SRC} compat/getline.c) | ||
605 | endif() | ||
606 | |||
688 | if(NOT HAVE_GETOPT) | 607 | if(NOT HAVE_GETOPT) |
689 | set(COMPAT_SRC ${COMPAT_SRC} compat/getopt_long.c) | 608 | set(COMPAT_SRC ${COMPAT_SRC} compat/getopt_long.c) |
690 | endif() | 609 | endif() |
@@ -821,6 +740,7 @@ target_include_directories(crypto_obj | |||
821 | bio | 740 | bio |
822 | bn | 741 | bn |
823 | bytestring | 742 | bytestring |
743 | conf | ||
824 | dh | 744 | dh |
825 | dsa | 745 | dsa |
826 | curve25519 | 746 | curve25519 |
@@ -832,6 +752,7 @@ target_include_directories(crypto_obj | |||
832 | hidden | 752 | hidden |
833 | hmac | 753 | hmac |
834 | lhash | 754 | lhash |
755 | mlkem | ||
835 | modes | 756 | modes |
836 | ocsp | 757 | ocsp |
837 | pkcs12 | 758 | pkcs12 |
@@ -845,41 +766,65 @@ target_include_directories(crypto_obj | |||
845 | ${CMAKE_BINARY_DIR}/include) | 766 | ${CMAKE_BINARY_DIR}/include) |
846 | 767 | ||
847 | if(HOST_AARCH64) | 768 | if(HOST_AARCH64) |
769 | target_include_directories(crypto_obj PRIVATE arch/aarch64/) | ||
848 | target_include_directories(crypto_obj PRIVATE bn/arch/aarch64/) | 770 | target_include_directories(crypto_obj PRIVATE bn/arch/aarch64/) |
849 | elseif(HOST_ARM) | 771 | elseif(HOST_ARM) |
772 | target_include_directories(crypto_obj PRIVATE arch/arm/) | ||
850 | target_include_directories(crypto_obj PRIVATE bn/arch/arm/) | 773 | target_include_directories(crypto_obj PRIVATE bn/arch/arm/) |
851 | elseif(HOST_I386) | 774 | elseif(HOST_I386) |
775 | target_include_directories(crypto_obj PRIVATE arch/i386/) | ||
852 | target_include_directories(crypto_obj PRIVATE bn/arch/i386/) | 776 | target_include_directories(crypto_obj PRIVATE bn/arch/i386/) |
777 | elseif(HOST_LOONGARCH64) | ||
778 | target_include_directories(crypto_obj PRIVATE arch/loongarch64) | ||
779 | target_include_directories(crypto_obj PRIVATE bn/arch/loongarch64) | ||
853 | elseif(HOST_MIPS64) | 780 | elseif(HOST_MIPS64) |
781 | target_include_directories(crypto_obj PRIVATE arch/mips64) | ||
854 | target_include_directories(crypto_obj PRIVATE bn/arch/mips64) | 782 | target_include_directories(crypto_obj PRIVATE bn/arch/mips64) |
855 | elseif(HOST_MIPS) | 783 | elseif(HOST_MIPS) |
784 | target_include_directories(crypto_obj PRIVATE arch/mips) | ||
856 | target_include_directories(crypto_obj PRIVATE bn/arch/mips) | 785 | target_include_directories(crypto_obj PRIVATE bn/arch/mips) |
857 | elseif(HOST_POWERPC) | 786 | elseif(HOST_POWERPC) |
787 | target_include_directories(crypto_obj PRIVATE arch/powerpc) | ||
858 | target_include_directories(crypto_obj PRIVATE bn/arch/powerpc) | 788 | target_include_directories(crypto_obj PRIVATE bn/arch/powerpc) |
859 | elseif(HOST_POWERPC64) | 789 | elseif(HOST_POWERPC64) |
790 | target_include_directories(crypto_obj PRIVATE arch/powerpc64) | ||
860 | target_include_directories(crypto_obj PRIVATE bn/arch/powerpc64) | 791 | target_include_directories(crypto_obj PRIVATE bn/arch/powerpc64) |
861 | elseif(HOST_RISCV64) | 792 | elseif(HOST_RISCV64) |
793 | target_include_directories(crypto_obj PRIVATE arch/riscv64) | ||
862 | target_include_directories(crypto_obj PRIVATE bn/arch/riscv64) | 794 | target_include_directories(crypto_obj PRIVATE bn/arch/riscv64) |
863 | elseif(HOST_SPARC64) | 795 | elseif(HOST_SPARC64) |
796 | target_include_directories(crypto_obj PRIVATE arch/sparc64) | ||
864 | target_include_directories(crypto_obj PRIVATE bn/arch/sparc64) | 797 | target_include_directories(crypto_obj PRIVATE bn/arch/sparc64) |
865 | elseif(HOST_X86_64) | 798 | elseif(HOST_X86_64) |
799 | target_include_directories(crypto_obj PRIVATE arch/amd64) | ||
866 | target_include_directories(crypto_obj PRIVATE bn/arch/amd64) | 800 | target_include_directories(crypto_obj PRIVATE bn/arch/amd64) |
867 | endif() | 801 | endif() |
868 | 802 | ||
803 | if(MSVC) | ||
804 | # "C4701" - Potentially uninitialized local variable 'name' used | ||
805 | set_source_files_properties(bn/bn_convert.c pem/pem_lib.c PROPERTIES | ||
806 | COMPILE_OPTIONS /wd4701 | ||
807 | ) | ||
808 | # "C4702" - unreachable code | ||
809 | set_source_files_properties(pkcs7/pk7_doit.c PROPERTIES | ||
810 | COMPILE_OPTIONS /wd4702 | ||
811 | ) | ||
812 | endif() | ||
813 | |||
869 | add_library(crypto $<TARGET_OBJECTS:crypto_obj> $<TARGET_OBJECTS:compat_obj> empty.c) | 814 | add_library(crypto $<TARGET_OBJECTS:crypto_obj> $<TARGET_OBJECTS:compat_obj> empty.c) |
870 | 815 | ||
871 | export_symbol(crypto ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym) | 816 | export_symbol(crypto ${CMAKE_CURRENT_BINARY_DIR}/crypto_p.sym) |
872 | target_link_libraries(crypto ${PLATFORM_LIBS}) | 817 | target_link_libraries(crypto ${PLATFORM_LIBS}) |
873 | if (WIN32) | ||
874 | set(CRYPTO_POSTFIX -${CRYPTO_MAJOR_VERSION} PARENT_SCOPE) | ||
875 | endif() | ||
876 | set_target_properties(crypto PROPERTIES | 818 | set_target_properties(crypto PROPERTIES |
877 | OUTPUT_NAME crypto${CRYPTO_POSTFIX} | 819 | OUTPUT_NAME crypto |
878 | ARCHIVE_OUTPUT_NAME crypto${CRYPTO_POSTFIX} | 820 | ARCHIVE_OUTPUT_NAME crypto |
879 | EXPORT_NAME Crypto | 821 | EXPORT_NAME Crypto |
880 | VERSION ${CRYPTO_VERSION} | 822 | VERSION ${CRYPTO_VERSION} |
881 | SOVERSION ${CRYPTO_MAJOR_VERSION} | 823 | SOVERSION ${CRYPTO_MAJOR_VERSION} |
882 | ) | 824 | ) |
825 | if(NOT CMAKE_VERSION VERSION_LESS 3.27.0) | ||
826 | set_target_properties(crypto PROPERTIES DLL_NAME_WITH_SOVERSION TRUE) | ||
827 | endif() | ||
883 | 828 | ||
884 | target_include_directories( | 829 | target_include_directories( |
885 | crypto | 830 | crypto |
@@ -919,4 +864,3 @@ if(BUILD_SHARED_LIBS) | |||
919 | add_library(crypto-static STATIC $<TARGET_OBJECTS:crypto_obj>) | 864 | add_library(crypto-static STATIC $<TARGET_OBJECTS:crypto_obj>) |
920 | target_link_libraries(crypto-static ${PLATFORM_LIBS}) | 865 | target_link_libraries(crypto-static ${PLATFORM_LIBS}) |
921 | endif() | 866 | endif() |
922 | |||
diff --git a/crypto/Makefile.am b/crypto/Makefile.am index 6e1e975..d1c5b76 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am | |||
@@ -5,6 +5,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/crypto/asn1 | |||
5 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/bio | 5 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/bio |
6 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/bn | 6 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/bn |
7 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/bytestring | 7 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/bytestring |
8 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/conf | ||
8 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/curve25519 | 9 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/curve25519 |
9 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/dh | 10 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/dh |
10 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/dsa | 11 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/dsa |
@@ -15,6 +16,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/crypto/err | |||
15 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/evp | 16 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/evp |
16 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/hmac | 17 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/hmac |
17 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/lhash | 18 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/lhash |
19 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/mlkem | ||
18 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/modes | 20 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/modes |
19 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/ocsp | 21 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/ocsp |
20 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/pkcs12 | 22 | AM_CPPFLAGS += -I$(top_srcdir)/crypto/pkcs12 |
@@ -132,6 +134,14 @@ if !HAVE_FREEZERO | |||
132 | libcompat_la_SOURCES += compat/freezero.c | 134 | libcompat_la_SOURCES += compat/freezero.c |
133 | endif | 135 | endif |
134 | 136 | ||
137 | if !HAVE_GETDELIM | ||
138 | libcompat_la_SOURCES += compat/getdelim.c | ||
139 | endif | ||
140 | |||
141 | if !HAVE_GETLINE | ||
142 | libcompat_la_SOURCES += compat/getline.c | ||
143 | endif | ||
144 | |||
135 | if !HAVE_GETPAGESIZE | 145 | if !HAVE_GETPAGESIZE |
136 | libcompat_la_SOURCES += compat/getpagesize.c | 146 | libcompat_la_SOURCES += compat/getpagesize.c |
137 | endif | 147 | endif |
@@ -201,23 +211,28 @@ endif | |||
201 | endif | 211 | endif |
202 | endif | 212 | endif |
203 | 213 | ||
204 | libcrypto_la_SOURCES += cpt_err.c | 214 | if HOST_AARCH64 |
205 | libcrypto_la_SOURCES += cryptlib.c | 215 | libcrypto_la_SOURCES += arch/aarch64/crypto_cpu_caps.c |
216 | endif | ||
217 | if HOST_X86_64 | ||
218 | libcrypto_la_SOURCES += arch/amd64/crypto_cpu_caps.c | ||
219 | endif | ||
220 | if HOST_I386 | ||
221 | libcrypto_la_SOURCES += arch/i386/crypto_cpu_caps.c | ||
222 | endif | ||
223 | |||
224 | libcrypto_la_SOURCES += crypto_err.c | ||
225 | libcrypto_la_SOURCES += crypto_ex_data.c | ||
206 | libcrypto_la_SOURCES += crypto_init.c | 226 | libcrypto_la_SOURCES += crypto_init.c |
227 | libcrypto_la_SOURCES += crypto_legacy.c | ||
207 | if !HOST_WIN | 228 | if !HOST_WIN |
208 | libcrypto_la_SOURCES += crypto_lock.c | 229 | libcrypto_la_SOURCES += crypto_lock.c |
209 | else | 230 | else |
210 | libcrypto_la_SOURCES += compat/crypto_lock_win.c | 231 | libcrypto_la_SOURCES += compat/crypto_lock_win.c |
211 | endif | 232 | endif |
212 | libcrypto_la_SOURCES += cversion.c | 233 | libcrypto_la_SOURCES += crypto_memory.c |
213 | libcrypto_la_SOURCES += ex_data.c | ||
214 | libcrypto_la_SOURCES += malloc-wrapper.c | ||
215 | libcrypto_la_SOURCES += mem_clr.c | ||
216 | libcrypto_la_SOURCES += mem_dbg.c | ||
217 | libcrypto_la_SOURCES += o_fips.c | ||
218 | noinst_HEADERS += arm_arch.h | 234 | noinst_HEADERS += arm_arch.h |
219 | noinst_HEADERS += constant_time.h | 235 | noinst_HEADERS += constant_time.h |
220 | noinst_HEADERS += cryptlib.h | ||
221 | noinst_HEADERS += crypto_internal.h | 236 | noinst_HEADERS += crypto_internal.h |
222 | noinst_HEADERS += crypto_local.h | 237 | noinst_HEADERS += crypto_local.h |
223 | noinst_HEADERS += x86_arch.h | 238 | noinst_HEADERS += x86_arch.h |
@@ -359,55 +374,82 @@ noinst_HEADERS += bn/bn_prime.h | |||
359 | noinst_HEADERS += bn/s2n_bignum.h | 374 | noinst_HEADERS += bn/s2n_bignum.h |
360 | noinst_HEADERS += bn/s2n_bignum_internal.h | 375 | noinst_HEADERS += bn/s2n_bignum_internal.h |
361 | 376 | ||
362 | # bn/arch | 377 | # arch, bn/arch |
363 | if HOST_AARCH64 | 378 | if HOST_AARCH64 |
379 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/aarch64/ | ||
364 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/aarch64/ | 380 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/aarch64/ |
365 | endif | 381 | endif |
382 | noinst_HEADERS += arch/aarch64/crypto_arch.h | ||
366 | noinst_HEADERS += bn/arch/aarch64/bn_arch.h | 383 | noinst_HEADERS += bn/arch/aarch64/bn_arch.h |
367 | 384 | ||
368 | if HOST_ARM | 385 | if HOST_ARM |
386 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/arm/ | ||
369 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/arm/ | 387 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/arm/ |
370 | endif | 388 | endif |
389 | noinst_HEADERS += arch/arm/crypto_arch.h | ||
371 | noinst_HEADERS += bn/arch/arm/bn_arch.h | 390 | noinst_HEADERS += bn/arch/arm/bn_arch.h |
372 | 391 | ||
373 | if HOST_I386 | 392 | if HOST_I386 |
393 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/i386/ | ||
374 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/i386/ | 394 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/i386/ |
375 | endif | 395 | endif |
396 | noinst_HEADERS += arch/i386/crypto_arch.h | ||
376 | noinst_HEADERS += bn/arch/i386/bn_arch.h | 397 | noinst_HEADERS += bn/arch/i386/bn_arch.h |
377 | 398 | ||
399 | if HOST_LOONGARCH64 | ||
400 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/loongarch64/ | ||
401 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/loongarch64/ | ||
402 | endif | ||
403 | noinst_HEADERS += arch/loongarch64/crypto_arch.h | ||
404 | noinst_HEADERS += bn/arch/loongarch64/bn_arch.h | ||
405 | |||
378 | if HOST_MIPS | 406 | if HOST_MIPS |
407 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/mips/ | ||
379 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips/ | 408 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips/ |
380 | endif | 409 | endif |
410 | noinst_HEADERS += arch/mips/crypto_arch.h | ||
381 | noinst_HEADERS += bn/arch/mips/bn_arch.h | 411 | noinst_HEADERS += bn/arch/mips/bn_arch.h |
382 | 412 | ||
383 | if HOST_MIPS64 | 413 | if HOST_MIPS64 |
414 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/mips64/ | ||
384 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips64/ | 415 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips64/ |
385 | endif | 416 | endif |
417 | noinst_HEADERS += arch/mips64/crypto_arch.h | ||
386 | noinst_HEADERS += bn/arch/mips64/bn_arch.h | 418 | noinst_HEADERS += bn/arch/mips64/bn_arch.h |
387 | 419 | ||
388 | if HOST_POWERPC | 420 | if HOST_POWERPC |
421 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/powerpc/ | ||
389 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/powerpc/ | 422 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/powerpc/ |
390 | endif | 423 | endif |
424 | noinst_HEADERS += arch/powerpc/crypto_arch.h | ||
391 | noinst_HEADERS += bn/arch/powerpc/bn_arch.h | 425 | noinst_HEADERS += bn/arch/powerpc/bn_arch.h |
392 | 426 | ||
393 | if HOST_POWERPC64 | 427 | if HOST_POWERPC64 |
428 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/powerpc64/ | ||
394 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/powerpc64/ | 429 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/powerpc64/ |
395 | endif | 430 | endif |
431 | noinst_HEADERS += arch/powerpc64/crypto_arch.h | ||
396 | noinst_HEADERS += bn/arch/powerpc64/bn_arch.h | 432 | noinst_HEADERS += bn/arch/powerpc64/bn_arch.h |
397 | 433 | ||
398 | if HOST_RISCV64 | 434 | if HOST_RISCV64 |
435 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/riscv64/ | ||
399 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/riscv64/ | 436 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/riscv64/ |
400 | endif | 437 | endif |
438 | noinst_HEADERS += arch/riscv64/crypto_arch.h | ||
401 | noinst_HEADERS += bn/arch/riscv64/bn_arch.h | 439 | noinst_HEADERS += bn/arch/riscv64/bn_arch.h |
402 | 440 | ||
403 | if HOST_SPARC64 | 441 | if HOST_SPARC64 |
442 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/sparc64/ | ||
404 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/sparc64/ | 443 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/sparc64/ |
405 | endif | 444 | endif |
445 | noinst_HEADERS += arch/sparc64/crypto_arch.h | ||
406 | noinst_HEADERS += bn/arch/sparc64/bn_arch.h | 446 | noinst_HEADERS += bn/arch/sparc64/bn_arch.h |
407 | 447 | ||
408 | if HOST_X86_64 | 448 | if HOST_X86_64 |
449 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/arch/amd64/ | ||
409 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/amd64/ | 450 | libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/amd64/ |
410 | endif | 451 | endif |
452 | noinst_HEADERS += arch/amd64/crypto_arch.h | ||
411 | noinst_HEADERS += bn/arch/amd64/bn_arch.h | 453 | noinst_HEADERS += bn/arch/amd64/bn_arch.h |
412 | 454 | ||
413 | # buffer | 455 | # buffer |
@@ -458,10 +500,10 @@ libcrypto_la_SOURCES += conf/conf_api.c | |||
458 | libcrypto_la_SOURCES += conf/conf_def.c | 500 | libcrypto_la_SOURCES += conf/conf_def.c |
459 | libcrypto_la_SOURCES += conf/conf_err.c | 501 | libcrypto_la_SOURCES += conf/conf_err.c |
460 | libcrypto_la_SOURCES += conf/conf_lib.c | 502 | libcrypto_la_SOURCES += conf/conf_lib.c |
461 | libcrypto_la_SOURCES += conf/conf_mall.c | ||
462 | libcrypto_la_SOURCES += conf/conf_mod.c | 503 | libcrypto_la_SOURCES += conf/conf_mod.c |
463 | libcrypto_la_SOURCES += conf/conf_sap.c | 504 | libcrypto_la_SOURCES += conf/conf_sap.c |
464 | noinst_HEADERS += conf/conf_def.h | 505 | noinst_HEADERS += conf/conf_def.h |
506 | noinst_HEADERS += conf/conf_local.h | ||
465 | 507 | ||
466 | # ct | 508 | # ct |
467 | libcrypto_la_SOURCES += ct/ct_b64.c | 509 | libcrypto_la_SOURCES += ct/ct_b64.c |
@@ -483,29 +525,12 @@ noinst_HEADERS += curve25519/curve25519_internal.h | |||
483 | 525 | ||
484 | 526 | ||
485 | # des | 527 | # des |
486 | libcrypto_la_SOURCES += des/cbc_cksm.c | 528 | libcrypto_la_SOURCES += des/des.c |
487 | libcrypto_la_SOURCES += des/cbc_enc.c | 529 | libcrypto_la_SOURCES += des/des_cksum.c |
488 | libcrypto_la_SOURCES += des/cfb64ede.c | ||
489 | libcrypto_la_SOURCES += des/cfb64enc.c | ||
490 | libcrypto_la_SOURCES += des/cfb_enc.c | ||
491 | libcrypto_la_SOURCES += des/des_enc.c | 530 | libcrypto_la_SOURCES += des/des_enc.c |
492 | libcrypto_la_SOURCES += des/ecb3_enc.c | 531 | libcrypto_la_SOURCES += des/des_fcrypt.c |
493 | libcrypto_la_SOURCES += des/ecb_enc.c | 532 | libcrypto_la_SOURCES += des/des_key.c |
494 | libcrypto_la_SOURCES += des/ede_cbcm_enc.c | ||
495 | libcrypto_la_SOURCES += des/enc_read.c | ||
496 | libcrypto_la_SOURCES += des/fcrypt.c | ||
497 | libcrypto_la_SOURCES += des/fcrypt_b.c | ||
498 | EXTRA_libcrypto_la_SOURCES += des/ncbc_enc.c | ||
499 | libcrypto_la_SOURCES += des/ofb64ede.c | ||
500 | libcrypto_la_SOURCES += des/ofb64enc.c | ||
501 | libcrypto_la_SOURCES += des/ofb_enc.c | ||
502 | libcrypto_la_SOURCES += des/pcbc_enc.c | ||
503 | libcrypto_la_SOURCES += des/qud_cksm.c | ||
504 | libcrypto_la_SOURCES += des/set_key.c | ||
505 | libcrypto_la_SOURCES += des/str2key.c | ||
506 | libcrypto_la_SOURCES += des/xcbc_enc.c | ||
507 | noinst_HEADERS += des/des_local.h | 533 | noinst_HEADERS += des/des_local.h |
508 | noinst_HEADERS += des/spr.h | ||
509 | 534 | ||
510 | # dh | 535 | # dh |
511 | libcrypto_la_SOURCES += dh/dh_ameth.c | 536 | libcrypto_la_SOURCES += dh/dh_ameth.c |
@@ -534,21 +559,15 @@ noinst_HEADERS += dsa/dsa_local.h | |||
534 | # ec | 559 | # ec |
535 | libcrypto_la_SOURCES += ec/ec_ameth.c | 560 | libcrypto_la_SOURCES += ec/ec_ameth.c |
536 | libcrypto_la_SOURCES += ec/ec_asn1.c | 561 | libcrypto_la_SOURCES += ec/ec_asn1.c |
537 | libcrypto_la_SOURCES += ec/ec_check.c | 562 | libcrypto_la_SOURCES += ec/ec_convert.c |
538 | libcrypto_la_SOURCES += ec/ec_curve.c | 563 | libcrypto_la_SOURCES += ec/ec_curve.c |
539 | libcrypto_la_SOURCES += ec/ec_cvt.c | ||
540 | libcrypto_la_SOURCES += ec/ec_err.c | 564 | libcrypto_la_SOURCES += ec/ec_err.c |
541 | libcrypto_la_SOURCES += ec/ec_key.c | 565 | libcrypto_la_SOURCES += ec/ec_key.c |
542 | libcrypto_la_SOURCES += ec/ec_kmeth.c | ||
543 | libcrypto_la_SOURCES += ec/ec_lib.c | 566 | libcrypto_la_SOURCES += ec/ec_lib.c |
544 | libcrypto_la_SOURCES += ec/ec_mult.c | 567 | libcrypto_la_SOURCES += ec/ec_mult.c |
545 | libcrypto_la_SOURCES += ec/ec_oct.c | ||
546 | libcrypto_la_SOURCES += ec/ec_pmeth.c | 568 | libcrypto_la_SOURCES += ec/ec_pmeth.c |
547 | libcrypto_la_SOURCES += ec/ec_print.c | ||
548 | libcrypto_la_SOURCES += ec/eck_prn.c | 569 | libcrypto_la_SOURCES += ec/eck_prn.c |
549 | libcrypto_la_SOURCES += ec/ecp_mont.c | 570 | libcrypto_la_SOURCES += ec/ecp_methods.c |
550 | libcrypto_la_SOURCES += ec/ecp_oct.c | ||
551 | libcrypto_la_SOURCES += ec/ecp_smpl.c | ||
552 | libcrypto_la_SOURCES += ec/ecx_methods.c | 571 | libcrypto_la_SOURCES += ec/ecx_methods.c |
553 | noinst_HEADERS += ec/ec_local.h | 572 | noinst_HEADERS += ec/ec_local.h |
554 | 573 | ||
@@ -604,7 +623,6 @@ libcrypto_la_SOURCES += evp/m_sha1.c | |||
604 | libcrypto_la_SOURCES += evp/m_sha3.c | 623 | libcrypto_la_SOURCES += evp/m_sha3.c |
605 | libcrypto_la_SOURCES += evp/m_sigver.c | 624 | libcrypto_la_SOURCES += evp/m_sigver.c |
606 | libcrypto_la_SOURCES += evp/m_sm3.c | 625 | libcrypto_la_SOURCES += evp/m_sm3.c |
607 | libcrypto_la_SOURCES += evp/m_wp.c | ||
608 | libcrypto_la_SOURCES += evp/p_legacy.c | 626 | libcrypto_la_SOURCES += evp/p_legacy.c |
609 | libcrypto_la_SOURCES += evp/p_lib.c | 627 | libcrypto_la_SOURCES += evp/p_lib.c |
610 | libcrypto_la_SOURCES += evp/p_sign.c | 628 | libcrypto_la_SOURCES += evp/p_sign.c |
@@ -629,7 +647,6 @@ noinst_HEADERS += hidden/openssl/chacha.h | |||
629 | noinst_HEADERS += hidden/openssl/cmac.h | 647 | noinst_HEADERS += hidden/openssl/cmac.h |
630 | noinst_HEADERS += hidden/openssl/cms.h | 648 | noinst_HEADERS += hidden/openssl/cms.h |
631 | noinst_HEADERS += hidden/openssl/conf.h | 649 | noinst_HEADERS += hidden/openssl/conf.h |
632 | noinst_HEADERS += hidden/openssl/conf_api.h | ||
633 | noinst_HEADERS += hidden/openssl/crypto.h | 650 | noinst_HEADERS += hidden/openssl/crypto.h |
634 | noinst_HEADERS += hidden/openssl/ct.h | 651 | noinst_HEADERS += hidden/openssl/ct.h |
635 | noinst_HEADERS += hidden/openssl/curve25519.h | 652 | noinst_HEADERS += hidden/openssl/curve25519.h |
@@ -646,6 +663,7 @@ noinst_HEADERS += hidden/openssl/idea.h | |||
646 | noinst_HEADERS += hidden/openssl/lhash.h | 663 | noinst_HEADERS += hidden/openssl/lhash.h |
647 | noinst_HEADERS += hidden/openssl/md4.h | 664 | noinst_HEADERS += hidden/openssl/md4.h |
648 | noinst_HEADERS += hidden/openssl/md5.h | 665 | noinst_HEADERS += hidden/openssl/md5.h |
666 | noinst_HEADERS += hidden/openssl/mlkem.h | ||
649 | noinst_HEADERS += hidden/openssl/modes.h | 667 | noinst_HEADERS += hidden/openssl/modes.h |
650 | noinst_HEADERS += hidden/openssl/objects.h | 668 | noinst_HEADERS += hidden/openssl/objects.h |
651 | noinst_HEADERS += hidden/openssl/ocsp.h | 669 | noinst_HEADERS += hidden/openssl/ocsp.h |
@@ -666,7 +684,6 @@ noinst_HEADERS += hidden/openssl/stack.h | |||
666 | noinst_HEADERS += hidden/openssl/ts.h | 684 | noinst_HEADERS += hidden/openssl/ts.h |
667 | noinst_HEADERS += hidden/openssl/txt_db.h | 685 | noinst_HEADERS += hidden/openssl/txt_db.h |
668 | noinst_HEADERS += hidden/openssl/ui.h | 686 | noinst_HEADERS += hidden/openssl/ui.h |
669 | noinst_HEADERS += hidden/openssl/whrlpool.h | ||
670 | noinst_HEADERS += hidden/openssl/x509.h | 687 | noinst_HEADERS += hidden/openssl/x509.h |
671 | noinst_HEADERS += hidden/openssl/x509_vfy.h | 688 | noinst_HEADERS += hidden/openssl/x509_vfy.h |
672 | noinst_HEADERS += hidden/openssl/x509v3.h | 689 | noinst_HEADERS += hidden/openssl/x509v3.h |
@@ -698,6 +715,12 @@ libcrypto_la_SOURCES += md4/md4.c | |||
698 | # md5 | 715 | # md5 |
699 | libcrypto_la_SOURCES += md5/md5.c | 716 | libcrypto_la_SOURCES += md5/md5.c |
700 | 717 | ||
718 | # mlkem | ||
719 | libcrypto_la_SOURCES += mlkem/mlkem768.c | ||
720 | libcrypto_la_SOURCES += mlkem/mlkem1024.c | ||
721 | noinst_HEADERS += mlkem/mlkem.h | ||
722 | noinst_HEADERS += mlkem/mlkem_internal.h | ||
723 | |||
701 | # modes | 724 | # modes |
702 | libcrypto_la_SOURCES += modes/cbc128.c | 725 | libcrypto_la_SOURCES += modes/cbc128.c |
703 | libcrypto_la_SOURCES += modes/ccm128.c | 726 | libcrypto_la_SOURCES += modes/ccm128.c |
@@ -856,12 +879,8 @@ endif | |||
856 | if HOST_WIN | 879 | if HOST_WIN |
857 | libcrypto_la_SOURCES += ui/ui_openssl_win.c | 880 | libcrypto_la_SOURCES += ui/ui_openssl_win.c |
858 | endif | 881 | endif |
859 | libcrypto_la_SOURCES += ui/ui_util.c | ||
860 | noinst_HEADERS += ui/ui_local.h | 882 | noinst_HEADERS += ui/ui_local.h |
861 | 883 | ||
862 | # whrlpool | ||
863 | libcrypto_la_SOURCES += whrlpool/whirlpool.c | ||
864 | |||
865 | # x509 | 884 | # x509 |
866 | libcrypto_la_SOURCES += x509/by_dir.c | 885 | libcrypto_la_SOURCES += x509/by_dir.c |
867 | libcrypto_la_SOURCES += x509/by_file.c | 886 | libcrypto_la_SOURCES += x509/by_file.c |
@@ -903,6 +922,7 @@ libcrypto_la_SOURCES += x509/x509_purp.c | |||
903 | libcrypto_la_SOURCES += x509/x509_r2x.c | 922 | libcrypto_la_SOURCES += x509/x509_r2x.c |
904 | libcrypto_la_SOURCES += x509/x509_req.c | 923 | libcrypto_la_SOURCES += x509/x509_req.c |
905 | libcrypto_la_SOURCES += x509/x509_set.c | 924 | libcrypto_la_SOURCES += x509/x509_set.c |
925 | libcrypto_la_SOURCES += x509/x509_siginfo.c | ||
906 | libcrypto_la_SOURCES += x509/x509_skey.c | 926 | libcrypto_la_SOURCES += x509/x509_skey.c |
907 | libcrypto_la_SOURCES += x509/x509_trs.c | 927 | libcrypto_la_SOURCES += x509/x509_trs.c |
908 | libcrypto_la_SOURCES += x509/x509_txt.c | 928 | libcrypto_la_SOURCES += x509/x509_txt.c |
diff --git a/crypto/Makefile.am.elf-arm b/crypto/Makefile.am.elf-arm index 4f88994..6a9fa50 100644 --- a/crypto/Makefile.am.elf-arm +++ b/crypto/Makefile.am.elf-arm | |||
@@ -13,9 +13,6 @@ if HOST_ASM_ELF_ARM | |||
13 | libcrypto_la_CPPFLAGS += -DAES_ASM | 13 | libcrypto_la_CPPFLAGS += -DAES_ASM |
14 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT | 14 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
15 | libcrypto_la_CPPFLAGS += -DGHASH_ASM | 15 | libcrypto_la_CPPFLAGS += -DGHASH_ASM |
16 | libcrypto_la_CPPFLAGS += -DSHA1_ASM | ||
17 | libcrypto_la_CPPFLAGS += -DSHA256_ASM | ||
18 | libcrypto_la_CPPFLAGS += -DSHA512_ASM | ||
19 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ | 16 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ |
20 | libcrypto_la_SOURCES += $(ASM_ARM_ELF) | 17 | libcrypto_la_SOURCES += $(ASM_ARM_ELF) |
21 | endif | 18 | endif |
diff --git a/crypto/Makefile.am.elf-mips b/crypto/Makefile.am.elf-mips index ea0a730..f7a44f2 100644 --- a/crypto/Makefile.am.elf-mips +++ b/crypto/Makefile.am.elf-mips | |||
@@ -10,8 +10,5 @@ EXTRA_DIST += $(ASM_MIPS_ELF) | |||
10 | if HOST_ASM_ELF_MIPS | 10 | if HOST_ASM_ELF_MIPS |
11 | libcrypto_la_CPPFLAGS += -DAES_ASM | 11 | libcrypto_la_CPPFLAGS += -DAES_ASM |
12 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT | 12 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
13 | libcrypto_la_CPPFLAGS += -DSHA1_ASM | ||
14 | libcrypto_la_CPPFLAGS += -DSHA256_ASM | ||
15 | libcrypto_la_CPPFLAGS += -DSHA512_ASM | ||
16 | libcrypto_la_SOURCES += $(ASM_MIPS_ELF) | 13 | libcrypto_la_SOURCES += $(ASM_MIPS_ELF) |
17 | endif | 14 | endif |
diff --git a/crypto/Makefile.am.elf-mips64 b/crypto/Makefile.am.elf-mips64 index 8f851f3..7d90bc0 100644 --- a/crypto/Makefile.am.elf-mips64 +++ b/crypto/Makefile.am.elf-mips64 | |||
@@ -10,8 +10,5 @@ EXTRA_DIST += $(ASM_MIPS64_ELF) | |||
10 | if HOST_ASM_ELF_MIPS64 | 10 | if HOST_ASM_ELF_MIPS64 |
11 | libcrypto_la_CPPFLAGS += -DAES_ASM | 11 | libcrypto_la_CPPFLAGS += -DAES_ASM |
12 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT | 12 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
13 | libcrypto_la_CPPFLAGS += -DSHA1_ASM | ||
14 | libcrypto_la_CPPFLAGS += -DSHA256_ASM | ||
15 | libcrypto_la_CPPFLAGS += -DSHA512_ASM | ||
16 | libcrypto_la_SOURCES += $(ASM_MIPS64_ELF) | 13 | libcrypto_la_SOURCES += $(ASM_MIPS64_ELF) |
17 | endif | 14 | endif |
diff --git a/crypto/Makefile.am.elf-x86_64 b/crypto/Makefile.am.elf-x86_64 index 6933a11..c62662c 100644 --- a/crypto/Makefile.am.elf-x86_64 +++ b/crypto/Makefile.am.elf-x86_64 | |||
@@ -6,13 +6,8 @@ ASM_X86_64_ELF += aes/aesni-elf-x86_64.S | |||
6 | ASM_X86_64_ELF += bn/modexp512-elf-x86_64.S | 6 | ASM_X86_64_ELF += bn/modexp512-elf-x86_64.S |
7 | ASM_X86_64_ELF += bn/mont-elf-x86_64.S | 7 | ASM_X86_64_ELF += bn/mont-elf-x86_64.S |
8 | ASM_X86_64_ELF += bn/mont5-elf-x86_64.S | 8 | ASM_X86_64_ELF += bn/mont5-elf-x86_64.S |
9 | ASM_X86_64_ELF += md5/md5-elf-x86_64.S | ||
10 | ASM_X86_64_ELF += modes/ghash-elf-x86_64.S | 9 | ASM_X86_64_ELF += modes/ghash-elf-x86_64.S |
11 | ASM_X86_64_ELF += rc4/rc4-elf-x86_64.S | 10 | ASM_X86_64_ELF += rc4/rc4-elf-x86_64.S |
12 | ASM_X86_64_ELF += sha/sha1-elf-x86_64.S | ||
13 | ASM_X86_64_ELF += sha/sha256-elf-x86_64.S | ||
14 | ASM_X86_64_ELF += sha/sha512-elf-x86_64.S | ||
15 | ASM_X86_64_ELF += cpuid-elf-x86_64.S | ||
16 | 11 | ||
17 | ASM_X86_64_ELF += bn/arch/amd64/bignum_add.S | 12 | ASM_X86_64_ELF += bn/arch/amd64/bignum_add.S |
18 | ASM_X86_64_ELF += bn/arch/amd64/bignum_cmadd.S | 13 | ASM_X86_64_ELF += bn/arch/amd64/bignum_cmadd.S |
@@ -33,21 +28,10 @@ if HOST_ASM_ELF_X86_64 | |||
33 | libcrypto_la_CPPFLAGS += -DAES_ASM | 28 | libcrypto_la_CPPFLAGS += -DAES_ASM |
34 | libcrypto_la_CPPFLAGS += -DBSAES_ASM | 29 | libcrypto_la_CPPFLAGS += -DBSAES_ASM |
35 | libcrypto_la_CPPFLAGS += -DVPAES_ASM | 30 | libcrypto_la_CPPFLAGS += -DVPAES_ASM |
36 | libcrypto_la_CPPFLAGS += -DHAVE_AES_CBC_ENCRYPT_INTERNAL | ||
37 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL | ||
38 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL | ||
39 | libcrypto_la_CPPFLAGS += -DHAVE_AES_ENCRYPT_INTERNAL | ||
40 | libcrypto_la_CPPFLAGS += -DHAVE_AES_DECRYPT_INTERNAL | ||
41 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 | 31 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 |
42 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT | 32 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
43 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 | 33 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 |
44 | libcrypto_la_CPPFLAGS += -DMD5_ASM | ||
45 | libcrypto_la_CPPFLAGS += -DGHASH_ASM | 34 | libcrypto_la_CPPFLAGS += -DGHASH_ASM |
46 | libcrypto_la_CPPFLAGS += -DRSA_ASM | 35 | libcrypto_la_CPPFLAGS += -DRSA_ASM |
47 | libcrypto_la_CPPFLAGS += -DSHA1_ASM | ||
48 | libcrypto_la_CPPFLAGS += -DSHA256_ASM | ||
49 | libcrypto_la_CPPFLAGS += -DSHA512_ASM | ||
50 | libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM | ||
51 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ | ||
52 | libcrypto_la_SOURCES += $(ASM_X86_64_ELF) | 36 | libcrypto_la_SOURCES += $(ASM_X86_64_ELF) |
53 | endif | 37 | endif |
diff --git a/crypto/Makefile.am.macosx-x86_64 b/crypto/Makefile.am.macosx-x86_64 index 1020567..010e3be 100644 --- a/crypto/Makefile.am.macosx-x86_64 +++ b/crypto/Makefile.am.macosx-x86_64 | |||
@@ -6,13 +6,8 @@ ASM_X86_64_MACOSX += aes/aesni-macosx-x86_64.S | |||
6 | ASM_X86_64_MACOSX += bn/modexp512-macosx-x86_64.S | 6 | ASM_X86_64_MACOSX += bn/modexp512-macosx-x86_64.S |
7 | ASM_X86_64_MACOSX += bn/mont-macosx-x86_64.S | 7 | ASM_X86_64_MACOSX += bn/mont-macosx-x86_64.S |
8 | ASM_X86_64_MACOSX += bn/mont5-macosx-x86_64.S | 8 | ASM_X86_64_MACOSX += bn/mont5-macosx-x86_64.S |
9 | ASM_X86_64_MACOSX += md5/md5-macosx-x86_64.S | ||
10 | ASM_X86_64_MACOSX += modes/ghash-macosx-x86_64.S | 9 | ASM_X86_64_MACOSX += modes/ghash-macosx-x86_64.S |
11 | ASM_X86_64_MACOSX += rc4/rc4-macosx-x86_64.S | 10 | ASM_X86_64_MACOSX += rc4/rc4-macosx-x86_64.S |
12 | ASM_X86_64_MACOSX += sha/sha1-macosx-x86_64.S | ||
13 | ASM_X86_64_MACOSX += sha/sha256-macosx-x86_64.S | ||
14 | ASM_X86_64_MACOSX += sha/sha512-macosx-x86_64.S | ||
15 | ASM_X86_64_MACOSX += cpuid-macosx-x86_64.S | ||
16 | 11 | ||
17 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_add.S | 12 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_add.S |
18 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmadd.S | 13 | ASM_X86_64_MACOSX += bn/arch/amd64/bignum_cmadd.S |
@@ -33,21 +28,10 @@ if HOST_ASM_MACOSX_X86_64 | |||
33 | libcrypto_la_CPPFLAGS += -DAES_ASM | 28 | libcrypto_la_CPPFLAGS += -DAES_ASM |
34 | libcrypto_la_CPPFLAGS += -DBSAES_ASM | 29 | libcrypto_la_CPPFLAGS += -DBSAES_ASM |
35 | libcrypto_la_CPPFLAGS += -DVPAES_ASM | 30 | libcrypto_la_CPPFLAGS += -DVPAES_ASM |
36 | libcrypto_la_CPPFLAGS += -DHAVE_AES_CBC_ENCRYPT_INTERNAL | ||
37 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL | ||
38 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL | ||
39 | libcrypto_la_CPPFLAGS += -DHAVE_AES_ENCRYPT_INTERNAL | ||
40 | libcrypto_la_CPPFLAGS += -DHAVE_AES_DECRYPT_INTERNAL | ||
41 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 | 31 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 |
42 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT | 32 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
43 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 | 33 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 |
44 | libcrypto_la_CPPFLAGS += -DMD5_ASM | ||
45 | libcrypto_la_CPPFLAGS += -DGHASH_ASM | 34 | libcrypto_la_CPPFLAGS += -DGHASH_ASM |
46 | libcrypto_la_CPPFLAGS += -DRSA_ASM | 35 | libcrypto_la_CPPFLAGS += -DRSA_ASM |
47 | libcrypto_la_CPPFLAGS += -DSHA1_ASM | ||
48 | libcrypto_la_CPPFLAGS += -DSHA256_ASM | ||
49 | libcrypto_la_CPPFLAGS += -DSHA512_ASM | ||
50 | libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM | ||
51 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ | ||
52 | libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX) | 36 | libcrypto_la_SOURCES += $(ASM_X86_64_MACOSX) |
53 | endif | 37 | endif |
diff --git a/crypto/Makefile.am.masm-x86_64 b/crypto/Makefile.am.masm-x86_64 index 7da3cc2..2ef7e1b 100644 --- a/crypto/Makefile.am.masm-x86_64 +++ b/crypto/Makefile.am.masm-x86_64 | |||
@@ -6,13 +6,8 @@ ASM_X86_64_MASM += aes/aesni-masm-x86_64.S | |||
6 | ASM_X86_64_MASM += bn/modexp512-masm-x86_64.S | 6 | ASM_X86_64_MASM += bn/modexp512-masm-x86_64.S |
7 | ASM_X86_64_MASM += bn/mont-masm-x86_64.S | 7 | ASM_X86_64_MASM += bn/mont-masm-x86_64.S |
8 | ASM_X86_64_MASM += bn/mont5-masm-x86_64.S | 8 | ASM_X86_64_MASM += bn/mont5-masm-x86_64.S |
9 | ASM_X86_64_MASM += md5/md5-masm-x86_64.S | ||
10 | ASM_X86_64_MASM += modes/ghash-masm-x86_64.S | 9 | ASM_X86_64_MASM += modes/ghash-masm-x86_64.S |
11 | ASM_X86_64_MASM += rc4/rc4-masm-x86_64.S | 10 | ASM_X86_64_MASM += rc4/rc4-masm-x86_64.S |
12 | ASM_X86_64_MASM += sha/sha1-masm-x86_64.S | ||
13 | ASM_X86_64_MASM += sha/sha256-masm-x86_64.S | ||
14 | ASM_X86_64_MASM += sha/sha512-masm-x86_64.S | ||
15 | ASM_X86_64_MASM += cpuid-masm-x86_64.S | ||
16 | 11 | ||
17 | EXTRA_DIST += $(ASM_X86_64_MASM) | 12 | EXTRA_DIST += $(ASM_X86_64_MASM) |
18 | 13 | ||
@@ -20,21 +15,10 @@ if HOST_ASM_MASM_X86_64 | |||
20 | libcrypto_la_CPPFLAGS += -DAES_ASM | 15 | libcrypto_la_CPPFLAGS += -DAES_ASM |
21 | libcrypto_la_CPPFLAGS += -DBSAES_ASM | 16 | libcrypto_la_CPPFLAGS += -DBSAES_ASM |
22 | libcrypto_la_CPPFLAGS += -DVPAES_ASM | 17 | libcrypto_la_CPPFLAGS += -DVPAES_ASM |
23 | libcrypto_la_CPPFLAGS += -DHAVE_AES_CBC_ENCRYPT_INTERNAL | ||
24 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL | ||
25 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL | ||
26 | libcrypto_la_CPPFLAGS += -DHAVE_AES_ENCRYPT_INTERNAL | ||
27 | libcrypto_la_CPPFLAGS += -DHAVE_AES_DECRYPT_INTERNAL | ||
28 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 | 18 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 |
29 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT | 19 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
30 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 | 20 | libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 |
31 | libcrypto_la_CPPFLAGS += -DMD5_ASM | ||
32 | libcrypto_la_CPPFLAGS += -DGHASH_ASM | 21 | libcrypto_la_CPPFLAGS += -DGHASH_ASM |
33 | libcrypto_la_CPPFLAGS += -DRSA_ASM | 22 | libcrypto_la_CPPFLAGS += -DRSA_ASM |
34 | libcrypto_la_CPPFLAGS += -DSHA1_ASM | ||
35 | libcrypto_la_CPPFLAGS += -DSHA256_ASM | ||
36 | libcrypto_la_CPPFLAGS += -DSHA512_ASM | ||
37 | libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM | ||
38 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ | ||
39 | libcrypto_la_SOURCES += $(ASM_X86_64_MASM) | 23 | libcrypto_la_SOURCES += $(ASM_X86_64_MASM) |
40 | endif | 24 | endif |
diff --git a/crypto/Makefile.am.mingw64-x86_64 b/crypto/Makefile.am.mingw64-x86_64 index 7d0d3f7..8e39e9f 100644 --- a/crypto/Makefile.am.mingw64-x86_64 +++ b/crypto/Makefile.am.mingw64-x86_64 | |||
@@ -6,13 +6,8 @@ ASM_X86_64_MINGW64 += aes/aesni-mingw64-x86_64.S | |||
6 | #ASM_X86_64_MINGW64 += bn/modexp512-mingw64-x86_64.S | 6 | #ASM_X86_64_MINGW64 += bn/modexp512-mingw64-x86_64.S |
7 | #ASM_X86_64_MINGW64 += bn/mont-mingw64-x86_64.S | 7 | #ASM_X86_64_MINGW64 += bn/mont-mingw64-x86_64.S |
8 | #ASM_X86_64_MINGW64 += bn/mont5-mingw64-x86_64.S | 8 | #ASM_X86_64_MINGW64 += bn/mont5-mingw64-x86_64.S |
9 | ASM_X86_64_MINGW64 += md5/md5-mingw64-x86_64.S | ||
10 | ASM_X86_64_MINGW64 += modes/ghash-mingw64-x86_64.S | 9 | ASM_X86_64_MINGW64 += modes/ghash-mingw64-x86_64.S |
11 | ASM_X86_64_MINGW64 += rc4/rc4-mingw64-x86_64.S | 10 | ASM_X86_64_MINGW64 += rc4/rc4-mingw64-x86_64.S |
12 | ASM_X86_64_MINGW64 += sha/sha1-mingw64-x86_64.S | ||
13 | ASM_X86_64_MINGW64 += sha/sha256-mingw64-x86_64.S | ||
14 | ASM_X86_64_MINGW64 += sha/sha512-mingw64-x86_64.S | ||
15 | ASM_X86_64_MINGW64 += cpuid-mingw64-x86_64.S | ||
16 | 11 | ||
17 | EXTRA_DIST += $(ASM_X86_64_MINGW64) | 12 | EXTRA_DIST += $(ASM_X86_64_MINGW64) |
18 | 13 | ||
@@ -21,21 +16,10 @@ libcrypto_la_CPPFLAGS += -Dendbr32=endbr64 | |||
21 | libcrypto_la_CPPFLAGS += -DAES_ASM | 16 | libcrypto_la_CPPFLAGS += -DAES_ASM |
22 | libcrypto_la_CPPFLAGS += -DBSAES_ASM | 17 | libcrypto_la_CPPFLAGS += -DBSAES_ASM |
23 | libcrypto_la_CPPFLAGS += -DVPAES_ASM | 18 | libcrypto_la_CPPFLAGS += -DVPAES_ASM |
24 | libcrypto_la_CPPFLAGS += -DHAVE_AES_CBC_ENCRYPT_INTERNAL | ||
25 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL | ||
26 | libcrypto_la_CPPFLAGS += -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL | ||
27 | libcrypto_la_CPPFLAGS += -DHAVE_AES_ENCRYPT_INTERNAL | ||
28 | libcrypto_la_CPPFLAGS += -DHAVE_AES_DECRYPT_INTERNAL | ||
29 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 | 19 | libcrypto_la_CPPFLAGS += -DOPENSSL_IA32_SSE2 |
30 | #libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT | 20 | #libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT |
31 | #libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 | 21 | #libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT5 |
32 | libcrypto_la_CPPFLAGS += -DMD5_ASM | ||
33 | libcrypto_la_CPPFLAGS += -DGHASH_ASM | 22 | libcrypto_la_CPPFLAGS += -DGHASH_ASM |
34 | libcrypto_la_CPPFLAGS += -DRSA_ASM | 23 | libcrypto_la_CPPFLAGS += -DRSA_ASM |
35 | libcrypto_la_CPPFLAGS += -DSHA1_ASM | ||
36 | libcrypto_la_CPPFLAGS += -DSHA256_ASM | ||
37 | libcrypto_la_CPPFLAGS += -DSHA512_ASM | ||
38 | libcrypto_la_CPPFLAGS += -DWHIRLPOOL_ASM | ||
39 | libcrypto_la_CPPFLAGS += -DOPENSSL_CPUID_OBJ | ||
40 | libcrypto_la_SOURCES += $(ASM_X86_64_MINGW64) | 24 | libcrypto_la_SOURCES += $(ASM_X86_64_MINGW64) |
41 | endif | 25 | endif |
diff --git a/crypto/arch/loongarch64/crypto_arch.h b/crypto/arch/loongarch64/crypto_arch.h new file mode 100644 index 0000000..a3dd98d --- /dev/null +++ b/crypto/arch/loongarch64/crypto_arch.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #ifndef HEADER_CRYPTO_ARCH_H | ||
19 | #define HEADER_CRYPTO_ARCH_H | ||
20 | |||
21 | #endif | ||
diff --git a/crypto/arch/mips/crypto_arch.h b/crypto/arch/mips/crypto_arch.h new file mode 100644 index 0000000..274879c --- /dev/null +++ b/crypto/arch/mips/crypto_arch.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* $OpenBSD$ */ | ||
2 | /* | ||
3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #ifndef HEADER_CRYPTO_ARCH_H | ||
19 | #define HEADER_CRYPTO_ARCH_H | ||
20 | |||
21 | #endif | ||
diff --git a/crypto/bn/arch/loongarch64/bn_arch.h b/crypto/bn/arch/loongarch64/bn_arch.h new file mode 100644 index 0000000..672ac12 --- /dev/null +++ b/crypto/bn/arch/loongarch64/bn_arch.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* $OpenBSD: bn_arch.h,v 1.7 2023/07/09 10:37:32 jsing Exp $ */ | ||
2 | /* | ||
3 | * Copyright (c) 2023 Joel Sing <jsing@openbsd.org> | ||
4 | * | ||
5 | * Permission to use, copy, modify, and distribute this software for any | ||
6 | * purpose with or without fee is hereby granted, provided that the above | ||
7 | * copyright notice and this permission notice appear in all copies. | ||
8 | * | ||
9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | */ | ||
17 | |||
18 | #include <openssl/bn.h> | ||
19 | |||
20 | #ifndef HEADER_BN_ARCH_H | ||
21 | #define HEADER_BN_ARCH_H | ||
22 | |||
23 | #endif | ||
diff --git a/crypto/compat/getdelim.c b/crypto/compat/getdelim.c new file mode 100644 index 0000000..caec3f2 --- /dev/null +++ b/crypto/compat/getdelim.c | |||
@@ -0,0 +1,78 @@ | |||
1 | /*- | ||
2 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This code is derived from software contributed to The NetBSD Foundation | ||
6 | * by Christos Zoulas. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | ||
18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
19 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | ||
21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
27 | * POSSIBILITY OF SUCH DAMAGE. | ||
28 | */ | ||
29 | |||
30 | #include <stdio.h> | ||
31 | #include <stdlib.h> | ||
32 | |||
33 | #ifndef HAVE_GETDELIM | ||
34 | |||
35 | ssize_t | ||
36 | getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp) | ||
37 | { | ||
38 | char *ptr, *eptr; | ||
39 | |||
40 | |||
41 | if (*buf == NULL || *bufsiz == 0) { | ||
42 | *bufsiz = BUFSIZ; | ||
43 | if ((*buf = malloc(*bufsiz)) == NULL) | ||
44 | return -1; | ||
45 | } | ||
46 | |||
47 | for (ptr = *buf, eptr = *buf + *bufsiz;;) { | ||
48 | int c = fgetc(fp); | ||
49 | if (c == -1) { | ||
50 | if (feof(fp)) { | ||
51 | ssize_t diff = (ssize_t)(ptr - *buf); | ||
52 | if (diff != 0) { | ||
53 | *ptr = '\0'; | ||
54 | return diff; | ||
55 | } | ||
56 | } | ||
57 | return -1; | ||
58 | } | ||
59 | *ptr++ = c; | ||
60 | if (c == delimiter) { | ||
61 | *ptr = '\0'; | ||
62 | return ptr - *buf; | ||
63 | } | ||
64 | if (ptr + 2 >= eptr) { | ||
65 | char *nbuf; | ||
66 | size_t nbufsiz = *bufsiz * 2; | ||
67 | ssize_t d = ptr - *buf; | ||
68 | if ((nbuf = realloc(*buf, nbufsiz)) == NULL) | ||
69 | return -1; | ||
70 | *buf = nbuf; | ||
71 | *bufsiz = nbufsiz; | ||
72 | eptr = nbuf + nbufsiz; | ||
73 | ptr = nbuf + d; | ||
74 | } | ||
75 | } | ||
76 | } | ||
77 | |||
78 | #endif /* HAVE_GETDELIM */ | ||
diff --git a/crypto/compat/getline.c b/crypto/compat/getline.c new file mode 100644 index 0000000..e6ecde0 --- /dev/null +++ b/crypto/compat/getline.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /*- | ||
2 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * This code is derived from software contributed to The NetBSD Foundation | ||
6 | * by Christos Zoulas. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * 1. Redistributions of source code must retain the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer. | ||
13 | * 2. Redistributions in binary form must reproduce the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer in the | ||
15 | * documentation and/or other materials provided with the distribution. | ||
16 | * | ||
17 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | ||
18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
19 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | ||
21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
27 | * POSSIBILITY OF SUCH DAMAGE. | ||
28 | */ | ||
29 | |||
30 | #include <stdio.h> | ||
31 | |||
32 | #ifndef HAVE_GETLINE | ||
33 | |||
34 | ssize_t | ||
35 | getline(char **buf, size_t *bufsiz, FILE *fp) | ||
36 | { | ||
37 | return getdelim(buf, bufsiz, '\n', fp); | ||
38 | } | ||
39 | |||
40 | #endif /* HAVE_GETLINE */ | ||
diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c index bb3e653..572e527 100644 --- a/crypto/compat/posix_win.c +++ b/crypto/compat/posix_win.c | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #define NO_REDEF_POSIX_FUNCTIONS | 10 | #define NO_REDEF_POSIX_FUNCTIONS |
11 | 11 | ||
12 | #include <sys/time.h> | ||
13 | |||
12 | #include <ws2tcpip.h> | 14 | #include <ws2tcpip.h> |
13 | #include <windows.h> | 15 | #include <windows.h> |
14 | 16 | ||
@@ -20,6 +22,25 @@ | |||
20 | #include <string.h> | 22 | #include <string.h> |
21 | #include <unistd.h> | 23 | #include <unistd.h> |
22 | 24 | ||
25 | #include <sys/stat.h> | ||
26 | |||
27 | static int | ||
28 | is_socket(int fd) | ||
29 | { | ||
30 | // Border case: Don't break std* file descriptors | ||
31 | if (fd < 3) | ||
32 | return 0; | ||
33 | |||
34 | // All locally-allocated file descriptors will have the high bit set | ||
35 | return (fd & 0x80000000) == 0; | ||
36 | } | ||
37 | |||
38 | static int | ||
39 | get_real_fd(int fd) | ||
40 | { | ||
41 | return (fd & 0x7fffffff); | ||
42 | } | ||
43 | |||
23 | void | 44 | void |
24 | posix_perror(const char *s) | 45 | posix_perror(const char *s) |
25 | { | 46 | { |
@@ -42,6 +63,12 @@ posix_fopen(const char *path, const char *mode) | |||
42 | } | 63 | } |
43 | 64 | ||
44 | int | 65 | int |
66 | libressl_fstat(int fd, struct stat *statbuf) | ||
67 | { | ||
68 | return fstat(get_real_fd(fd), statbuf); | ||
69 | } | ||
70 | |||
71 | int | ||
45 | posix_open(const char *path, ...) | 72 | posix_open(const char *path, ...) |
46 | { | 73 | { |
47 | va_list ap; | 74 | va_list ap; |
@@ -60,7 +87,11 @@ posix_open(const char *path, ...) | |||
60 | flags |= O_NOINHERIT; | 87 | flags |= O_NOINHERIT; |
61 | } | 88 | } |
62 | flags &= ~O_NONBLOCK; | 89 | flags &= ~O_NONBLOCK; |
63 | return open(path, flags, mode); | 90 | |
91 | const int fh = open(path, flags, mode); | ||
92 | |||
93 | // Set high bit to mark file descriptor as a file handle | ||
94 | return fh + 0x80000000; | ||
64 | } | 95 | } |
65 | 96 | ||
66 | char * | 97 | char * |
@@ -148,52 +179,6 @@ wsa_errno(int err) | |||
148 | return -1; | 179 | return -1; |
149 | } | 180 | } |
150 | 181 | ||
151 | /* | ||
152 | * Employ a similar trick to cpython (pycore_fileutils.h) where the CRT report | ||
153 | * handler is disabled while checking if a descriptor is a socket or a file | ||
154 | */ | ||
155 | #if defined _MSC_VER && _MSC_VER >= 1900 | ||
156 | |||
157 | #include <crtdbg.h> | ||
158 | #include <stdlib.h> | ||
159 | |||
160 | static void noop_handler(const wchar_t *expression, const wchar_t *function, | ||
161 | const wchar_t *file, unsigned int line, uintptr_t pReserved) | ||
162 | { | ||
163 | return; | ||
164 | } | ||
165 | |||
166 | #define BEGIN_SUPPRESS_IPH \ | ||
167 | const int old_report_mode = _CrtSetReportMode(_CRT_ASSERT, 0); \ | ||
168 | const _invalid_parameter_handler old_handler = _set_thread_local_invalid_parameter_handler(noop_handler) | ||
169 | #define END_SUPPRESS_IPH \ | ||
170 | (void)old_report_mode; /* Silence warning in release mode when _CrtSetReportMode compiles to void. */ \ | ||
171 | _CrtSetReportMode(_CRT_ASSERT, old_report_mode); \ | ||
172 | _set_thread_local_invalid_parameter_handler(old_handler) | ||
173 | |||
174 | #else | ||
175 | |||
176 | #define BEGIN_SUPPRESS_IPH | ||
177 | #define END_SUPPRESS_IPH | ||
178 | |||
179 | #endif | ||
180 | |||
181 | static int | ||
182 | is_socket(int fd) | ||
183 | { | ||
184 | intptr_t hd; | ||
185 | |||
186 | BEGIN_SUPPRESS_IPH; | ||
187 | hd = _get_osfhandle(fd); | ||
188 | END_SUPPRESS_IPH; | ||
189 | |||
190 | if (hd == (intptr_t)INVALID_HANDLE_VALUE) { | ||
191 | return 1; /* fd is not file descriptor */ | ||
192 | } | ||
193 | |||
194 | return 0; | ||
195 | } | ||
196 | |||
197 | int | 182 | int |
198 | posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) | 183 | posix_connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen) |
199 | { | 184 | { |
@@ -207,14 +192,13 @@ int | |||
207 | posix_close(int fd) | 192 | posix_close(int fd) |
208 | { | 193 | { |
209 | int rc; | 194 | int rc; |
210 | |||
211 | if (is_socket(fd)) { | 195 | if (is_socket(fd)) { |
212 | if ((rc = closesocket(fd)) == SOCKET_ERROR) { | 196 | if ((rc = closesocket(fd)) == SOCKET_ERROR) { |
213 | int err = WSAGetLastError(); | 197 | int err = WSAGetLastError(); |
214 | rc = wsa_errno(err); | 198 | rc = wsa_errno(err); |
215 | } | 199 | } |
216 | } else { | 200 | } else { |
217 | rc = close(fd); | 201 | rc = close(get_real_fd(fd)); |
218 | } | 202 | } |
219 | return rc; | 203 | return rc; |
220 | } | 204 | } |
@@ -223,14 +207,13 @@ ssize_t | |||
223 | posix_read(int fd, void *buf, size_t count) | 207 | posix_read(int fd, void *buf, size_t count) |
224 | { | 208 | { |
225 | ssize_t rc; | 209 | ssize_t rc; |
226 | |||
227 | if (is_socket(fd)) { | 210 | if (is_socket(fd)) { |
228 | if ((rc = recv(fd, buf, count, 0)) == SOCKET_ERROR) { | 211 | if ((rc = recv(fd, buf, count, 0)) == SOCKET_ERROR) { |
229 | int err = WSAGetLastError(); | 212 | int err = WSAGetLastError(); |
230 | rc = wsa_errno(err); | 213 | rc = wsa_errno(err); |
231 | } | 214 | } |
232 | } else { | 215 | } else { |
233 | rc = read(fd, buf, count); | 216 | rc = read(get_real_fd(fd), buf, count); |
234 | } | 217 | } |
235 | return rc; | 218 | return rc; |
236 | } | 219 | } |
@@ -244,7 +227,7 @@ posix_write(int fd, const void *buf, size_t count) | |||
244 | rc = wsa_errno(WSAGetLastError()); | 227 | rc = wsa_errno(WSAGetLastError()); |
245 | } | 228 | } |
246 | } else { | 229 | } else { |
247 | rc = write(fd, buf, count); | 230 | rc = write(get_real_fd(fd), buf, count); |
248 | } | 231 | } |
249 | return rc; | 232 | return rc; |
250 | } | 233 | } |
@@ -289,7 +272,7 @@ uid_t getuid(void) | |||
289 | 272 | ||
290 | #ifdef _MSC_VER | 273 | #ifdef _MSC_VER |
291 | struct timezone; | 274 | struct timezone; |
292 | int gettimeofday(struct timeval * tp, struct timezone * tzp) | 275 | int gettimeofday(struct timeval *tp, void *tzp) |
293 | { | 276 | { |
294 | /* | 277 | /* |
295 | * Note: some broken versions only have 8 trailing zero's, the correct | 278 | * Note: some broken versions only have 8 trailing zero's, the correct |
@@ -306,7 +289,7 @@ int gettimeofday(struct timeval * tp, struct timezone * tzp) | |||
306 | time = ((uint64_t)file_time.dwLowDateTime); | 289 | time = ((uint64_t)file_time.dwLowDateTime); |
307 | time += ((uint64_t)file_time.dwHighDateTime) << 32; | 290 | time += ((uint64_t)file_time.dwHighDateTime) << 32; |
308 | 291 | ||
309 | tp->tv_sec = (long)((time - EPOCH) / 10000000L); | 292 | tp->tv_sec = (long long)((time - EPOCH) / 10000000L); |
310 | tp->tv_usec = (long)(system_time.wMilliseconds * 1000); | 293 | tp->tv_usec = (long)(system_time.wMilliseconds * 1000); |
311 | return 0; | 294 | return 0; |
312 | } | 295 | } |
diff --git a/crypto/compat/ui_openssl_win.c b/crypto/compat/ui_openssl_win.c index 09705e4..4ae2c5d 100644 --- a/crypto/compat/ui_openssl_win.c +++ b/crypto/compat/ui_openssl_win.c | |||
@@ -146,7 +146,7 @@ static int echo_console(UI *ui); | |||
146 | static int noecho_console(UI *ui); | 146 | static int noecho_console(UI *ui); |
147 | static int close_console(UI *ui); | 147 | static int close_console(UI *ui); |
148 | 148 | ||
149 | static UI_METHOD ui_openssl = { | 149 | static const UI_METHOD ui_openssl = { |
150 | .name = "OpenSSL default user interface", | 150 | .name = "OpenSSL default user interface", |
151 | .ui_open_session = open_console, | 151 | .ui_open_session = open_console, |
152 | .ui_write_string = write_string, | 152 | .ui_write_string = write_string, |
@@ -155,7 +155,7 @@ static UI_METHOD ui_openssl = { | |||
155 | }; | 155 | }; |
156 | 156 | ||
157 | /* The method with all the built-in thingies */ | 157 | /* The method with all the built-in thingies */ |
158 | UI_METHOD * | 158 | const UI_METHOD * |
159 | UI_OpenSSL(void) | 159 | UI_OpenSSL(void) |
160 | { | 160 | { |
161 | return &ui_openssl; | 161 | return &ui_openssl; |