1 Star 0 Fork 131

MyOpenHarmony/third_party_openssl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
BUILD.gn 30.62 KB
一键复制 编辑 原始数据 按行查看 历史
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
# Copyright (c) 2020-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/ohos.gni")
# Only use this to set/unset some cflags, use "platform" variable in gn template to add
# source code for Windows.
config("crypto_config") {
include_dirs = [
"./",
"./crypto",
"./include",
"./crypto/modes",
"./crypto/ec/curve448",
"./crypto/ec/curve448/arch_32",
]
cflags = [
"-Wall",
"-Wno-implicit-fallthrough",
"-pthread",
"-fPIC",
"-Wa,--noexecstack",
"-Qunused-arguments",
"-O3",
"-DOPENSSL_USE_NODELETE",
"-DOPENSSL_PIC",
"-DOPENSSLDIR=\"\"",
"-DENGINESDIR=\"\"",
"-DNDEBUG",
"-DOPENSSL_NO_BF",
"-DOPENSSL_NO_CAMELLIA",
"-DOPENSSL_NO_CAST",
"-DOPENSSL_NO_CT",
"-DOPENSSL_NO_MD2",
"-DOPENSSL_NO_RC5",
"-DOPENSSL_NO_RC2",
"-DOPENSSL_NO_RIPEMD",
"-DOPENSSL_NO_RMD160",
]
if (current_cpu == "arm" && !(current_os == "linux" || host_os == "mac")) {
cflags += [
"-DOPENSSL_CPUID_OBJ",
"-DOPENSSL_BN_ASM_MONT",
"-DOPENSSL_BN_ASM_GF2m",
"-DSHA1_ASM",
"-DSHA256_ASM",
"-DSHA512_ASM",
"-DKECCAK1600_ASM",
"-DAES_ASM",
"-DBSAES_ASM",
"-DGHASH_ASM",
"-DECP_NISTZ256_ASM",
"-DPOLY1305_ASM",
]
} else if (current_cpu == "arm64" &&
!(current_os == "linux" || host_os == "mac")) {
cflags += [
"-DOPENSSL_CPUID_OBJ",
"-DOPENSSL_BN_ASM_MONT",
"-DSHA1_ASM",
"-DSHA256_ASM",
"-DSHA512_ASM",
"-DKECCAK1600_ASM",
"-DVPAES_ASM",
"-DECP_NISTZ256_ASM",
"-DPOLY1305_ASM",
]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
cflags += [
"-DOPENSSL_CPUID_OBJ",
"-DOPENSSL_BN_ASM_MONT",
"-DSHA1_ASM",
"-DSHA256_ASM",
"-DSHA512_ASM",
"-DKECCAK1600_ASM",
"-DVPAES_ASM",
"-DECP_NISTZ256_ASM",
"-DPOLY1305_ASM",
"-DOPENSSL_IA32_SSE2",
"-DOPENSSL_BN_ASM_MONT5",
"-DOPENSSL_BN_ASM_GF2m",
"-DRC4_ASM",
"-DMD5_ASM",
"-DAESNI_ASM",
"-DGHASH_ASM",
"-DX25519_ASM",
]
} else if (is_mingw) {
cflags -= [
"-fPIC",
"-DOPENSSL_NO_BF",
"-DOPENSSL_NO_CAMELLIA",
"-DOPENSSL_NO_CAST",
"-DOPENSSL_NO_CT",
"-DOPENSSL_NO_RC2",
"-DOPENSSL_NO_RMD160",
]
cflags += [
"-m64",
"-DL_ENDIAN",
"-DOPENSSL_NO_ASM",
"-DOPENSSL_NO_MDC2",
"-DOPENSSL_NO_IDEA",
"-DUNICODE",
"-D_UNICODE",
"-DWIN32_LEAN_AND_MEAN",
"-D_MT",
"-MMD",
"-MF",
"-c",
"-Wno-macro-redefined",
"-Wno-constant-conversion",
"-Wno-sign-compare",
"-Wno-incompatible-pointer-types",
]
} else if (current_os == "linux" || host_os == "mac") {
cflags -= [
"-DOPENSSL_NO_BF",
"-DOPENSSL_NO_CAMELLIA",
"-DOPENSSL_NO_CAST",
"-DOPENSSL_NO_CT",
"-DOPENSSL_NO_RC2",
"-DOPENSSL_NO_RMD160",
]
if (current_os == "linux") {
cflags += [ "-m64" ]
}
cflags += [
"-DL_ENDIAN",
"-DOPENSSL_NO_ASM",
"-D_REENTRAN",
"-MMD",
"-MF",
"-c",
]
} else {
cflags += [ "-DOPENSSL_NO_ASM" ]
}
}
config("crypto_config_public") {
include_dirs = [ "./include" ]
if (current_cpu == "arm" && !(current_os == "linux" || host_os == "mac")) {
cflags = [ "-DOPENSSL_ARM_PLATFORM" ]
} else if (current_cpu == "arm64" &&
!(current_os == "linux" || host_os == "mac")) {
cflags = [ "-DOPENSSL_ARM64_PLATFORM" ]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
cflags = [ "-DOPENSSL_X86_64_PLATFORM" ]
} else if (is_mingw) {
cflags = [ "-DWINDOWS_PLATFORM" ]
} else if (current_os == "linux" || host_os == "mac") {
cflags = [ "-DMAC_PLATFORM" ]
} else {
cflags = [ "-DOPENSSL_ARM64_PLATFORM" ]
}
}
ohos_source_set("crypto_source") {
sources = [
"crypto/aes/aes_cbc.c",
"crypto/aes/aes_cfb.c",
"crypto/aes/aes_ecb.c",
"crypto/aes/aes_ige.c",
"crypto/aes/aes_misc.c",
"crypto/aes/aes_ofb.c",
"crypto/aes/aes_wrap.c",
"crypto/aria/aria.c",
"crypto/asn1/a_bitstr.c",
"crypto/asn1/a_d2i_fp.c",
"crypto/asn1/a_digest.c",
"crypto/asn1/a_dup.c",
"crypto/asn1/a_gentm.c",
"crypto/asn1/a_i2d_fp.c",
"crypto/asn1/a_int.c",
"crypto/asn1/a_mbstr.c",
"crypto/asn1/a_object.c",
"crypto/asn1/a_octet.c",
"crypto/asn1/a_print.c",
"crypto/asn1/a_sign.c",
"crypto/asn1/a_strex.c",
"crypto/asn1/a_strnid.c",
"crypto/asn1/a_time.c",
"crypto/asn1/a_type.c",
"crypto/asn1/a_utctm.c",
"crypto/asn1/a_utf8.c",
"crypto/asn1/a_verify.c",
"crypto/asn1/ameth_lib.c",
"crypto/asn1/asn1_err.c",
"crypto/asn1/asn1_gen.c",
"crypto/asn1/asn1_item_list.c",
"crypto/asn1/asn1_lib.c",
"crypto/asn1/asn1_par.c",
"crypto/asn1/asn_mime.c",
"crypto/asn1/asn_moid.c",
"crypto/asn1/asn_mstbl.c",
"crypto/asn1/asn_pack.c",
"crypto/asn1/bio_asn1.c",
"crypto/asn1/bio_ndef.c",
"crypto/asn1/d2i_pr.c",
"crypto/asn1/d2i_pu.c",
"crypto/asn1/evp_asn1.c",
"crypto/asn1/f_int.c",
"crypto/asn1/f_string.c",
"crypto/asn1/i2d_pr.c",
"crypto/asn1/i2d_pu.c",
"crypto/asn1/n_pkey.c",
"crypto/asn1/nsseq.c",
"crypto/asn1/p5_pbe.c",
"crypto/asn1/p5_pbev2.c",
"crypto/asn1/p5_scrypt.c",
"crypto/asn1/p8_pkey.c",
"crypto/asn1/t_bitst.c",
"crypto/asn1/t_pkey.c",
"crypto/asn1/t_spki.c",
"crypto/asn1/tasn_dec.c",
"crypto/asn1/tasn_enc.c",
"crypto/asn1/tasn_fre.c",
"crypto/asn1/tasn_new.c",
"crypto/asn1/tasn_prn.c",
"crypto/asn1/tasn_scn.c",
"crypto/asn1/tasn_typ.c",
"crypto/asn1/tasn_utl.c",
"crypto/asn1/x_algor.c",
"crypto/asn1/x_bignum.c",
"crypto/asn1/x_info.c",
"crypto/asn1/x_int64.c",
"crypto/asn1/x_long.c",
"crypto/asn1/x_pkey.c",
"crypto/asn1/x_sig.c",
"crypto/asn1/x_spki.c",
"crypto/asn1/x_val.c",
"crypto/async/arch/async_null.c",
"crypto/async/arch/async_posix.c",
"crypto/async/arch/async_win.c",
"crypto/async/async.c",
"crypto/async/async_err.c",
"crypto/async/async_wait.c",
"crypto/bio/b_addr.c",
"crypto/bio/b_dump.c",
"crypto/bio/b_print.c",
"crypto/bio/b_sock.c",
"crypto/bio/b_sock2.c",
"crypto/bio/bf_buff.c",
"crypto/bio/bf_lbuf.c",
"crypto/bio/bf_nbio.c",
"crypto/bio/bf_null.c",
"crypto/bio/bio_cb.c",
"crypto/bio/bio_err.c",
"crypto/bio/bio_lib.c",
"crypto/bio/bio_meth.c",
"crypto/bio/bss_acpt.c",
"crypto/bio/bss_bio.c",
"crypto/bio/bss_conn.c",
"crypto/bio/bss_dgram.c",
"crypto/bio/bss_fd.c",
"crypto/bio/bss_file.c",
"crypto/bio/bss_log.c",
"crypto/bio/bss_mem.c",
"crypto/bio/bss_null.c",
"crypto/bio/bss_sock.c",
"crypto/blake2/blake2b.c",
"crypto/blake2/blake2s.c",
"crypto/blake2/m_blake2b.c",
"crypto/blake2/m_blake2s.c",
"crypto/bn/bn_add.c",
"crypto/bn/bn_asm.c",
"crypto/bn/bn_blind.c",
"crypto/bn/bn_const.c",
"crypto/bn/bn_ctx.c",
"crypto/bn/bn_depr.c",
"crypto/bn/bn_dh.c",
"crypto/bn/bn_div.c",
"crypto/bn/bn_err.c",
"crypto/bn/bn_exp.c",
"crypto/bn/bn_exp2.c",
"crypto/bn/bn_gcd.c",
"crypto/bn/bn_gf2m.c",
"crypto/bn/bn_intern.c",
"crypto/bn/bn_kron.c",
"crypto/bn/bn_lib.c",
"crypto/bn/bn_mod.c",
"crypto/bn/bn_mont.c",
"crypto/bn/bn_mpi.c",
"crypto/bn/bn_mul.c",
"crypto/bn/bn_nist.c",
"crypto/bn/bn_prime.c",
"crypto/bn/bn_print.c",
"crypto/bn/bn_rand.c",
"crypto/bn/bn_recp.c",
"crypto/bn/bn_shift.c",
"crypto/bn/bn_sqr.c",
"crypto/bn/bn_sqrt.c",
"crypto/bn/bn_srp.c",
"crypto/bn/bn_word.c",
"crypto/bn/bn_x931p.c",
"crypto/buffer/buf_err.c",
"crypto/buffer/buffer.c",
"crypto/cmac/cm_ameth.c",
"crypto/cmac/cm_pmeth.c",
"crypto/cmac/cmac.c",
"crypto/cms/cms_asn1.c",
"crypto/cms/cms_att.c",
"crypto/cms/cms_cd.c",
"crypto/cms/cms_dd.c",
"crypto/cms/cms_enc.c",
"crypto/cms/cms_env.c",
"crypto/cms/cms_err.c",
"crypto/cms/cms_ess.c",
"crypto/cms/cms_io.c",
"crypto/cms/cms_kari.c",
"crypto/cms/cms_lib.c",
"crypto/cms/cms_pwri.c",
"crypto/cms/cms_sd.c",
"crypto/cms/cms_smime.c",
"crypto/comp/c_zlib.c",
"crypto/comp/comp_err.c",
"crypto/comp/comp_lib.c",
"crypto/conf/conf_api.c",
"crypto/conf/conf_def.c",
"crypto/conf/conf_err.c",
"crypto/conf/conf_lib.c",
"crypto/conf/conf_mall.c",
"crypto/conf/conf_mod.c",
"crypto/conf/conf_sap.c",
"crypto/conf/conf_ssl.c",
"crypto/cpt_err.c",
"crypto/cryptlib.c",
"crypto/ctype.c",
"crypto/cversion.c",
"crypto/des/cbc_cksm.c",
"crypto/des/cbc_enc.c",
"crypto/des/cfb64ede.c",
"crypto/des/cfb64enc.c",
"crypto/des/cfb_enc.c",
"crypto/des/des_enc.c",
"crypto/des/ecb3_enc.c",
"crypto/des/ecb_enc.c",
"crypto/des/fcrypt.c",
"crypto/des/fcrypt_b.c",
"crypto/des/ofb64ede.c",
"crypto/des/ofb64enc.c",
"crypto/des/ofb_enc.c",
"crypto/des/pcbc_enc.c",
"crypto/des/qud_cksm.c",
"crypto/des/rand_key.c",
"crypto/des/set_key.c",
"crypto/des/str2key.c",
"crypto/des/xcbc_enc.c",
"crypto/dh/dh_ameth.c",
"crypto/dh/dh_asn1.c",
"crypto/dh/dh_check.c",
"crypto/dh/dh_depr.c",
"crypto/dh/dh_err.c",
"crypto/dh/dh_gen.c",
"crypto/dh/dh_kdf.c",
"crypto/dh/dh_key.c",
"crypto/dh/dh_lib.c",
"crypto/dh/dh_meth.c",
"crypto/dh/dh_pmeth.c",
"crypto/dh/dh_prn.c",
"crypto/dh/dh_rfc5114.c",
"crypto/dh/dh_rfc7919.c",
"crypto/dsa/dsa_ameth.c",
"crypto/dsa/dsa_asn1.c",
"crypto/dsa/dsa_depr.c",
"crypto/dsa/dsa_err.c",
"crypto/dsa/dsa_gen.c",
"crypto/dsa/dsa_key.c",
"crypto/dsa/dsa_lib.c",
"crypto/dsa/dsa_meth.c",
"crypto/dsa/dsa_ossl.c",
"crypto/dsa/dsa_pmeth.c",
"crypto/dsa/dsa_prn.c",
"crypto/dsa/dsa_sign.c",
"crypto/dsa/dsa_vrf.c",
"crypto/dso/dso_dl.c",
"crypto/dso/dso_dlfcn.c",
"crypto/dso/dso_err.c",
"crypto/dso/dso_lib.c",
"crypto/dso/dso_openssl.c",
"crypto/dso/dso_vms.c",
"crypto/dso/dso_win32.c",
"crypto/ebcdic.c",
"crypto/ec/curve25519.c",
"crypto/ec/curve448/arch_32/f_impl.c",
"crypto/ec/curve448/curve448.c",
"crypto/ec/curve448/curve448_tables.c",
"crypto/ec/curve448/eddsa.c",
"crypto/ec/curve448/f_generic.c",
"crypto/ec/curve448/scalar.c",
"crypto/ec/ec2_oct.c",
"crypto/ec/ec2_smpl.c",
"crypto/ec/ec_ameth.c",
"crypto/ec/ec_asn1.c",
"crypto/ec/ec_check.c",
"crypto/ec/ec_curve.c",
"crypto/ec/ec_cvt.c",
"crypto/ec/ec_err.c",
"crypto/ec/ec_key.c",
"crypto/ec/ec_kmeth.c",
"crypto/ec/ec_lib.c",
"crypto/ec/ec_mult.c",
"crypto/ec/ec_oct.c",
"crypto/ec/ec_pmeth.c",
"crypto/ec/ec_print.c",
"crypto/ec/ecdh_kdf.c",
"crypto/ec/ecdh_ossl.c",
"crypto/ec/ecdsa_ossl.c",
"crypto/ec/ecdsa_sign.c",
"crypto/ec/ecdsa_vrf.c",
"crypto/ec/eck_prn.c",
"crypto/ec/ecp_mont.c",
"crypto/ec/ecp_nist.c",
"crypto/ec/ecp_nistp224.c",
"crypto/ec/ecp_nistp256.c",
"crypto/ec/ecp_nistp521.c",
"crypto/ec/ecp_nistputil.c",
"crypto/ec/ecp_oct.c",
"crypto/ec/ecp_smpl.c",
"crypto/ec/ecx_meth.c",
"crypto/engine/eng_all.c",
"crypto/engine/eng_cnf.c",
"crypto/engine/eng_ctrl.c",
"crypto/engine/eng_dyn.c",
"crypto/engine/eng_err.c",
"crypto/engine/eng_fat.c",
"crypto/engine/eng_init.c",
"crypto/engine/eng_lib.c",
"crypto/engine/eng_list.c",
"crypto/engine/eng_openssl.c",
"crypto/engine/eng_pkey.c",
"crypto/engine/eng_rdrand.c",
"crypto/engine/eng_table.c",
"crypto/engine/tb_asnmth.c",
"crypto/engine/tb_cipher.c",
"crypto/engine/tb_dh.c",
"crypto/engine/tb_digest.c",
"crypto/engine/tb_dsa.c",
"crypto/engine/tb_eckey.c",
"crypto/engine/tb_pkmeth.c",
"crypto/engine/tb_rand.c",
"crypto/engine/tb_rsa.c",
"crypto/err/err.c",
"crypto/err/err_all.c",
"crypto/err/err_prn.c",
"crypto/evp/bio_b64.c",
"crypto/evp/bio_enc.c",
"crypto/evp/bio_md.c",
"crypto/evp/bio_ok.c",
"crypto/evp/c_allc.c",
"crypto/evp/c_alld.c",
"crypto/evp/cmeth_lib.c",
"crypto/evp/digest.c",
"crypto/evp/e_aes.c",
"crypto/evp/e_aes_cbc_hmac_sha1.c",
"crypto/evp/e_aes_cbc_hmac_sha256.c",
"crypto/evp/e_aria.c",
"crypto/evp/e_bf.c",
"crypto/evp/e_camellia.c",
"crypto/evp/e_cast.c",
"crypto/evp/e_chacha20_poly1305.c",
"crypto/evp/e_des.c",
"crypto/evp/e_des3.c",
"crypto/evp/e_idea.c",
"crypto/evp/e_null.c",
"crypto/evp/e_old.c",
"crypto/evp/e_rc2.c",
"crypto/evp/e_rc4.c",
"crypto/evp/e_rc4_hmac_md5.c",
"crypto/evp/e_rc5.c",
"crypto/evp/e_seed.c",
"crypto/evp/e_sm4.c",
"crypto/evp/e_xcbc_d.c",
"crypto/evp/encode.c",
"crypto/evp/evp_cnf.c",
"crypto/evp/evp_enc.c",
"crypto/evp/evp_err.c",
"crypto/evp/evp_key.c",
"crypto/evp/evp_lib.c",
"crypto/evp/evp_pbe.c",
"crypto/evp/evp_pkey.c",
"crypto/evp/m_md2.c",
"crypto/evp/m_md4.c",
"crypto/evp/m_md5.c",
"crypto/evp/m_md5_sha1.c",
"crypto/evp/m_mdc2.c",
"crypto/evp/m_null.c",
"crypto/evp/m_ripemd.c",
"crypto/evp/m_sha1.c",
"crypto/evp/m_sha3.c",
"crypto/evp/m_sigver.c",
"crypto/evp/m_wp.c",
"crypto/evp/names.c",
"crypto/evp/p5_crpt.c",
"crypto/evp/p5_crpt2.c",
"crypto/evp/p_dec.c",
"crypto/evp/p_enc.c",
"crypto/evp/p_lib.c",
"crypto/evp/p_open.c",
"crypto/evp/p_seal.c",
"crypto/evp/p_sign.c",
"crypto/evp/p_verify.c",
"crypto/evp/pbe_scrypt.c",
"crypto/evp/pmeth_fn.c",
"crypto/evp/pmeth_gn.c",
"crypto/evp/pmeth_lib.c",
"crypto/ex_data.c",
"crypto/getenv.c",
"crypto/hmac/hm_ameth.c",
"crypto/hmac/hm_pmeth.c",
"crypto/hmac/hmac.c",
"crypto/idea/i_cbc.c",
"crypto/idea/i_cfb64.c",
"crypto/idea/i_ecb.c",
"crypto/idea/i_ofb64.c",
"crypto/idea/i_skey.c",
"crypto/init.c",
"crypto/kdf/hkdf.c",
"crypto/kdf/kdf_err.c",
"crypto/kdf/scrypt.c",
"crypto/kdf/tls1_prf.c",
"crypto/lhash/lh_stats.c",
"crypto/lhash/lhash.c",
"crypto/md4/md4_dgst.c",
"crypto/md4/md4_one.c",
"crypto/md5/md5_dgst.c",
"crypto/md5/md5_one.c",
"crypto/mdc2/mdc2_one.c",
"crypto/mdc2/mdc2dgst.c",
"crypto/mem.c",
"crypto/mem_dbg.c",
"crypto/mem_sec.c",
"crypto/modes/cbc128.c",
"crypto/modes/ccm128.c",
"crypto/modes/cfb128.c",
"crypto/modes/ctr128.c",
"crypto/modes/cts128.c",
"crypto/modes/gcm128.c",
"crypto/modes/ocb128.c",
"crypto/modes/ofb128.c",
"crypto/modes/wrap128.c",
"crypto/modes/xts128.c",
"crypto/o_dir.c",
"crypto/o_fips.c",
"crypto/o_fopen.c",
"crypto/o_init.c",
"crypto/o_str.c",
"crypto/o_time.c",
"crypto/objects/o_names.c",
"crypto/objects/obj_dat.c",
"crypto/objects/obj_err.c",
"crypto/objects/obj_lib.c",
"crypto/objects/obj_xref.c",
"crypto/ocsp/ocsp_asn.c",
"crypto/ocsp/ocsp_cl.c",
"crypto/ocsp/ocsp_err.c",
"crypto/ocsp/ocsp_ext.c",
"crypto/ocsp/ocsp_ht.c",
"crypto/ocsp/ocsp_lib.c",
"crypto/ocsp/ocsp_prn.c",
"crypto/ocsp/ocsp_srv.c",
"crypto/ocsp/ocsp_vfy.c",
"crypto/ocsp/v3_ocsp.c",
"crypto/pem/pem_all.c",
"crypto/pem/pem_err.c",
"crypto/pem/pem_info.c",
"crypto/pem/pem_lib.c",
"crypto/pem/pem_oth.c",
"crypto/pem/pem_pk8.c",
"crypto/pem/pem_pkey.c",
"crypto/pem/pem_sign.c",
"crypto/pem/pem_x509.c",
"crypto/pem/pem_xaux.c",
"crypto/pem/pvkfmt.c",
"crypto/pkcs12/p12_add.c",
"crypto/pkcs12/p12_asn.c",
"crypto/pkcs12/p12_attr.c",
"crypto/pkcs12/p12_crpt.c",
"crypto/pkcs12/p12_crt.c",
"crypto/pkcs12/p12_decr.c",
"crypto/pkcs12/p12_init.c",
"crypto/pkcs12/p12_key.c",
"crypto/pkcs12/p12_kiss.c",
"crypto/pkcs12/p12_mutl.c",
"crypto/pkcs12/p12_npas.c",
"crypto/pkcs12/p12_p8d.c",
"crypto/pkcs12/p12_p8e.c",
"crypto/pkcs12/p12_sbag.c",
"crypto/pkcs12/p12_utl.c",
"crypto/pkcs12/pk12err.c",
"crypto/pkcs7/bio_pk7.c",
"crypto/pkcs7/pk7_asn1.c",
"crypto/pkcs7/pk7_attr.c",
"crypto/pkcs7/pk7_doit.c",
"crypto/pkcs7/pk7_lib.c",
"crypto/pkcs7/pk7_mime.c",
"crypto/pkcs7/pk7_smime.c",
"crypto/pkcs7/pkcs7err.c",
"crypto/poly1305/poly1305.c",
"crypto/poly1305/poly1305_ameth.c",
"crypto/poly1305/poly1305_pmeth.c",
"crypto/rand/drbg_ctr.c",
"crypto/rand/drbg_lib.c",
"crypto/rand/rand_egd.c",
"crypto/rand/rand_err.c",
"crypto/rand/rand_lib.c",
"crypto/rand/rand_unix.c",
"crypto/rand/rand_vms.c",
"crypto/rand/rand_win.c",
"crypto/rand/randfile.c",
"crypto/rc4/rc4_enc.c",
"crypto/rc4/rc4_skey.c",
"crypto/rsa/rsa_ameth.c",
"crypto/rsa/rsa_asn1.c",
"crypto/rsa/rsa_chk.c",
"crypto/rsa/rsa_crpt.c",
"crypto/rsa/rsa_depr.c",
"crypto/rsa/rsa_err.c",
"crypto/rsa/rsa_gen.c",
"crypto/rsa/rsa_lib.c",
"crypto/rsa/rsa_meth.c",
"crypto/rsa/rsa_mp.c",
"crypto/rsa/rsa_none.c",
"crypto/rsa/rsa_oaep.c",
"crypto/rsa/rsa_ossl.c",
"crypto/rsa/rsa_pk1.c",
"crypto/rsa/rsa_pmeth.c",
"crypto/rsa/rsa_prn.c",
"crypto/rsa/rsa_pss.c",
"crypto/rsa/rsa_saos.c",
"crypto/rsa/rsa_sign.c",
"crypto/rsa/rsa_ssl.c",
"crypto/rsa/rsa_x931.c",
"crypto/rsa/rsa_x931g.c",
"crypto/seed/seed.c",
"crypto/seed/seed_cbc.c",
"crypto/seed/seed_cfb.c",
"crypto/seed/seed_ecb.c",
"crypto/seed/seed_ofb.c",
"crypto/sha/sha1_one.c",
"crypto/sha/sha1dgst.c",
"crypto/sha/sha256.c",
"crypto/sha/sha512.c",
"crypto/siphash/siphash.c",
"crypto/siphash/siphash_ameth.c",
"crypto/siphash/siphash_pmeth.c",
"crypto/sm2/sm2_crypt.c",
"crypto/sm2/sm2_err.c",
"crypto/sm2/sm2_pmeth.c",
"crypto/sm2/sm2_sign.c",
"crypto/sm3/m_sm3.c",
"crypto/sm3/sm3.c",
"crypto/sm4/sm4.c",
"crypto/srp/srp_lib.c",
"crypto/srp/srp_vfy.c",
"crypto/stack/stack.c",
"crypto/store/loader_file.c",
"crypto/store/store_err.c",
"crypto/store/store_init.c",
"crypto/store/store_lib.c",
"crypto/store/store_register.c",
"crypto/store/store_strings.c",
"crypto/threads_none.c",
"crypto/threads_pthread.c",
"crypto/threads_win.c",
"crypto/ts/ts_asn1.c",
"crypto/ts/ts_conf.c",
"crypto/ts/ts_err.c",
"crypto/ts/ts_lib.c",
"crypto/ts/ts_req_print.c",
"crypto/ts/ts_req_utils.c",
"crypto/ts/ts_rsp_print.c",
"crypto/ts/ts_rsp_sign.c",
"crypto/ts/ts_rsp_utils.c",
"crypto/ts/ts_rsp_verify.c",
"crypto/ts/ts_verify_ctx.c",
"crypto/txt_db/txt_db.c",
"crypto/ui/ui_err.c",
"crypto/ui/ui_lib.c",
"crypto/ui/ui_null.c",
"crypto/ui/ui_openssl.c",
"crypto/ui/ui_util.c",
"crypto/uid.c",
"crypto/whrlpool/wp_block.c",
"crypto/whrlpool/wp_dgst.c",
"crypto/x509/by_dir.c",
"crypto/x509/by_file.c",
"crypto/x509/t_crl.c",
"crypto/x509/t_req.c",
"crypto/x509/t_x509.c",
"crypto/x509/x509_att.c",
"crypto/x509/x509_cmp.c",
"crypto/x509/x509_d2.c",
"crypto/x509/x509_def.c",
"crypto/x509/x509_err.c",
"crypto/x509/x509_ext.c",
"crypto/x509/x509_lu.c",
"crypto/x509/x509_meth.c",
"crypto/x509/x509_obj.c",
"crypto/x509/x509_r2x.c",
"crypto/x509/x509_req.c",
"crypto/x509/x509_set.c",
"crypto/x509/x509_trs.c",
"crypto/x509/x509_txt.c",
"crypto/x509/x509_v3.c",
"crypto/x509/x509_vfy.c",
"crypto/x509/x509_vpm.c",
"crypto/x509/x509cset.c",
"crypto/x509/x509name.c",
"crypto/x509/x509rset.c",
"crypto/x509/x509spki.c",
"crypto/x509/x509type.c",
"crypto/x509/x_all.c",
"crypto/x509/x_attrib.c",
"crypto/x509/x_crl.c",
"crypto/x509/x_exten.c",
"crypto/x509/x_name.c",
"crypto/x509/x_pubkey.c",
"crypto/x509/x_req.c",
"crypto/x509/x_x509.c",
"crypto/x509/x_x509a.c",
"crypto/x509v3/pcy_cache.c",
"crypto/x509v3/pcy_data.c",
"crypto/x509v3/pcy_lib.c",
"crypto/x509v3/pcy_map.c",
"crypto/x509v3/pcy_node.c",
"crypto/x509v3/pcy_tree.c",
"crypto/x509v3/v3_addr.c",
"crypto/x509v3/v3_admis.c",
"crypto/x509v3/v3_akey.c",
"crypto/x509v3/v3_akeya.c",
"crypto/x509v3/v3_alt.c",
"crypto/x509v3/v3_asid.c",
"crypto/x509v3/v3_bcons.c",
"crypto/x509v3/v3_bitst.c",
"crypto/x509v3/v3_conf.c",
"crypto/x509v3/v3_cpols.c",
"crypto/x509v3/v3_crld.c",
"crypto/x509v3/v3_enum.c",
"crypto/x509v3/v3_extku.c",
"crypto/x509v3/v3_genn.c",
"crypto/x509v3/v3_ia5.c",
"crypto/x509v3/v3_info.c",
"crypto/x509v3/v3_int.c",
"crypto/x509v3/v3_lib.c",
"crypto/x509v3/v3_ncons.c",
"crypto/x509v3/v3_pci.c",
"crypto/x509v3/v3_pcia.c",
"crypto/x509v3/v3_pcons.c",
"crypto/x509v3/v3_pku.c",
"crypto/x509v3/v3_pmaps.c",
"crypto/x509v3/v3_prn.c",
"crypto/x509v3/v3_purp.c",
"crypto/x509v3/v3_skey.c",
"crypto/x509v3/v3_sxnet.c",
"crypto/x509v3/v3_tlsf.c",
"crypto/x509v3/v3_utl.c",
"crypto/x509v3/v3err.c",
]
if (current_cpu == "arm" && !(current_os == "linux" || host_os == "mac")) {
sources += [
"crypto/aes/asm/arm32/aes-armv4.S",
"crypto/aes/asm/arm32/aesv8-armx.S",
"crypto/aes/asm/arm32/bsaes-armv7.S",
"crypto/armcap.c",
"crypto/armv4cpuid.S",
"crypto/bn/asm/arm32/armv4-gf2m.S",
"crypto/bn/asm/arm32/armv4-mont.S",
"crypto/chacha/asm/arm32/chacha-armv4.S",
"crypto/ec/asm/arm32/ecp_nistz256-armv4.S",
"crypto/ec/ecp_nistz256.c",
"crypto/modes/asm/arm32/ghash-armv4.S",
"crypto/modes/asm/arm32/ghashv8-armx.S",
"crypto/poly1305/asm/arm32/poly1305-armv4.S",
"crypto/sha/asm/arm32/keccak1600-armv4.S",
"crypto/sha/asm/arm32/sha1-armv4-large.S",
"crypto/sha/asm/arm32/sha256-armv4.S",
"crypto/sha/asm/arm32/sha512-armv4.S",
]
} else if (current_cpu == "arm64" &&
!(current_os == "linux" || host_os == "mac")) {
sources += [
"crypto/aes/aes_core.c",
"crypto/aes/asm/arm64/aesv8-armx.S",
"crypto/aes/asm/arm64/vpaes-armv8.S",
"crypto/arm64cpuid.S",
"crypto/armcap.c",
"crypto/bn/asm/arm64/armv8-mont.S",
"crypto/chacha/asm/arm64/chacha-armv8.S",
"crypto/ec/asm/arm64/ecp_nistz256-armv8.S",
"crypto/ec/ecp_nistz256.c",
"crypto/modes/asm/arm64/ghashv8-armx.S",
"crypto/poly1305/asm/arm64/poly1305-armv8.S",
"crypto/sha/asm/arm64/keccak1600-armv8.S",
"crypto/sha/asm/arm64/sha1-armv8.S",
"crypto/sha/asm/arm64/sha256-armv8.S",
"crypto/sha/asm/arm64/sha512-armv8.S",
]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
sources -= [
"crypto/rc4/rc4_enc.c",
"crypto/rc4/rc4_skey.c",
"crypto/whrlpool/wp_block.c",
]
sources += [
"crypto/aes/aes_core.c",
"crypto/aes/asm/x86_64/aesni-mb-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha1-x86_64.s",
"crypto/aes/asm/x86_64/aesni-sha256-x86_64.s",
"crypto/aes/asm/x86_64/aesni-x86_64.s",
"crypto/aes/asm/x86_64/vpaes-x86_64.s",
"crypto/bn/asm/x86_64/rsaz-avx2.s",
"crypto/bn/asm/x86_64/rsaz-x86_64.s",
"crypto/bn/asm/x86_64/x86_64-gf2m.s",
"crypto/bn/asm/x86_64/x86_64-mont.s",
"crypto/bn/asm/x86_64/x86_64-mont5.s",
"crypto/bn/rsaz_exp.c",
"crypto/chacha/asm/x86_64/chacha-x86_64.s",
"crypto/ec/asm/x86_64/ecp_nistz256-x86_64.s",
"crypto/ec/asm/x86_64/x25519-x86_64.s",
"crypto/ec/ecp_nistz256.c",
"crypto/md5/asm/x86_64/md5-x86_64.s",
"crypto/modes/asm/x86_64/aesni-gcm-x86_64.s",
"crypto/modes/asm/x86_64/ghash-x86_64.s",
"crypto/poly1305/asm/x86_64/poly1305-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-md5-x86_64.s",
"crypto/rc4/asm/x86_64/rc4-x86_64.s",
"crypto/sha/asm/x86_64/keccak1600-x86_64.s",
"crypto/sha/asm/x86_64/sha1-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha1-x86_64.s",
"crypto/sha/asm/x86_64/sha256-mb-x86_64.s",
"crypto/sha/asm/x86_64/sha256-x86_64.s",
"crypto/sha/asm/x86_64/sha512-x86_64.s",
"crypto/whrlpool/asm/x86_64/wp-x86_64.s",
"crypto/x86_64cpuid.s",
]
} else if (is_mingw || (current_os == "linux" || host_os == "mac")) {
sources += [
"crypto/aes/aes_core.c",
"crypto/bf/bf_cfb64.c",
"crypto/bf/bf_ecb.c",
"crypto/bf/bf_enc.c",
"crypto/bf/bf_ofb64.c",
"crypto/bf/bf_skey.c",
"crypto/camellia/camellia.c",
"crypto/camellia/cmll_cbc.c",
"crypto/camellia/cmll_cfb.c",
"crypto/camellia/cmll_ctr.c",
"crypto/camellia/cmll_ecb.c",
"crypto/camellia/cmll_misc.c",
"crypto/camellia/cmll_ofb.c",
"crypto/cast/c_cfb64.c",
"crypto/cast/c_ecb.c",
"crypto/cast/c_enc.c",
"crypto/cast/c_ofb64.c",
"crypto/cast/c_skey.c",
"crypto/chacha/chacha_enc.c",
"crypto/ct/ct_b64.c",
"crypto/ct/ct_err.c",
"crypto/ct/ct_log.c",
"crypto/ct/ct_oct.c",
"crypto/ct/ct_policy.c",
"crypto/ct/ct_prn.c",
"crypto/ct/ct_sct.c",
"crypto/ct/ct_sct_ctx.c",
"crypto/ct/ct_vfy.c",
"crypto/ct/ct_x509v3.c",
"crypto/mem_clr.c",
"crypto/rc2/rc2_cbc.c",
"crypto/rc2/rc2_ecb.c",
"crypto/rc2/rc2_skey.c",
"crypto/rc2/rc2cfb64.c",
"crypto/rc2/rc2ofb64.c",
"crypto/ripemd/rmd_dgst.c",
"crypto/ripemd/rmd_one.c",
"crypto/sha/keccak1600.c",
]
if (is_mingw) {
sources -= [
"crypto/idea/i_cbc.c",
"crypto/idea/i_cfb64.c",
"crypto/idea/i_ecb.c",
"crypto/idea/i_ofb64.c",
"crypto/idea/i_skey.c",
"crypto/mdc2/mdc2_one.c",
"crypto/mdc2/mdc2dgst.c",
]
}
} else {
sources += [
"crypto/aes/aes_core.c",
"crypto/chacha/chacha_enc.c",
"crypto/mem_clr.c",
"crypto/sha/keccak1600.c",
]
}
configs = [ ":crypto_config" ]
public_configs = [ ":crypto_config_public" ]
remove_configs = [ "//build/config/coverage:default_coverage" ]
}
ohos_static_library("libcrypto_static") {
deps = [ ":crypto_source" ]
public_configs = [ ":crypto_config_public" ]
complete_static_lib = true
remove_configs = [ "//build/config/coverage:default_coverage" ]
}
if (is_mingw || is_mac) {
ohos_shared_library("libcrypto_restool") {
if (is_mingw) {
lib_dirs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib" ]
libs = [ "ws2_32" ]
}
deps = [ ":crypto_source" ]
subsystem_name = "security"
part_name = "huks"
public_configs = [ ":crypto_config_public" ]
remove_configs = [ "//build/config/coverage:default_coverage" ]
install_images = [
"system",
"updater",
]
}
}
ohos_shared_library("libcrypto_shared") {
deps = [ ":crypto_source" ]
output_name = "libcrypto_openssl"
subsystem_name = "security"
part_name = "huks"
public_configs = [ ":crypto_config_public" ]
remove_configs = [ "//build/config/coverage:default_coverage" ]
install_images = [
"system",
"updater",
]
}
config("ssl_config") {
include_dirs = [
"./",
"./crypto/include",
"./include",
"./crypto/modes",
]
cflags = [
"-DNDEBUG",
"-DOPENSSL_NO_STATIC_ENGINE",
"-DOPENSSL_PIC",
"-Wall",
"-pthread",
"-fPIC",
"-DOPENSSL_USE_NODELETE",
"-DOPENSSLDIR=\"\"",
"-DENGINESDIR=\"\"",
"-DOPENSSL_NO_BF",
"-DOPENSSL_NO_CAMELLIA",
"-DOPENSSL_NO_CAST",
"-DOPENSSL_NO_CT",
"-DOPENSSL_NO_MD2",
"-DOPENSSL_NO_RC5",
"-DOPENSSL_NO_RC2",
"-DOPENSSL_NO_RIPEMD",
"-DOPENSSL_NO_RMD160",
"-DOPENSSL_NO_SSL2",
"-DOPENSSL_NO_SSL3",
"-DOPENSSL_NO_SSL3_METHOD",
]
if (current_cpu == "arm" && host_os != "mac") {
cflags += [ "-DOPENSSL_ARM_PLATFORM" ]
} else if (current_cpu == "arm64" &&
!(current_os == "linux" || host_os == "mac")) {
cflags += [ "-DOPENSSL_ARM64_PLATFORM" ]
} else if (current_cpu == "x86_64" && current_os != "mingw") {
cflags += [ "-DOPENSSL_X86_64_PLATFORM" ]
} else if (is_mingw) {
cflags -= [ "-fPIC" ]
cflags += [
"-m64",
"-DL_ENDIAN",
"-DUNICODE",
"-D_UNICODE",
"-DWIN32_LEAN_AND_MEAN",
"-D_MT",
"-MMD",
"-MF",
"-c",
]
defines = [ "WINDOWS_PLATFORM" ]
} else if (host_os == "mac") {
cflags += [
"-O3",
"-DL_ENDIAN",
"-D_REENTRAN",
"-MMD",
"-MF",
"-c",
]
defines = [ "MAC_PLATFORM" ]
} else {
cflags += [ "-DOPENSSL_ARM64_PLATFORM" ]
}
}
config("ssl_config_public") {
include_dirs = [ "//third_party/openssl/include" ]
}
ohos_source_set("ssl_source") {
sources = [
"ssl/bio_ssl.c",
"ssl/d1_lib.c",
"ssl/d1_msg.c",
"ssl/d1_srtp.c",
"ssl/methods.c",
"ssl/packet.c",
"ssl/pqueue.c",
"ssl/record/dtls1_bitmap.c",
"ssl/record/rec_layer_d1.c",
"ssl/record/rec_layer_s3.c",
"ssl/record/ssl3_buffer.c",
"ssl/record/ssl3_record.c",
"ssl/record/ssl3_record_tls13.c",
"ssl/s3_cbc.c",
"ssl/s3_enc.c",
"ssl/s3_lib.c",
"ssl/s3_msg.c",
"ssl/ssl_asn1.c",
"ssl/ssl_cert.c",
"ssl/ssl_ciph.c",
"ssl/ssl_conf.c",
"ssl/ssl_err.c",
"ssl/ssl_init.c",
"ssl/ssl_lib.c",
"ssl/ssl_mcnf.c",
"ssl/ssl_rsa.c",
"ssl/ssl_sess.c",
"ssl/ssl_stat.c",
"ssl/ssl_txt.c",
"ssl/ssl_utst.c",
"ssl/statem/extensions.c",
"ssl/statem/extensions_clnt.c",
"ssl/statem/extensions_cust.c",
"ssl/statem/extensions_srvr.c",
"ssl/statem/statem.c",
"ssl/statem/statem_clnt.c",
"ssl/statem/statem_dtls.c",
"ssl/statem/statem_lib.c",
"ssl/statem/statem_srvr.c",
"ssl/t1_enc.c",
"ssl/t1_lib.c",
"ssl/t1_trce.c",
"ssl/tls13_enc.c",
"ssl/tls_srp.c",
]
public_configs = [ ":ssl_config" ]
remove_configs = [ "//build/config/coverage:default_coverage" ]
}
ohos_shared_library("libssl_shared") {
deps = [
":crypto_source",
":ssl_source",
]
if (is_mingw) {
lib_dirs = [ "//prebuilts/mingw-w64/ohos/linux-x86_64/clang-mingw/x86_64-w64-mingw32/lib" ]
libs = [ "ws2_32" ]
}
output_name = "libssl_openssl"
subsystem_name = "developtools"
part_name = "profiler"
public_configs = [
":crypto_config_public",
":ssl_config_public",
]
remove_configs = [ "//build/config/coverage:default_coverage" ]
install_images = [ "system" ]
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/myopenharmony/third_party_openssl.git
git@gitee.com:myopenharmony/third_party_openssl.git
myopenharmony
third_party_openssl
third_party_openssl
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385