From 4f45966ee95be4c64fe9c99e94f52cc71bd932e0 Mon Sep 17 00:00:00 2001 From: mamingshuai Date: Thu, 11 Mar 2021 20:38:52 +0800 Subject: [PATCH] update openharmony 1.0.1 --- .gitattributes | 0 .github/PULL_REQUEST_TEMPLATE.md | 0 .gitmodules | 0 .travis-apt-pin.preferences | 0 .travis.yml | 0 BUILD.gn | 979 ++++++++++++++++++++++++- COPYRIGHT.OpenSource | 134 ++++ README.ASM | 0 README.OpenSource | 11 + crypto/buildinf.h | 89 +++ crypto/err/openssl.txt | 3 +- crypto/evp/evp_enc.c | 27 + crypto/evp/evp_err.c | 4 +- crypto/sha/sha512-armv8.S | 2 +- crypto/x509/x509_cmp.c | 2 + crypto/x509v3/v3_genn.c | 45 +- doc/man3/EVP_PKEY_size.pod | 0 doc/man3/X509_LOOKUP.pod | 0 doc/man7/proxy-certificates.pod | 0 include/crypto/bn_conf.h | 46 ++ include/crypto/dso_conf.h | 23 + include/openssl/evperr.h | 7 +- include/openssl/opensslconf.h | 396 ++++++++++ test/certs/root-ed448-cert.pem | 0 test/certs/root-ed448-key.pem | 0 test/recipes/10-test_bn_data/bngcd.txt | 0 test/ssl_ctx_test.c | 0 util/fix-includes.sed | 0 28 files changed, 1722 insertions(+), 46 deletions(-) mode change 100755 => 100644 .gitattributes mode change 100755 => 100644 .github/PULL_REQUEST_TEMPLATE.md mode change 100755 => 100644 .gitmodules mode change 100755 => 100644 .travis-apt-pin.preferences mode change 100755 => 100644 .travis.yml mode change 100755 => 100644 BUILD.gn create mode 100755 COPYRIGHT.OpenSource mode change 100755 => 100644 README.ASM create mode 100755 README.OpenSource create mode 100644 crypto/buildinf.h mode change 100755 => 100644 doc/man3/EVP_PKEY_size.pod mode change 100755 => 100644 doc/man3/X509_LOOKUP.pod mode change 100755 => 100644 doc/man7/proxy-certificates.pod mode change 100755 => 100644 include/crypto/bn_conf.h mode change 100755 => 100644 include/crypto/dso_conf.h mode change 100755 => 100644 include/openssl/opensslconf.h mode change 100755 => 100644 test/certs/root-ed448-cert.pem mode change 100755 => 100644 test/certs/root-ed448-key.pem mode change 100755 => 100644 test/recipes/10-test_bn_data/bngcd.txt mode change 100755 => 100644 test/ssl_ctx_test.c mode change 100755 => 100644 util/fix-includes.sed diff --git a/.gitattributes b/.gitattributes old mode 100755 new mode 100644 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md old mode 100755 new mode 100644 diff --git a/.gitmodules b/.gitmodules old mode 100755 new mode 100644 diff --git a/.travis-apt-pin.preferences b/.travis-apt-pin.preferences old mode 100755 new mode 100644 diff --git a/.travis.yml b/.travis.yml old mode 100755 new mode 100644 diff --git a/BUILD.gn b/BUILD.gn old mode 100755 new mode 100644 index fa5c8a4453..650c457ecc --- a/BUILD.gn +++ b/BUILD.gn @@ -1,45 +1,952 @@ -# Copyright (c) 2020 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/lite/config/component/lite_component.gni") - -config("openssl_config") { - include_dirs = [ - "include", - "crypto/include", - "crypto/ec", - "." +# Copyright (C) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved. + +import("//build/ohos.gni") + +# Only use this to set/unset some cflags, use "platform" variable in gn template to add +# source code for Windows. +use_mingw_win = "${current_os}_${current_cpu}" == "mingw_x86_64" + +config("crypto_config") { + include_dirs = [ + "./", + "./crypto", + "./include", + "./crypto/modes", + "./crypto/ec/curve448", + "./crypto/ec/curve448/arch_32", + ] + cflags = [ + "-Wall", + "-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 (target_cpu == "arm" && !use_mingw_win && 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 (target_cpu == "arm64" && !use_mingw_win && 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 (use_mingw_win) { + cflags -= [ + "-fPIC", + "-DOPENSSL_NO_BF", + "-DOPENSSL_NO_CAMELLIA", + "-DOPENSSL_NO_CAST", + "-DOPENSSL_NO_CT", + "-DOPENSSL_NO_RC2", + "-DOPENSSL_NO_RMD160", + ] + cflags += [ + "-m64", + "-DL_ENDIAN", + "-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", + ] + defines = [ "WINDOWS_PLATFORM" ] + } else if (host_os == "mac") { + cflags -= [ + "-DOPENSSL_NO_BF", + "-DOPENSSL_NO_CAMELLIA", + "-DOPENSSL_NO_CAST", + "-DOPENSSL_NO_CT", + "-DOPENSSL_NO_RC2", + "-DOPENSSL_NO_RMD160", ] + cflags += [ + "-DL_ENDIAN", + "-D_REENTRAN", + "-MMD", + "-MF", + "-c", + ] + defines = [ "MAC_PLATFORM" ] + } else { + cflags += [ "-DOPENSSL_NO_ASM" ] + } +} + +config("crypto_config_public") { + include_dirs = [ "./include" ] + + if (target_cpu == "arm") { + cflags = [ "-DCPU_ARM32" ] + } } -openssl_source = [ - "crypto/cryptlib.c", - "crypto/ec/curve25519.c", - "crypto/mem_clr.c", - "crypto/sha/sha512.c", -] +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", + ] -shared_library("openssl_shared") { - sources = openssl_source - public_configs = [ - ":openssl_config" + if (target_cpu == "arm" && !use_mingw_win && 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/armv4-gf2m.S", + "crypto/bn/armv4-mont.S", + "crypto/chacha/chacha-armv4.S", + "crypto/ec/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/poly1305-armv4.S", + "crypto/sha/keccak1600-armv4.S", + "crypto/sha/sha1-armv4-large.S", + "crypto/sha/sha256-armv4.S", + "crypto/sha/sha512-armv4.S", + ] + } else if (target_cpu == "arm64" && !use_mingw_win && 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/armv8-mont.S", + "crypto/chacha/chacha-armv8.S", + "crypto/ec/ecp_nistz256-armv8.S", + "crypto/ec/ecp_nistz256.c", + "crypto/modes/asm/arm64/ghashv8-armx.S", + "crypto/poly1305/poly1305-armv8.S", + "crypto/sha/keccak1600-armv8.S", + "crypto/sha/sha1-armv8.S", + "crypto/sha/sha256-armv8.S", + "crypto/sha/sha512-armv8.S", + ] + } else if (use_mingw_win || 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 (use_mingw_win) { + 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", + ":crypto_config_public", + ] + + remove_configs = [ "//build/config/coverage:default_coverage" ] } -static_library("openssl_static") { - sources = openssl_source - public_configs = [ - ":openssl_config" +ohos_static_library("libcrypto_static") { + deps = [ ":crypto_source" ] + public_configs = [ ":crypto_config_public" ] + complete_static_lib = true + remove_configs = [ "//build/config/coverage:default_coverage" ] +} + +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 (use_mingw_win) { + cflags -= [ "-fPIC" ] + cflags += [ + "-m64", + "-DL_ENDIAN", + "-DUNICODE", + "-D_UNICODE", + "-DWIN32_LEAN_AND_MEAN", + "-D_MT", + "-MMD", + "-MF", + "-c", ] - output_name = "openssl" + defines = [ "WINDOWS_PLATFORM" ] + } else if (host_os == "mac") { + cflags += [ + "-O3", + "-DL_ENDIAN", + "-D_REENTRAN", + "-MMD", + "-MF", + "-c", + ] + defines = [ "MAC_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", + ] + + configs = [ ":ssl_config" ] + remove_configs = [ "//build/config/coverage:default_coverage" ] } diff --git a/COPYRIGHT.OpenSource b/COPYRIGHT.OpenSource new file mode 100755 index 0000000000..24f6e73019 --- /dev/null +++ b/COPYRIGHT.OpenSource @@ -0,0 +1,134 @@ +Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2012-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2011-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. +Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2007-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2017 Ribose Inc. All Rights Reserved. +Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1998-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1998-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright (C) 2017 National Security Research Institute. All Rights Reserved. +Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2012, Samuel Neves +Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2011-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2011-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved +Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2014-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2004, Richard Levitte +Copyright 2003-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2018-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2005-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2017 BaishanCloud. All rights reserved. +Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2005-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc. +Copyright 2012-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2005 Nokia. All rights reserved. +Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2004, EdelKey Project. All Rights Reserved. +Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2004-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2012, Intel Corporation. All Rights Reserved. +Copyright 2013-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright Patrick Powell 1995 +Copyright (c) 2017 National Security Research Institute. All rights reserved. +Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2013-2014 Timo Teräs +Copyright 1998-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2016 VMS Software, Inc. All Rights Reserved. +Copyright 2012-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1998-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2011-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2011 Google Inc. +Copyright 2014-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2014, Intel Corporation. All Rights Reserved. +Copyright (c) 2015, CloudFlare, Inc. +Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2011-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2002-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved. +Copyright 2007-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2003-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2004 Kungliga Tekniska Högskolan +Copyright 2013-2017 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2016 Viktor Dukhovni . +Copyright 1998-2001 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2015-2016 Cryptography Research, Inc. +Copyright 2015 Cryptography Research, Inc. +Copyright 2017-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2014 Cryptography Research, Inc. +Copyright 2016 Cryptography Research, Inc. +Copyright 2014-2016 Cryptography Research, Inc. +Copyright 2006 NTT (Nippon Telegraph and Telephone Corporation) . +Copyright 1998-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 2004, 2018, Richard Levitte +Copyright 2004-2014, Akamai Technologies. All Rights Reserved. +Copyright 2003-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2009-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2010-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2005-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2012-2016 The OpenSSL Project Authors. All Rights Reserved. +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +Copyright (C) 19yy +Copyright 2008-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2008-2020 The OpenSSL Project Authors. All Rights Reserved. +Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +Copyright (c) 1998-2020 The OpenSSL Project +Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson +Copyright (c) 2012-2016 Jean-Philippe Aumasson +Copyright (c) 2012-2014 Daniel J. Bernstein +Copyright 2013-2019 The OpenSSL Project Authors. All Rights Reserved. +Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved. +Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. \ No newline at end of file diff --git a/README.ASM b/README.ASM old mode 100755 new mode 100644 diff --git a/README.OpenSource b/README.OpenSource new file mode 100755 index 0000000000..a9ea3980d5 --- /dev/null +++ b/README.OpenSource @@ -0,0 +1,11 @@ +[ + { + "Name": "OpenSSL", + "License": "OpenSSL License and Original SSLeay License", + "License File": "LICENSE", + "Version Number": "1.1.1f", + "Owner": "huangjun42@huawei.com", + "Upstream URL": "https://github.com/openssl/openssl/releases/tag/OpenSSL_1_1_1f", + "Description": "implementing the Transport Layer Security (TLS) protocols (including SSLv3) as well as a full-strength general purpose cryptographic library" + } +] \ No newline at end of file diff --git a/crypto/buildinf.h b/crypto/buildinf.h new file mode 100644 index 0000000000..0965d5bbb8 --- /dev/null +++ b/crypto/buildinf.h @@ -0,0 +1,89 @@ +/* + * WARNING: do not edit! + * Generated by util/mkbuildinf.pl + * + * Copyright 2014-2017 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#if !defined(WINDOWS_PLATFORM) && !defined(MAC_PLATFORM) + +#define PLATFORM "platform: android-arm64" +#define DATE "built on: Thu Jun 11 07:45:56 2020 UTC" + +/* + * Generate compiler_flags as an array of individual characters. This is a + * workaround for the situation where CFLAGS gets too long for a C90 string + * literal + */ +static const char compiler_flags[] = { + 'c','o','m','p','i','l','e','r',':',' ','a','a','r','c','h','6', + '4','-','l','i','n','u','x','-','a','n','d','r','o','i','d','-', + 'c','l','a','n','g',' ','-','f','P','I','C',' ','-','p','t','h', + 'r','e','a','d',' ',' ','-','-','s','y','s','r','o','o','t','=', + '/','h','o','m','e','/','h','j','a','d','m','i','n','/','m','y', + '-','a','n','d','r','o','i','d','6','4','-','t','o','o','l','c', + 'h','a','i','n','/','s','y','s','r','o','o','t',' ','-','W','a', + ',','-','-','n','o','e','x','e','c','s','t','a','c','k',' ','-', + 'Q','u','n','u','s','e','d','-','a','r','g','u','m','e','n','t', + 's',' ','-','W','a','l','l',' ','-','O','3',' ','-','D','O','P', + 'E','N','S','S','L','_','U','S','E','_','N','O','D','E','L','E', + 'T','E',' ','-','D','O','P','E','N','S','S','L','_','P','I','C', + ' ','-','D','O','P','E','N','S','S','L','_','C','P','U','I','D', + '_','O','B','J',' ','-','D','O','P','E','N','S','S','L','_','B', + 'N','_','A','S','M','_','M','O','N','T',' ','-','D','S','H','A', + '1','_','A','S','M',' ','-','D','S','H','A','2','5','6','_','A', + 'S','M',' ','-','D','S','H','A','5','1','2','_','A','S','M',' ', + '-','D','K','E','C','C','A','K','1','6','0','0','_','A','S','M', + ' ','-','D','V','P','A','E','S','_','A','S','M',' ','-','D','E', + 'C','P','_','N','I','S','T','Z','2','5','6','_','A','S','M',' ', + '-','D','P','O','L','Y','1','3','0','5','_','A','S','M',' ','-', + 'D','N','D','E','B','U','G','\0' +}; + +// defines for windows +#elif defined(WINDOWS_PLATFORM) + +#define PLATFORM "platform: mingw64" +#define DATE "built on: Mon Nov 9 09:38:38 2020 UTC" + +/* + * Generate compiler_flags as an array of individual characters. This is a + * workaround for the situation where CFLAGS gets too long for a C90 string + * literal + */ +static const char compiler_flags[] = { + 'c','o','m','p','i','l','e','r',':',' ','g','c','c',' ','-','m', + '6','4',' ','-','W','a','l','l',' ','-','O','3',' ','-','D','L', + '_','E','N','D','I','A','N',' ','-','D','O','P','E','N','S','S', + 'L','_','P','I','C',' ','-','D','U','N','I','C','O','D','E',' ', + '-','D','_','U','N','I','C','O','D','E',' ','-','D','W','I','N', + '3','2','_','L','E','A','N','_','A','N','D','_','M','E','A','N', + ' ','-','D','_','M','T',' ','-','D','N','D','E','B','U','G','\0' +}; + +// defines for mac +#elif defined(MAC_PLATFORM) + +#define PLATFORM "platform: darwin64-x86_64-cc" +#define DATE "built on: Fri Nov 27 07:15:02 2020 UTC" + +/* + * Generate compiler_flags as an array of individual characters. This is a + * workaround for the situation where CFLAGS gets too long for a C90 string + * literal + */ +static const char compiler_flags[] = { + 'c','o','m','p','i','l','e','r',':',' ','c','c',' ','-','f','P', + 'I','C',' ','-','a','r','c','h',' ','x','8','6','_','6','4',' ', + '-','O','3',' ','-','W','a','l','l',' ','-','D','L','_','E','N', + 'D','I','A','N',' ','-','D','O','P','E','N','S','S','L','_','P', + 'I','C',' ','-','D','_','R','E','E','N','T','R','A','N','T',' ', + '-','D','N','D','E','B','U','G','\0' +}; + +#endif diff --git a/crypto/err/openssl.txt b/crypto/err/openssl.txt index 35512f9caf..dd7b455f84 100755 --- a/crypto/err/openssl.txt +++ b/crypto/err/openssl.txt @@ -1,4 +1,4 @@ -# Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved. +# Copyright 1999-2021 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy @@ -2277,6 +2277,7 @@ EVP_R_ONLY_ONESHOT_SUPPORTED:177:only oneshot supported EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE:150:\ operation not supported for this keytype EVP_R_OPERATON_NOT_INITIALIZED:151:operaton not initialized +EVP_R_OUTPUT_WOULD_OVERFLOW:184:output would overflow EVP_R_PARTIALLY_OVERLAPPING:162:partially overlapping buffers EVP_R_PBKDF2_ERROR:181:pbkdf2 error EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED:179:\ diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index b9b6490fe0..0843caf4f0 100755 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -8,6 +8,7 @@ */ #include +#include #include #include "internal/cryptlib.h" #include @@ -355,6 +356,19 @@ static int evp_EncryptDecryptUpdate(EVP_CIPHER_CTX *ctx, return 1; } else { j = bl - i; + + /* + * Once we've processed the first j bytes from in, the amount of + * data left that is a multiple of the block length is: + * (inl - j) & ~(bl - 1) + * We must ensure that this amount of data, plus the one block that + * we process from ctx->buf does not exceed INT_MAX + */ + if (((inl - j) & ~(bl - 1)) > INT_MAX - bl) { + EVPerr(EVP_F_EVP_ENCRYPTDECRYPTUPDATE, + EVP_R_OUTPUT_WOULD_OVERFLOW); + return 0; + } memcpy(&(ctx->buf[i]), in, j); inl -= j; in += j; @@ -502,6 +516,19 @@ int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_PARTIALLY_OVERLAPPING); return 0; } + /* + * final_used is only ever set if buf_len is 0. Therefore the maximum + * length output we will ever see from evp_EncryptDecryptUpdate is + * the maximum multiple of the block length that is <= inl, or just: + * inl & ~(b - 1) + * Since final_used has been set then the final output length is: + * (inl & ~(b - 1)) + b + * This must never exceed INT_MAX + */ + if ((inl & ~(b - 1)) > INT_MAX - b) { + EVPerr(EVP_F_EVP_DECRYPTUPDATE, EVP_R_OUTPUT_WOULD_OVERFLOW); + return 0; + } memcpy(out, ctx->final, b); out += b; fix_len = 1; diff --git a/crypto/evp/evp_err.c b/crypto/evp/evp_err.c index 05481d827f..32ac0125de 100755 --- a/crypto/evp/evp_err.c +++ b/crypto/evp/evp_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -239,6 +239,8 @@ static const ERR_STRING_DATA EVP_str_reasons[] = { "operation not supported for this keytype"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OPERATON_NOT_INITIALIZED), "operaton not initialized"}, + {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_OUTPUT_WOULD_OVERFLOW), + "output would overflow"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PARTIALLY_OVERLAPPING), "partially overlapping buffers"}, {ERR_PACK(ERR_LIB_EVP, 0, EVP_R_PBKDF2_ERROR), "pbkdf2 error"}, diff --git a/crypto/sha/sha512-armv8.S b/crypto/sha/sha512-armv8.S index e86b69f011..9ad03da17f 100755 --- a/crypto/sha/sha512-armv8.S +++ b/crypto/sha/sha512-armv8.S @@ -1616,5 +1616,5 @@ sha512_block_armv8: .size sha512_block_armv8,.-sha512_block_armv8 #endif #ifndef __KERNEL__ -.comm OPENSSL_armcap_P,4,4 +.hidden OPENSSL_armcap_P #endif diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c index d1600e1e8d..99920e2997 100755 --- a/crypto/x509/x509_cmp.c +++ b/crypto/x509/x509_cmp.c @@ -39,6 +39,8 @@ unsigned long X509_issuer_and_serial_hash(X509 *a) if (ctx == NULL) goto err; f = X509_NAME_oneline(a->cert_info.issuer, NULL, 0); + if (f == NULL) + goto err; if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL)) goto err; if (!EVP_DigestUpdate(ctx, (unsigned char *)f, strlen(f))) diff --git a/crypto/x509v3/v3_genn.c b/crypto/x509v3/v3_genn.c index 23e3bc4565..23778e2506 100755 --- a/crypto/x509v3/v3_genn.c +++ b/crypto/x509v3/v3_genn.c @@ -57,6 +57,37 @@ GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a) (char *)a); } +static int edipartyname_cmp(const EDIPARTYNAME *a, const EDIPARTYNAME *b) +{ + int res; + + if (a == NULL || b == NULL) { + /* + * Shouldn't be possible in a valid GENERAL_NAME, but we handle it + * anyway. OTHERNAME_cmp treats NULL != NULL so we do the same here + */ + return -1; + } + if (a->nameAssigner == NULL && b->nameAssigner != NULL) + return -1; + if (a->nameAssigner != NULL && b->nameAssigner == NULL) + return 1; + /* If we get here then both have nameAssigner set, or both unset */ + if (a->nameAssigner != NULL) { + res = ASN1_STRING_cmp(a->nameAssigner, b->nameAssigner); + if (res != 0) + return res; + } + /* + * partyName is required, so these should never be NULL. We treat it in + * the same way as the a == NULL || b == NULL case above + */ + if (a->partyName == NULL || b->partyName == NULL) + return -1; + + return ASN1_STRING_cmp(a->partyName, b->partyName); +} + /* Returns 0 if they are equal, != 0 otherwise. */ int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) { @@ -66,8 +97,11 @@ int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) return -1; switch (a->type) { case GEN_X400: + result = ASN1_TYPE_cmp(a->d.x400Address, b->d.x400Address); + break; + case GEN_EDIPARTY: - result = ASN1_TYPE_cmp(a->d.other, b->d.other); + result = edipartyname_cmp(a->d.ediPartyName, b->d.ediPartyName); break; case GEN_OTHERNAME: @@ -114,8 +148,11 @@ void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value) { switch (type) { case GEN_X400: + a->d.x400Address = value; + break; + case GEN_EDIPARTY: - a->d.other = value; + a->d.ediPartyName = value; break; case GEN_OTHERNAME: @@ -149,8 +186,10 @@ void *GENERAL_NAME_get0_value(const GENERAL_NAME *a, int *ptype) *ptype = a->type; switch (a->type) { case GEN_X400: + return a->d.x400Address; + case GEN_EDIPARTY: - return a->d.other; + return a->d.ediPartyName; case GEN_OTHERNAME: return a->d.otherName; diff --git a/doc/man3/EVP_PKEY_size.pod b/doc/man3/EVP_PKEY_size.pod old mode 100755 new mode 100644 diff --git a/doc/man3/X509_LOOKUP.pod b/doc/man3/X509_LOOKUP.pod old mode 100755 new mode 100644 diff --git a/doc/man7/proxy-certificates.pod b/doc/man7/proxy-certificates.pod old mode 100755 new mode 100644 diff --git a/include/crypto/bn_conf.h b/include/crypto/bn_conf.h old mode 100755 new mode 100644 index 411a1893d5..9ced8fb45a --- a/include/crypto/bn_conf.h +++ b/include/crypto/bn_conf.h @@ -9,6 +9,8 @@ * https://www.openssl.org/source/license.html */ +#if !defined(WINDOWS_PLATFORM) && !defined(MAC_PLATFORM) + #ifndef OSSL_CRYPTO_BN_CONF_H # define OSSL_CRYPTO_BN_CONF_H @@ -31,3 +33,47 @@ #undef THIRTY_TWO_BIT #endif #endif + +// defines for windows +#elif defined(WINDOWS_PLATFORM) + +#ifndef OSSL_CRYPTO_BN_CONF_H +# define OSSL_CRYPTO_BN_CONF_H + +/* + * The contents of this file are not used in the UEFI build, as + * both 32-bit and 64-bit builds are supported from a single run + * of the Configure script. + */ + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#undef SIXTY_FOUR_BIT_LONG +#define SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT + +#endif + +// defines for mac +#elif defined(MAC_PLATFORM) + +#ifndef OSSL_CRYPTO_BN_CONF_H +# define OSSL_CRYPTO_BN_CONF_H + +/* + * The contents of this file are not used in the UEFI build, as + * both 32-bit and 64-bit builds are supported from a single run + * of the Configure script. + */ + +/* Should we define BN_DIV2W here? */ + +/* Only one for the following should be defined */ +#define SIXTY_FOUR_BIT_LONG +#undef SIXTY_FOUR_BIT +#undef THIRTY_TWO_BIT + +#endif + +#endif diff --git a/include/crypto/dso_conf.h b/include/crypto/dso_conf.h old mode 100755 new mode 100644 index 4b1167c3d8..01ec0a7f13 --- a/include/crypto/dso_conf.h +++ b/include/crypto/dso_conf.h @@ -9,9 +9,32 @@ * https://www.openssl.org/source/license.html */ +#if !defined(WINDOWS_PLATFORM) && !defined(MAC_PLATFORM) + #ifndef OSSL_CRYPTO_DSO_CONF_H # define OSSL_CRYPTO_DSO_CONF_H # define DSO_DLFCN # define HAVE_DLFCN_H # define DSO_EXTENSION ".so" #endif + +// defines for windows +#elif defined(WINDOWS_PLATFORM) + +#ifndef OSSL_CRYPTO_DSO_CONF_H +# define OSSL_CRYPTO_DSO_CONF_H +# define DSO_WIN32 +# define DSO_EXTENSION ".dll" +#endif + +// defines for mac +#elif defined(MAC_PLATFORM) + +#ifndef OSSL_CRYPTO_DSO_CONF_H +# define OSSL_CRYPTO_DSO_CONF_H +# define DSO_DLFCN +# define HAVE_DLFCN_H +# define DSO_EXTENSION ".dylib" +#endif + +#endif diff --git a/include/openssl/evperr.h b/include/openssl/evperr.h index d2b26ea582..b4ea90ae9d 100755 --- a/include/openssl/evperr.h +++ b/include/openssl/evperr.h @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -11,9 +11,7 @@ #ifndef HEADER_EVPERR_H # define HEADER_EVPERR_H -# ifndef HEADER_SYMHACKS_H -# include -# endif +# include # ifdef __cplusplus extern "C" @@ -179,6 +177,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_ONLY_ONESHOT_SUPPORTED 177 # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 +# define EVP_R_OUTPUT_WOULD_OVERFLOW 184 # define EVP_R_PARTIALLY_OVERLAPPING 162 # define EVP_R_PBKDF2_ERROR 181 # define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 179 diff --git a/include/openssl/opensslconf.h b/include/openssl/opensslconf.h old mode 100755 new mode 100644 index 61307e72e5..578ad23a1b --- a/include/openssl/opensslconf.h +++ b/include/openssl/opensslconf.h @@ -10,6 +10,8 @@ * https://www.openssl.org/source/license.html */ +#if !defined(WINDOWS_PLATFORM) && !defined(MAC_PLATFORM) + #include #ifdef __cplusplus @@ -219,3 +221,397 @@ extern "C" { #ifdef __cplusplus } #endif + +// defines for windows +#elif defined(WINDOWS_PLATFORM) + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_ALGORITHM_DEFINES +# error OPENSSL_ALGORITHM_DEFINES no longer supported +#endif + +/* + * OpenSSL was configured with the following options: + */ + +#ifndef OPENSSL_SYS_MINGW64 +# define OPENSSL_SYS_MINGW64 1 +#endif +#ifndef OPENSSL_NO_IDEA +# define OPENSSL_NO_IDEA +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_MDC2 +# define OPENSSL_NO_MDC2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_RAND_SEED_OS +# define OPENSSL_RAND_SEED_OS +#endif +#ifndef OPENSSL_NO_AFALGENG +# define OPENSSL_NO_AFALGENG +#endif +#ifndef OPENSSL_NO_ASAN +# define OPENSSL_NO_ASAN +#endif +#ifndef OPENSSL_NO_ASM +# define OPENSSL_NO_ASM +#endif +#ifndef OPENSSL_NO_CRYPTO_MDEBUG +# define OPENSSL_NO_CRYPTO_MDEBUG +#endif +#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +#endif +#ifndef OPENSSL_NO_DEVCRYPTOENG +# define OPENSSL_NO_DEVCRYPTOENG +#endif +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_EGD +# define OPENSSL_NO_EGD +#endif +#ifndef OPENSSL_NO_EXTERNAL_TESTS +# define OPENSSL_NO_EXTERNAL_TESTS +#endif +#ifndef OPENSSL_NO_FUZZ_AFL +# define OPENSSL_NO_FUZZ_AFL +#endif +#ifndef OPENSSL_NO_FUZZ_LIBFUZZER +# define OPENSSL_NO_FUZZ_LIBFUZZER +#endif +#ifndef OPENSSL_NO_HEARTBEATS +# define OPENSSL_NO_HEARTBEATS +#endif +#ifndef OPENSSL_NO_MSAN +# define OPENSSL_NO_MSAN +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL3 +# define OPENSSL_NO_SSL3 +#endif +#ifndef OPENSSL_NO_SSL3_METHOD +# define OPENSSL_NO_SSL3_METHOD +#endif +#ifndef OPENSSL_NO_UBSAN +# define OPENSSL_NO_UBSAN +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + + +/* + * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers + * don't like that. This will hopefully silence them. + */ +#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; + +/* + * Applications should use -DOPENSSL_API_COMPAT= to suppress the + * declarations of functions deprecated in or before . Otherwise, they + * still won't see them if the library has been built to disable deprecated + * functions. + */ +#ifndef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +#endif + +#ifndef OPENSSL_FILE +# ifdef OPENSSL_NO_FILENAMES +# define OPENSSL_FILE "" +# define OPENSSL_LINE 0 +# else +# define OPENSSL_FILE __FILE__ +# define OPENSSL_LINE __LINE__ +# endif +#endif + +#ifndef OPENSSL_MIN_API +# define OPENSSL_MIN_API 0 +#endif + +#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API +# undef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT OPENSSL_MIN_API +#endif + +/* + * Do not deprecate things to be deprecated in version 1.2.0 before the + * OpenSSL version number matches. + */ +#if OPENSSL_VERSION_NUMBER < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) f; +#elif OPENSSL_API_COMPAT < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_2_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10100000L +# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_1_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10000000L +# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_0_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x00908000L +# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_0_9_8(f) +#endif + +/* Generate 80386 code? */ +#undef I386_ONLY + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#define OPENSSL_EXPORT_VAR_AS_FUNCTION + +/* + * The following are cipher-specific, but are part of the public API. + */ +#if !defined(OPENSSL_SYS_UEFI) +# undef BN_LLONG +/* Only one for the following should be defined */ +# undef SIXTY_FOUR_BIT_LONG +# define SIXTY_FOUR_BIT +# undef THIRTY_TWO_BIT +#endif + +#define RC4_INT unsigned int + +#ifdef __cplusplus +} +#endif + +// defines for mac +#elif defined(MAC_PLATFORM) + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef OPENSSL_ALGORITHM_DEFINES +# error OPENSSL_ALGORITHM_DEFINES no longer supported +#endif + +/* + * OpenSSL was configured with the following options: + */ + +#ifndef OPENSSL_SYS_MACOSX +# define OPENSSL_SYS_MACOSX 1 +#endif +#ifndef OPENSSL_NO_MD2 +# define OPENSSL_NO_MD2 +#endif +#ifndef OPENSSL_NO_RC5 +# define OPENSSL_NO_RC5 +#endif +#ifndef OPENSSL_THREADS +# define OPENSSL_THREADS +#endif +#ifndef OPENSSL_RAND_SEED_OS +# define OPENSSL_RAND_SEED_OS +#endif +#ifndef OPENSSL_NO_AFALGENG +# define OPENSSL_NO_AFALGENG +#endif +#ifndef OPENSSL_NO_ASAN +# define OPENSSL_NO_ASAN +#endif +#ifndef OPENSSL_NO_ASM +# define OPENSSL_NO_ASM +#endif +#ifndef OPENSSL_NO_CRYPTO_MDEBUG +# define OPENSSL_NO_CRYPTO_MDEBUG +#endif +#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE +#endif +#ifndef OPENSSL_NO_DEVCRYPTOENG +# define OPENSSL_NO_DEVCRYPTOENG +#endif +#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 +# define OPENSSL_NO_EC_NISTP_64_GCC_128 +#endif +#ifndef OPENSSL_NO_EGD +# define OPENSSL_NO_EGD +#endif +#ifndef OPENSSL_NO_EXTERNAL_TESTS +# define OPENSSL_NO_EXTERNAL_TESTS +#endif +#ifndef OPENSSL_NO_FUZZ_AFL +# define OPENSSL_NO_FUZZ_AFL +#endif +#ifndef OPENSSL_NO_FUZZ_LIBFUZZER +# define OPENSSL_NO_FUZZ_LIBFUZZER +#endif +#ifndef OPENSSL_NO_HEARTBEATS +# define OPENSSL_NO_HEARTBEATS +#endif +#ifndef OPENSSL_NO_MSAN +# define OPENSSL_NO_MSAN +#endif +#ifndef OPENSSL_NO_SCTP +# define OPENSSL_NO_SCTP +#endif +#ifndef OPENSSL_NO_SSL_TRACE +# define OPENSSL_NO_SSL_TRACE +#endif +#ifndef OPENSSL_NO_SSL3 +# define OPENSSL_NO_SSL3 +#endif +#ifndef OPENSSL_NO_SSL3_METHOD +# define OPENSSL_NO_SSL3_METHOD +#endif +#ifndef OPENSSL_NO_UBSAN +# define OPENSSL_NO_UBSAN +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#endif +#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS +# define OPENSSL_NO_WEAK_SSL_CIPHERS +#endif +#ifndef OPENSSL_NO_STATIC_ENGINE +# define OPENSSL_NO_STATIC_ENGINE +#endif + + +/* + * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers + * don't like that. This will hopefully silence them. + */ +#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; + +/* + * Applications should use -DOPENSSL_API_COMPAT= to suppress the + * declarations of functions deprecated in or before . Otherwise, they + * still won't see them if the library has been built to disable deprecated + * functions. + */ +#ifndef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +#endif + +#ifndef OPENSSL_FILE +# ifdef OPENSSL_NO_FILENAMES +# define OPENSSL_FILE "" +# define OPENSSL_LINE 0 +# else +# define OPENSSL_FILE __FILE__ +# define OPENSSL_LINE __LINE__ +# endif +#endif + +#ifndef OPENSSL_MIN_API +# define OPENSSL_MIN_API 0 +#endif + +#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API +# undef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT OPENSSL_MIN_API +#endif + +/* + * Do not deprecate things to be deprecated in version 1.2.0 before the + * OpenSSL version number matches. + */ +#if OPENSSL_VERSION_NUMBER < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) f; +#elif OPENSSL_API_COMPAT < 0x10200000L +# define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_2_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10100000L +# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_1_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x10000000L +# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_1_0_0(f) +#endif + +#if OPENSSL_API_COMPAT < 0x00908000L +# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) +#else +# define DEPRECATEDIN_0_9_8(f) +#endif + +/* Generate 80386 code? */ +#undef I386_ONLY + +#undef OPENSSL_UNISTD +#define OPENSSL_UNISTD + +#undef OPENSSL_EXPORT_VAR_AS_FUNCTION + +/* + * The following are cipher-specific, but are part of the public API. + */ +#if !defined(OPENSSL_SYS_UEFI) +# undef BN_LLONG +/* Only one for the following should be defined */ +# define SIXTY_FOUR_BIT_LONG +# undef SIXTY_FOUR_BIT +# undef THIRTY_TWO_BIT +#endif + +#define RC4_INT unsigned int + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/test/certs/root-ed448-cert.pem b/test/certs/root-ed448-cert.pem old mode 100755 new mode 100644 diff --git a/test/certs/root-ed448-key.pem b/test/certs/root-ed448-key.pem old mode 100755 new mode 100644 diff --git a/test/recipes/10-test_bn_data/bngcd.txt b/test/recipes/10-test_bn_data/bngcd.txt old mode 100755 new mode 100644 diff --git a/test/ssl_ctx_test.c b/test/ssl_ctx_test.c old mode 100755 new mode 100644 diff --git a/util/fix-includes.sed b/util/fix-includes.sed old mode 100755 new mode 100644 -- GitLab