From 706457b7bda7fdbab426b8dce83b318908339da4 Mon Sep 17 00:00:00 2001 From: "Dr. Matthias St. Pierre" Date: Sat, 28 Sep 2019 00:45:40 +0200 Subject: Reorganize local header files Apart from public and internal header files, there is a third type called local header files, which are located next to source files in the source directory. Currently, they have different suffixes like '*_lcl.h', '*_local.h', or '*_int.h' This commit changes the different suffixes to '*_local.h' uniformly. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/9333) --- Configurations/10-main.conf | 2 +- crypto/aes/aes_core.c | 2 +- crypto/aes/aes_ecb.c | 2 +- crypto/aes/aes_ige.c | 2 +- crypto/aes/aes_local.h | 42 + crypto/aes/aes_locl.h | 42 - crypto/aes/aes_misc.c | 2 +- crypto/aes/aes_x86core.c | 2 +- crypto/asn1/a_bitstr.c | 2 +- crypto/asn1/a_gentm.c | 2 +- crypto/asn1/a_int.c | 2 +- crypto/asn1/a_object.c | 2 +- crypto/asn1/a_time.c | 2 +- crypto/asn1/a_type.c | 2 +- crypto/asn1/a_utctm.c | 2 +- crypto/asn1/asn1_lib.c | 2 +- crypto/asn1/asn1_local.h | 89 + crypto/asn1/asn1_locl.h | 89 - crypto/asn1/asn_mime.c | 2 +- crypto/asn1/tasn_dec.c | 2 +- crypto/asn1/tasn_enc.c | 2 +- crypto/asn1/tasn_fre.c | 2 +- crypto/asn1/tasn_new.c | 2 +- crypto/asn1/tasn_prn.c | 2 +- crypto/asn1/tasn_scn.c | 2 +- crypto/asn1/tasn_utl.c | 2 +- crypto/asn1/x_int64.c | 2 +- crypto/async/arch/async_null.c | 2 +- crypto/async/arch/async_posix.c | 2 +- crypto/async/arch/async_win.c | 2 +- crypto/async/async.c | 2 +- crypto/async/async_local.h | 80 + crypto/async/async_locl.h | 80 - crypto/async/async_wait.c | 2 +- crypto/bf/bf_cfb64.c | 2 +- crypto/bf/bf_ecb.c | 2 +- crypto/bf/bf_enc.c | 2 +- crypto/bf/bf_local.h | 84 + crypto/bf/bf_locl.h | 84 - crypto/bf/bf_ofb64.c | 2 +- crypto/bf/bf_skey.c | 2 +- crypto/bio/b_addr.c | 6 +- crypto/bio/b_dump.c | 2 +- crypto/bio/b_sock.c | 2 +- crypto/bio/b_sock2.c | 2 +- crypto/bio/bf_buff.c | 2 +- crypto/bio/bf_lbuf.c | 2 +- crypto/bio/bf_nbio.c | 2 +- crypto/bio/bf_null.c | 2 +- crypto/bio/bio_cb.c | 2 +- crypto/bio/bio_lcl.h | 190 -- crypto/bio/bio_lib.c | 2 +- crypto/bio/bio_local.h | 190 ++ crypto/bio/bio_meth.c | 2 +- crypto/bio/bss_acpt.c | 2 +- crypto/bio/bss_bio.c | 2 +- crypto/bio/bss_conn.c | 2 +- crypto/bio/bss_dgram.c | 2 +- crypto/bio/bss_fd.c | 2 +- crypto/bio/bss_file.c | 2 +- crypto/bio/bss_log.c | 2 +- crypto/bio/bss_mem.c | 2 +- crypto/bio/bss_null.c | 2 +- crypto/bio/bss_sock.c | 2 +- crypto/bn/README.pod | 2 +- crypto/bn/asm/x86_64-gcc.c | 2 +- crypto/bn/bn_add.c | 2 +- crypto/bn/bn_asm.c | 2 +- crypto/bn/bn_blind.c | 2 +- crypto/bn/bn_conv.c | 2 +- crypto/bn/bn_ctx.c | 2 +- crypto/bn/bn_depr.c | 2 +- crypto/bn/bn_dh.c | 2 +- crypto/bn/bn_div.c | 2 +- crypto/bn/bn_exp.c | 4 +- crypto/bn/bn_exp2.c | 2 +- crypto/bn/bn_gcd.c | 2 +- crypto/bn/bn_gf2m.c | 2 +- crypto/bn/bn_intern.c | 2 +- crypto/bn/bn_kron.c | 2 +- crypto/bn/bn_lcl.h | 668 ----- crypto/bn/bn_lib.c | 4 +- crypto/bn/bn_local.h | 668 +++++ crypto/bn/bn_mod.c | 2 +- crypto/bn/bn_mont.c | 2 +- crypto/bn/bn_mpi.c | 2 +- crypto/bn/bn_mul.c | 2 +- crypto/bn/bn_nist.c | 2 +- crypto/bn/bn_prime.c | 2 +- crypto/bn/bn_print.c | 2 +- crypto/bn/bn_rand.c | 2 +- crypto/bn/bn_recp.c | 2 +- crypto/bn/bn_rsa_fips186_4.c | 2 +- crypto/bn/bn_shift.c | 2 +- crypto/bn/bn_sqr.c | 2 +- crypto/bn/bn_sqrt.c | 2 +- crypto/bn/bn_srp.c | 2 +- crypto/bn/bn_word.c | 2 +- crypto/bn/bn_x931p.c | 2 +- crypto/camellia/camellia.c | 2 +- crypto/camellia/cmll_ecb.c | 2 +- crypto/camellia/cmll_local.h | 43 + crypto/camellia/cmll_locl.h | 43 - crypto/camellia/cmll_misc.c | 2 +- crypto/cast/c_cfb64.c | 2 +- crypto/cast/c_ecb.c | 2 +- crypto/cast/c_enc.c | 2 +- crypto/cast/c_ofb64.c | 2 +- crypto/cast/c_skey.c | 2 +- crypto/cast/cast_lcl.h | 188 -- crypto/cast/cast_local.h | 188 ++ crypto/cmp/cmp_asn.c | 2 +- crypto/cmp/cmp_ctx.c | 2 +- crypto/cmp/cmp_int.h | 725 ------ crypto/cmp/cmp_local.h | 725 ++++++ crypto/cmp/cmp_util.c | 2 +- crypto/cms/cms_asn1.c | 2 +- crypto/cms/cms_att.c | 2 +- crypto/cms/cms_cd.c | 2 +- crypto/cms/cms_dd.c | 2 +- crypto/cms/cms_enc.c | 2 +- crypto/cms/cms_env.c | 2 +- crypto/cms/cms_ess.c | 2 +- crypto/cms/cms_io.c | 2 +- crypto/cms/cms_kari.c | 2 +- crypto/cms/cms_lcl.h | 438 ---- crypto/cms/cms_lib.c | 2 +- crypto/cms/cms_local.h | 438 ++++ crypto/cms/cms_pwri.c | 2 +- crypto/cms/cms_sd.c | 2 +- crypto/cms/cms_smime.c | 2 +- crypto/comp/c_zlib.c | 2 +- crypto/comp/comp_lcl.h | 30 - crypto/comp/comp_lib.c | 2 +- crypto/comp/comp_local.h | 30 + crypto/conf/conf_lcl.h | 11 - crypto/conf/conf_local.h | 11 + crypto/conf/conf_mall.c | 2 +- crypto/conf/conf_ssl.c | 2 +- crypto/crmf/crmf_asn.c | 2 +- crypto/crmf/crmf_int.h | 394 --- crypto/crmf/crmf_lib.c | 4 +- crypto/crmf/crmf_local.h | 394 +++ crypto/crmf/crmf_pbm.c | 2 +- crypto/ct/ct_b64.c | 2 +- crypto/ct/ct_local.h | 216 ++ crypto/ct/ct_locl.h | 216 -- crypto/ct/ct_oct.c | 2 +- crypto/ct/ct_policy.c | 2 +- crypto/ct/ct_prn.c | 2 +- crypto/ct/ct_sct.c | 2 +- crypto/ct/ct_sct_ctx.c | 2 +- crypto/ct/ct_vfy.c | 2 +- crypto/ct/ct_x509v3.c | 2 +- crypto/des/cbc_cksm.c | 2 +- crypto/des/cfb64ede.c | 2 +- crypto/des/cfb64enc.c | 2 +- crypto/des/cfb_enc.c | 2 +- crypto/des/des_enc.c | 2 +- crypto/des/des_local.h | 226 ++ crypto/des/des_locl.h | 226 -- crypto/des/ecb3_enc.c | 2 +- crypto/des/ecb_enc.c | 2 +- crypto/des/fcrypt.c | 2 +- crypto/des/fcrypt_b.c | 2 +- crypto/des/ncbc_enc.c | 2 +- crypto/des/ofb64ede.c | 2 +- crypto/des/ofb64enc.c | 2 +- crypto/des/ofb_enc.c | 2 +- crypto/des/pcbc_enc.c | 2 +- crypto/des/qud_cksm.c | 2 +- crypto/des/set_key.c | 2 +- crypto/des/str2key.c | 2 +- crypto/des/xcbc_enc.c | 2 +- crypto/dh/dh_ameth.c | 2 +- crypto/dh/dh_asn1.c | 2 +- crypto/dh/dh_check.c | 2 +- crypto/dh/dh_gen.c | 2 +- crypto/dh/dh_key.c | 2 +- crypto/dh/dh_lib.c | 2 +- crypto/dh/dh_local.h | 65 + crypto/dh/dh_locl.h | 65 - crypto/dh/dh_meth.c | 2 +- crypto/dh/dh_pmeth.c | 2 +- crypto/dh/dh_rfc5114.c | 2 +- crypto/dh/dh_rfc7919.c | 2 +- crypto/dsa/dsa_ameth.c | 2 +- crypto/dsa/dsa_asn1.c | 2 +- crypto/dsa/dsa_gen.c | 2 +- crypto/dsa/dsa_key.c | 2 +- crypto/dsa/dsa_lib.c | 2 +- crypto/dsa/dsa_local.h | 80 + crypto/dsa/dsa_locl.h | 80 - crypto/dsa/dsa_meth.c | 2 +- crypto/dsa/dsa_ossl.c | 2 +- crypto/dsa/dsa_pmeth.c | 2 +- crypto/dsa/dsa_sign.c | 2 +- crypto/dsa/dsa_vrf.c | 2 +- crypto/dso/dso_dl.c | 2 +- crypto/dso/dso_dlfcn.c | 2 +- crypto/dso/dso_lib.c | 2 +- crypto/dso/dso_local.h | 107 + crypto/dso/dso_locl.h | 107 - crypto/dso/dso_openssl.c | 2 +- crypto/dso/dso_vms.c | 2 +- crypto/dso/dso_win32.c | 2 +- crypto/ec/curve25519.c | 2 +- crypto/ec/curve448/arch_32/arch_intrinsics.h | 2 +- crypto/ec/curve448/curve448.c | 2 +- crypto/ec/curve448/curve448_lcl.h | 39 - crypto/ec/curve448/curve448_local.h | 39 + crypto/ec/curve448/eddsa.c | 2 +- crypto/ec/curve448/field.h | 2 +- crypto/ec/ec2_oct.c | 2 +- crypto/ec/ec2_smpl.c | 2 +- crypto/ec/ec_ameth.c | 2 +- crypto/ec/ec_asn1.c | 2 +- crypto/ec/ec_check.c | 2 +- crypto/ec/ec_curve.c | 2 +- crypto/ec/ec_cvt.c | 2 +- crypto/ec/ec_key.c | 2 +- crypto/ec/ec_kmeth.c | 2 +- crypto/ec/ec_lcl.h | 763 ------ crypto/ec/ec_lib.c | 2 +- crypto/ec/ec_local.h | 763 ++++++ crypto/ec/ec_mult.c | 2 +- crypto/ec/ec_oct.c | 2 +- crypto/ec/ec_pmeth.c | 2 +- crypto/ec/ec_print.c | 2 +- crypto/ec/ecdh_kdf.c | 2 +- crypto/ec/ecdh_ossl.c | 2 +- crypto/ec/ecdsa_ossl.c | 2 +- crypto/ec/ecdsa_sign.c | 2 +- crypto/ec/ecdsa_vrf.c | 2 +- crypto/ec/ecp_mont.c | 2 +- crypto/ec/ecp_nist.c | 2 +- crypto/ec/ecp_nistp224.c | 2 +- crypto/ec/ecp_nistp256.c | 2 +- crypto/ec/ecp_nistp521.c | 2 +- crypto/ec/ecp_nistputil.c | 2 +- crypto/ec/ecp_nistz256.c | 2 +- crypto/ec/ecp_oct.c | 2 +- crypto/ec/ecp_s390x_nistp.c | 2 +- crypto/ec/ecp_smpl.c | 2 +- crypto/ec/ecx_meth.c | 4 +- crypto/engine/README | 2 +- crypto/engine/eng_all.c | 2 +- crypto/engine/eng_cnf.c | 2 +- crypto/engine/eng_ctrl.c | 2 +- crypto/engine/eng_dyn.c | 2 +- crypto/engine/eng_fat.c | 2 +- crypto/engine/eng_init.c | 2 +- crypto/engine/eng_int.h | 154 -- crypto/engine/eng_lib.c | 2 +- crypto/engine/eng_list.c | 2 +- crypto/engine/eng_local.h | 154 ++ crypto/engine/eng_pkey.c | 2 +- crypto/engine/eng_table.c | 6 +- crypto/engine/tb_asnmth.c | 2 +- crypto/engine/tb_cipher.c | 2 +- crypto/engine/tb_dh.c | 2 +- crypto/engine/tb_digest.c | 2 +- crypto/engine/tb_dsa.c | 2 +- crypto/engine/tb_eckey.c | 2 +- crypto/engine/tb_pkmeth.c | 2 +- crypto/engine/tb_rand.c | 2 +- crypto/engine/tb_rsa.c | 2 +- crypto/err/err.c | 4 +- crypto/err/err_blocks.c | 2 +- crypto/err/err_local.h | 70 + crypto/err/err_locl.h | 70 - crypto/err/err_prn.c | 2 +- crypto/err/openssl.ec | 8 +- crypto/evp/bio_md.c | 2 +- crypto/evp/cmeth_lib.c | 2 +- crypto/evp/digest.c | 2 +- crypto/evp/e_aes.c | 2 +- crypto/evp/e_aes_cbc_hmac_sha1.c | 2 +- crypto/evp/e_aes_cbc_hmac_sha256.c | 2 +- crypto/evp/e_aria.c | 2 +- crypto/evp/e_chacha20_poly1305.c | 2 +- crypto/evp/e_des3.c | 2 +- crypto/evp/e_rc5.c | 2 +- crypto/evp/encode.c | 2 +- crypto/evp/evp_enc.c | 2 +- crypto/evp/evp_fetch.c | 4 +- crypto/evp/evp_lib.c | 2 +- crypto/evp/evp_local.h | 256 ++ crypto/evp/evp_locl.h | 256 -- crypto/evp/evp_pbe.c | 2 +- crypto/evp/evp_utils.c | 8 +- crypto/evp/exchange.c | 2 +- crypto/evp/kdf_lib.c | 2 +- crypto/evp/kdf_meth.c | 2 +- crypto/evp/keymgmt_lib.c | 2 +- crypto/evp/keymgmt_meth.c | 2 +- crypto/evp/m_sha3.c | 2 +- crypto/evp/m_sigver.c | 2 +- crypto/evp/mac_lib.c | 2 +- crypto/evp/mac_meth.c | 2 +- crypto/evp/p5_crpt2.c | 2 +- crypto/evp/pkey_mac.c | 2 +- crypto/evp/pmeth_fn.c | 2 +- crypto/evp/pmeth_lib.c | 2 +- crypto/hmac/hmac.c | 2 +- crypto/hmac/hmac_lcl.h | 25 - crypto/hmac/hmac_local.h | 25 + crypto/idea/i_cbc.c | 2 +- crypto/idea/i_cfb64.c | 2 +- crypto/idea/i_ecb.c | 2 +- crypto/idea/i_ofb64.c | 2 +- crypto/idea/i_skey.c | 2 +- crypto/idea/idea_lcl.h | 102 - crypto/idea/idea_local.h | 102 + crypto/lhash/lh_stats.c | 2 +- crypto/lhash/lhash.c | 2 +- crypto/lhash/lhash_lcl.h | 44 - crypto/lhash/lhash_local.h | 44 + crypto/md4/md4_dgst.c | 4 +- crypto/md4/md4_local.h | 60 + crypto/md4/md4_locl.h | 60 - crypto/md5/md5_dgst.c | 4 +- crypto/md5/md5_local.h | 80 + crypto/md5/md5_locl.h | 80 - crypto/objects/o_names.c | 2 +- crypto/objects/obj_dat.c | 2 +- crypto/objects/obj_lcl.h | 14 - crypto/objects/obj_local.h | 14 + crypto/ocsp/ocsp_asn.c | 2 +- crypto/ocsp/ocsp_cl.c | 2 +- crypto/ocsp/ocsp_ext.c | 2 +- crypto/ocsp/ocsp_lcl.h | 236 -- crypto/ocsp/ocsp_lib.c | 2 +- crypto/ocsp/ocsp_local.h | 236 ++ crypto/ocsp/ocsp_prn.c | 2 +- crypto/ocsp/ocsp_srv.c | 2 +- crypto/ocsp/ocsp_vfy.c | 2 +- crypto/ocsp/v3_ocsp.c | 2 +- crypto/pkcs12/p12_add.c | 2 +- crypto/pkcs12/p12_asn.c | 2 +- crypto/pkcs12/p12_attr.c | 2 +- crypto/pkcs12/p12_crt.c | 2 +- crypto/pkcs12/p12_init.c | 2 +- crypto/pkcs12/p12_lcl.h | 43 - crypto/pkcs12/p12_local.h | 43 + crypto/pkcs12/p12_mutl.c | 2 +- crypto/pkcs12/p12_npas.c | 2 +- crypto/pkcs12/p12_sbag.c | 2 +- crypto/poly1305/poly1305.c | 2 +- crypto/ppccap.c | 2 +- crypto/property/defn_cache.c | 2 +- crypto/property/property.c | 2 +- crypto/property/property_lcl.h | 46 - crypto/property/property_local.h | 46 + crypto/property/property_parse.c | 2 +- crypto/property/property_string.c | 2 +- crypto/rand/drbg_ctr.c | 2 +- crypto/rand/drbg_hash.c | 2 +- crypto/rand/drbg_hmac.c | 2 +- crypto/rand/drbg_lib.c | 2 +- crypto/rand/rand_crng_test.c | 2 +- crypto/rand/rand_lcl.h | 360 --- crypto/rand/rand_lib.c | 2 +- crypto/rand/rand_local.h | 360 +++ crypto/rand/rand_unix.c | 2 +- crypto/rand/rand_vms.c | 2 +- crypto/rand/rand_vxworks.c | 2 +- crypto/rand/rand_win.c | 2 +- crypto/rc2/rc2_cbc.c | 2 +- crypto/rc2/rc2_ecb.c | 2 +- crypto/rc2/rc2_local.h | 134 + crypto/rc2/rc2_locl.h | 134 - crypto/rc2/rc2_skey.c | 2 +- crypto/rc2/rc2cfb64.c | 2 +- crypto/rc2/rc2ofb64.c | 2 +- crypto/rc4/rc4_enc.c | 2 +- crypto/rc4/rc4_local.h | 16 + crypto/rc4/rc4_locl.h | 16 - crypto/rc4/rc4_skey.c | 2 +- crypto/rc5/rc5_ecb.c | 2 +- crypto/rc5/rc5_enc.c | 2 +- crypto/rc5/rc5_local.h | 186 ++ crypto/rc5/rc5_locl.h | 186 -- crypto/rc5/rc5_skey.c | 2 +- crypto/rc5/rc5cfb64.c | 2 +- crypto/rc5/rc5ofb64.c | 2 +- crypto/ripemd/rmd_dgst.c | 4 +- crypto/ripemd/rmd_local.h | 87 + crypto/ripemd/rmd_locl.h | 87 - crypto/rsa/rsa_ameth.c | 2 +- crypto/rsa/rsa_asn1.c | 2 +- crypto/rsa/rsa_chk.c | 2 +- crypto/rsa/rsa_crpt.c | 2 +- crypto/rsa/rsa_gen.c | 2 +- crypto/rsa/rsa_lib.c | 2 +- crypto/rsa/rsa_local.h | 170 ++ crypto/rsa/rsa_locl.h | 170 -- crypto/rsa/rsa_meth.c | 2 +- crypto/rsa/rsa_mp.c | 2 +- crypto/rsa/rsa_oaep.c | 4 +- crypto/rsa/rsa_ossl.c | 4 +- crypto/rsa/rsa_pk1.c | 2 +- crypto/rsa/rsa_pmeth.c | 4 +- crypto/rsa/rsa_pss.c | 2 +- crypto/rsa/rsa_sign.c | 2 +- crypto/rsa/rsa_sp800_56b_check.c | 2 +- crypto/rsa/rsa_sp800_56b_gen.c | 2 +- crypto/rsa/rsa_ssl.c | 2 +- crypto/rsa/rsa_x931g.c | 2 +- crypto/seed/seed.c | 2 +- crypto/seed/seed_local.h | 112 + crypto/seed/seed_locl.h | 112 - crypto/sha/sha1dgst.c | 2 +- crypto/sha/sha_local.h | 424 +++ crypto/sha/sha_locl.h | 424 --- crypto/sm3/sm3.c | 2 +- crypto/sm3/sm3_local.h | 80 + crypto/sm3/sm3_locl.h | 80 - crypto/store/loader_file.c | 2 +- crypto/store/store_init.c | 2 +- crypto/store/store_lib.c | 2 +- crypto/store/store_local.h | 132 + crypto/store/store_locl.h | 132 - crypto/store/store_register.c | 2 +- crypto/ts/ts_asn1.c | 2 +- crypto/ts/ts_lcl.h | 150 -- crypto/ts/ts_lib.c | 2 +- crypto/ts/ts_local.h | 150 ++ crypto/ts/ts_req_print.c | 2 +- crypto/ts/ts_req_utils.c | 2 +- crypto/ts/ts_rsp_print.c | 2 +- crypto/ts/ts_rsp_sign.c | 2 +- crypto/ts/ts_rsp_utils.c | 2 +- crypto/ts/ts_rsp_verify.c | 2 +- crypto/ts/ts_verify_ctx.c | 2 +- crypto/ui/ui_lib.c | 2 +- crypto/ui/ui_local.h | 109 + crypto/ui/ui_locl.h | 109 - crypto/ui/ui_null.c | 2 +- crypto/ui/ui_openssl.c | 2 +- crypto/ui/ui_util.c | 2 +- crypto/whrlpool/wp_block.c | 2 +- crypto/whrlpool/wp_dgst.c | 2 +- crypto/whrlpool/wp_local.h | 12 + crypto/whrlpool/wp_locl.h | 12 - crypto/x509/by_dir.c | 2 +- crypto/x509/by_file.c | 2 +- crypto/x509/pcy_cache.c | 2 +- crypto/x509/pcy_data.c | 2 +- crypto/x509/pcy_int.h | 167 -- crypto/x509/pcy_lib.c | 2 +- crypto/x509/pcy_local.h | 167 ++ crypto/x509/pcy_map.c | 2 +- crypto/x509/pcy_node.c | 2 +- crypto/x509/pcy_tree.c | 2 +- crypto/x509/v3_cpols.c | 2 +- crypto/x509/x509_att.c | 2 +- crypto/x509/x509_lcl.h | 147 -- crypto/x509/x509_local.h | 147 ++ crypto/x509/x509_lu.c | 2 +- crypto/x509/x509_meth.c | 2 +- crypto/x509/x509_set.c | 2 +- crypto/x509/x509_v3.c | 2 +- crypto/x509/x509_vfy.c | 2 +- crypto/x509/x509_vpm.c | 2 +- crypto/x509/x_attrib.c | 2 +- crypto/x509/x_crl.c | 2 +- crypto/x509/x_exten.c | 2 +- crypto/x509/x_name.c | 2 +- doc/internal/man3/evp_generic_fetch.pod | 2 +- .../man3/ossl_cmp_asn1_octet_string_set1.pod | 2 +- include/internal/constant_time.h | 387 +++ include/internal/constant_time_locl.h | 387 --- providers/common/ciphers/block.c | 2 +- providers/common/ciphers/cipher_aes_ccm.c | 2 +- providers/common/ciphers/cipher_aes_ccm_hw.c | 2 +- providers/common/ciphers/cipher_aes_gcm.c | 2 +- providers/common/ciphers/cipher_aes_gcm_hw.c | 2 +- providers/common/ciphers/cipher_ccm.c | 2 +- providers/common/ciphers/cipher_common.c | 2 +- providers/common/ciphers/cipher_common_hw.c | 2 +- providers/common/ciphers/cipher_gcm.c | 2 +- providers/common/ciphers/cipher_gcm_hw.c | 2 +- providers/common/ciphers/cipher_local.h | 29 + providers/common/ciphers/cipher_locl.h | 29 - providers/common/ciphers/cipher_tdes.c | 2 +- providers/common/ciphers/cipher_tdes_hw.c | 2 +- providers/default/ciphers/cipher_des.c | 2 +- ssl/bio_ssl.c | 2 +- ssl/d1_lib.c | 2 +- ssl/d1_msg.c | 2 +- ssl/d1_srtp.c | 2 +- ssl/methods.c | 2 +- ssl/pqueue.c | 2 +- ssl/record/README | 4 +- ssl/record/dtls1_bitmap.c | 4 +- ssl/record/rec_layer_d1.c | 4 +- ssl/record/rec_layer_s3.c | 4 +- ssl/record/record_local.h | 117 + ssl/record/record_locl.h | 117 - ssl/record/ssl3_buffer.c | 4 +- ssl/record/ssl3_record.c | 6 +- ssl/record/ssl3_record_tls13.c | 4 +- ssl/s3_cbc.c | 4 +- ssl/s3_enc.c | 2 +- ssl/s3_lib.c | 2 +- ssl/s3_msg.c | 2 +- ssl/ssl_asn1.c | 2 +- ssl/ssl_cert.c | 2 +- ssl/ssl_ciph.c | 4 +- ssl/ssl_conf.c | 2 +- ssl/ssl_init.c | 2 +- ssl/ssl_lib.c | 2 +- ssl/ssl_local.h | 2693 ++++++++++++++++++++ ssl/ssl_locl.h | 2693 -------------------- ssl/ssl_mcnf.c | 2 +- ssl/ssl_rsa.c | 2 +- ssl/ssl_sess.c | 4 +- ssl/ssl_stat.c | 2 +- ssl/ssl_txt.c | 2 +- ssl/ssl_utst.c | 2 +- ssl/statem/README | 2 +- ssl/statem/extensions.c | 6 +- ssl/statem/extensions_clnt.c | 4 +- ssl/statem/extensions_cust.c | 4 +- ssl/statem/extensions_srvr.c | 4 +- ssl/statem/statem.c | 4 +- ssl/statem/statem_clnt.c | 4 +- ssl/statem/statem_dtls.c | 4 +- ssl/statem/statem_lib.c | 4 +- ssl/statem/statem_local.h | 421 +++ ssl/statem/statem_locl.h | 421 --- ssl/statem/statem_srvr.c | 6 +- ssl/t1_enc.c | 4 +- ssl/t1_lib.c | 2 +- ssl/t1_trce.c | 2 +- ssl/tls13_enc.c | 2 +- ssl/tls_srp.c | 2 +- test/cipher_overhead_test.c | 2 +- test/cmp_testlib.h | 2 +- test/constant_time_test.c | 2 +- test/curve448_internal_test.c | 2 +- test/drbg_cavs_test.c | 2 +- test/drbgtest.c | 2 +- test/dtls_mtu_test.c | 2 +- test/ec_internal_test.c | 2 +- test/handshake_helper.c | 2 +- test/property_test.c | 2 +- test/rsa_sp800_56b_test.c | 2 +- test/ssl_cert_table_internal_test.c | 2 +- test/sslapitest.c | 2 +- test/tls13encryptiontest.c | 4 +- test/tls13secretstest.c | 2 +- 553 files changed, 12036 insertions(+), 12036 deletions(-) create mode 100644 crypto/aes/aes_local.h delete mode 100644 crypto/aes/aes_locl.h create mode 100644 crypto/asn1/asn1_local.h delete mode 100644 crypto/asn1/asn1_locl.h create mode 100644 crypto/async/async_local.h delete mode 100644 crypto/async/async_locl.h create mode 100644 crypto/bf/bf_local.h delete mode 100644 crypto/bf/bf_locl.h delete mode 100644 crypto/bio/bio_lcl.h create mode 100644 crypto/bio/bio_local.h delete mode 100644 crypto/bn/bn_lcl.h create mode 100644 crypto/bn/bn_local.h create mode 100644 crypto/camellia/cmll_local.h delete mode 100644 crypto/camellia/cmll_locl.h delete mode 100644 crypto/cast/cast_lcl.h create mode 100644 crypto/cast/cast_local.h delete mode 100644 crypto/cmp/cmp_int.h create mode 100644 crypto/cmp/cmp_local.h delete mode 100644 crypto/cms/cms_lcl.h create mode 100644 crypto/cms/cms_local.h delete mode 100644 crypto/comp/comp_lcl.h create mode 100644 crypto/comp/comp_local.h delete mode 100644 crypto/conf/conf_lcl.h create mode 100644 crypto/conf/conf_local.h delete mode 100644 crypto/crmf/crmf_int.h create mode 100644 crypto/crmf/crmf_local.h create mode 100644 crypto/ct/ct_local.h delete mode 100644 crypto/ct/ct_locl.h create mode 100644 crypto/des/des_local.h delete mode 100644 crypto/des/des_locl.h create mode 100644 crypto/dh/dh_local.h delete mode 100644 crypto/dh/dh_locl.h create mode 100644 crypto/dsa/dsa_local.h delete mode 100644 crypto/dsa/dsa_locl.h create mode 100644 crypto/dso/dso_local.h delete mode 100644 crypto/dso/dso_locl.h delete mode 100644 crypto/ec/curve448/curve448_lcl.h create mode 100644 crypto/ec/curve448/curve448_local.h delete mode 100644 crypto/ec/ec_lcl.h create mode 100644 crypto/ec/ec_local.h delete mode 100644 crypto/engine/eng_int.h create mode 100644 crypto/engine/eng_local.h create mode 100644 crypto/err/err_local.h delete mode 100644 crypto/err/err_locl.h create mode 100644 crypto/evp/evp_local.h delete mode 100644 crypto/evp/evp_locl.h delete mode 100644 crypto/hmac/hmac_lcl.h create mode 100644 crypto/hmac/hmac_local.h delete mode 100644 crypto/idea/idea_lcl.h create mode 100644 crypto/idea/idea_local.h delete mode 100644 crypto/lhash/lhash_lcl.h create mode 100644 crypto/lhash/lhash_local.h create mode 100644 crypto/md4/md4_local.h delete mode 100644 crypto/md4/md4_locl.h create mode 100644 crypto/md5/md5_local.h delete mode 100644 crypto/md5/md5_locl.h delete mode 100644 crypto/objects/obj_lcl.h create mode 100644 crypto/objects/obj_local.h delete mode 100644 crypto/ocsp/ocsp_lcl.h create mode 100644 crypto/ocsp/ocsp_local.h delete mode 100644 crypto/pkcs12/p12_lcl.h create mode 100644 crypto/pkcs12/p12_local.h delete mode 100644 crypto/property/property_lcl.h create mode 100644 crypto/property/property_local.h delete mode 100644 crypto/rand/rand_lcl.h create mode 100644 crypto/rand/rand_local.h create mode 100644 crypto/rc2/rc2_local.h delete mode 100644 crypto/rc2/rc2_locl.h create mode 100644 crypto/rc4/rc4_local.h delete mode 100644 crypto/rc4/rc4_locl.h create mode 100644 crypto/rc5/rc5_local.h delete mode 100644 crypto/rc5/rc5_locl.h create mode 100644 crypto/ripemd/rmd_local.h delete mode 100644 crypto/ripemd/rmd_locl.h create mode 100644 crypto/rsa/rsa_local.h delete mode 100644 crypto/rsa/rsa_locl.h create mode 100644 crypto/seed/seed_local.h delete mode 100644 crypto/seed/seed_locl.h create mode 100644 crypto/sha/sha_local.h delete mode 100644 crypto/sha/sha_locl.h create mode 100644 crypto/sm3/sm3_local.h delete mode 100644 crypto/sm3/sm3_locl.h create mode 100644 crypto/store/store_local.h delete mode 100644 crypto/store/store_locl.h delete mode 100644 crypto/ts/ts_lcl.h create mode 100644 crypto/ts/ts_local.h create mode 100644 crypto/ui/ui_local.h delete mode 100644 crypto/ui/ui_locl.h create mode 100644 crypto/whrlpool/wp_local.h delete mode 100644 crypto/whrlpool/wp_locl.h delete mode 100644 crypto/x509/pcy_int.h create mode 100644 crypto/x509/pcy_local.h delete mode 100644 crypto/x509/x509_lcl.h create mode 100644 crypto/x509/x509_local.h create mode 100644 include/internal/constant_time.h delete mode 100644 include/internal/constant_time_locl.h create mode 100644 providers/common/ciphers/cipher_local.h delete mode 100644 providers/common/ciphers/cipher_locl.h create mode 100644 ssl/record/record_local.h delete mode 100644 ssl/record/record_locl.h create mode 100644 ssl/ssl_local.h delete mode 100644 ssl/ssl_locl.h create mode 100644 ssl/statem/statem_local.h delete mode 100644 ssl/statem/statem_locl.h diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 9b08cf4f5d..e00e1c0659 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -450,7 +450,7 @@ my %targets = ( # 32-bit message digests. (For the moment of this writing) HP C # doesn't seem to "digest" too many local variables (they make "him" # chew forever:-). For more details look-up MD32_XARRAY comment in -# crypto/sha/sha_lcl.h. +# crypto/sha/sha_local.h. # - originally there were 32-bit hpux-parisc2-* targets. They were # scrapped, because a) they were not interchangeable with other 32-bit # targets; b) performance-critical 32-bit assembly modules implement diff --git a/crypto/aes/aes_core.c b/crypto/aes/aes_core.c index 2f59c191f0..a094a9adeb 100644 --- a/crypto/aes/aes_core.c +++ b/crypto/aes/aes_core.c @@ -41,7 +41,7 @@ #include #include #include -#include "aes_locl.h" +#include "aes_local.h" #ifndef AES_ASM /*- diff --git a/crypto/aes/aes_ecb.c b/crypto/aes/aes_ecb.c index f7f0f158f9..f4a75f133b 100644 --- a/crypto/aes/aes_ecb.c +++ b/crypto/aes/aes_ecb.c @@ -10,7 +10,7 @@ #include #include -#include "aes_locl.h" +#include "aes_local.h" void AES_ecb_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key, const int enc) diff --git a/crypto/aes/aes_ige.c b/crypto/aes/aes_ige.c index 351c173459..b95d3d4ba6 100644 --- a/crypto/aes/aes_ige.c +++ b/crypto/aes/aes_ige.c @@ -14,7 +14,7 @@ NON_EMPTY_TRANSLATION_UNIT #else #include -#include "aes_locl.h" +#include "aes_local.h" #define N_WORDS (AES_BLOCK_SIZE / sizeof(unsigned long)) typedef struct { diff --git a/crypto/aes/aes_local.h b/crypto/aes/aes_local.h new file mode 100644 index 0000000000..273c4fd288 --- /dev/null +++ b/crypto/aes/aes_local.h @@ -0,0 +1,42 @@ +/* + * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (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 + */ + +#ifndef HEADER_AES_LOCL_H +# define HEADER_AES_LOCL_H + +# include +# include +# include +# include + +# if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)) +# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) +# define GETU32(p) SWAP(*((u32 *)(p))) +# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); } +# else +# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3])) +# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); } +# endif + +# ifdef AES_LONG +typedef unsigned long u32; +# else +typedef unsigned int u32; +# endif +typedef unsigned short u16; +typedef unsigned char u8; + +# define MAXKC (256/32) +# define MAXKB (256/8) +# define MAXNR 14 + +/* This controls loop-unrolling in aes_core.c */ +# undef FULL_UNROLL + +#endif /* !HEADER_AES_LOCL_H */ diff --git a/crypto/aes/aes_locl.h b/crypto/aes/aes_locl.h deleted file mode 100644 index 273c4fd288..0000000000 --- a/crypto/aes/aes_locl.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (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 - */ - -#ifndef HEADER_AES_LOCL_H -# define HEADER_AES_LOCL_H - -# include -# include -# include -# include - -# if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64)) -# define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00) -# define GETU32(p) SWAP(*((u32 *)(p))) -# define PUTU32(ct, st) { *((u32 *)(ct)) = SWAP((st)); } -# else -# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3])) -# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); } -# endif - -# ifdef AES_LONG -typedef unsigned long u32; -# else -typedef unsigned int u32; -# endif -typedef unsigned short u16; -typedef unsigned char u8; - -# define MAXKC (256/32) -# define MAXKB (256/8) -# define MAXNR 14 - -/* This controls loop-unrolling in aes_core.c */ -# undef FULL_UNROLL - -#endif /* !HEADER_AES_LOCL_H */ diff --git a/crypto/aes/aes_misc.c b/crypto/aes/aes_misc.c index 0217dc3d36..35be71d1c7 100644 --- a/crypto/aes/aes_misc.c +++ b/crypto/aes/aes_misc.c @@ -9,7 +9,7 @@ #include #include -#include "aes_locl.h" +#include "aes_local.h" const char *AES_options(void) { diff --git a/crypto/aes/aes_x86core.c b/crypto/aes/aes_x86core.c index 1661028b6b..da525b6566 100644 --- a/crypto/aes/aes_x86core.c +++ b/crypto/aes/aes_x86core.c @@ -46,7 +46,7 @@ #include #include -#include "aes_locl.h" +#include "aes_local.h" /* * These two parameters control which table, 256-byte or 2KB, is diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c index f7db9a3432..a1a82f2d5d 100644 --- a/crypto/asn1/a_bitstr.c +++ b/crypto/asn1/a_bitstr.c @@ -11,7 +11,7 @@ #include #include "internal/cryptlib.h" #include -#include "asn1_locl.h" +#include "asn1_local.h" int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len) { diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index 2f4fbf66c0..d82126b0e4 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -15,7 +15,7 @@ #include #include "internal/cryptlib.h" #include -#include "asn1_locl.h" +#include "asn1_local.h" /* This is the primary function used to parse ASN1_GENERALIZEDTIME */ int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d) diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index f6cc42e6e4..5676952bb6 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -13,7 +13,7 @@ #include #include #include -#include "asn1_locl.h" +#include "asn1_local.h" ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x) { diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c index cc5541081e..123f93000b 100644 --- a/crypto/asn1/a_object.c +++ b/crypto/asn1/a_object.c @@ -16,7 +16,7 @@ #include #include #include "crypto/asn1.h" -#include "asn1_locl.h" +#include "asn1_local.h" int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp) { diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index af060c4fc3..c978248d3e 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -19,7 +19,7 @@ #include "crypto/ctype.h" #include "internal/cryptlib.h" #include -#include "asn1_locl.h" +#include "asn1_local.h" IMPLEMENT_ASN1_MSTRING(ASN1_TIME, B_ASN1_TIME) diff --git a/crypto/asn1/a_type.c b/crypto/asn1/a_type.c index 9b8810cd74..3a75385a25 100644 --- a/crypto/asn1/a_type.c +++ b/crypto/asn1/a_type.c @@ -11,7 +11,7 @@ #include "internal/cryptlib.h" #include #include -#include "asn1_locl.h" +#include "asn1_local.h" int ASN1_TYPE_get(const ASN1_TYPE *a) { diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 000cd4bd44..47eb93fe84 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -11,7 +11,7 @@ #include #include "internal/cryptlib.h" #include -#include "asn1_locl.h" +#include "asn1_local.h" /* This is the primary function used to parse ASN1_UTCTIME */ int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d) diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c index 9a0ec68d6b..6399de7c2a 100644 --- a/crypto/asn1/asn1_lib.c +++ b/crypto/asn1/asn1_lib.c @@ -11,7 +11,7 @@ #include #include "internal/cryptlib.h" #include -#include "asn1_locl.h" +#include "asn1_local.h" static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, long max); diff --git a/crypto/asn1/asn1_local.h b/crypto/asn1/asn1_local.h new file mode 100644 index 0000000000..5720c9096a --- /dev/null +++ b/crypto/asn1/asn1_local.h @@ -0,0 +1,89 @@ +/* + * Copyright 2005-2017 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (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 + */ + +/* Internal ASN1 structures and functions: not for application use */ + +typedef const ASN1_VALUE const_ASN1_VALUE; +SKM_DEFINE_STACK_OF(const_ASN1_VALUE, const ASN1_VALUE, ASN1_VALUE) + +int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d); +int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d); +int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d); + +/* ASN1 scan context structure */ + +struct asn1_sctx_st { + /* The ASN1_ITEM associated with this field */ + const ASN1_ITEM *it; + /* If ASN1_TEMPLATE associated with this field */ + const ASN1_TEMPLATE *tt; + /* Various flags associated with field and context */ + unsigned long flags; + /* If SEQUENCE OF or SET OF, field index */ + int skidx; + /* ASN1 depth of field */ + int depth; + /* Structure and field name */ + const char *sname, *fname; + /* If a primitive type the type of underlying field */ + int prim_type; + /* The field value itself */ + ASN1_VALUE **field; + /* Callback to pass information to */ + int (*scan_cb) (ASN1_SCTX *ctx); + /* Context specific application data */ + void *app_data; +} /* ASN1_SCTX */ ; + +typedef struct mime_param_st MIME_PARAM; +DEFINE_STACK_OF(MIME_PARAM) +typedef struct mime_header_st MIME_HEADER; +DEFINE_STACK_OF(MIME_HEADER) + +void asn1_string_embed_free(ASN1_STRING *a, int embed); + +int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_get_choice_selector_const(const ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_set_choice_selector(ASN1_VALUE **pval, int value, + const ASN1_ITEM *it); + +ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +const ASN1_VALUE **asn1_get_const_field_ptr(const ASN1_VALUE **pval, + const ASN1_TEMPLATE *tt); + +const ASN1_TEMPLATE *asn1_do_adb(const ASN1_VALUE *val, const ASN1_TEMPLATE *tt, + int nullerr); + +int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it); + +void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); +void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_enc_restore(int *len, unsigned char **out, const ASN1_VALUE **pval, + const ASN1_ITEM *it); +int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, + const ASN1_ITEM *it); + +void asn1_item_embed_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); +void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); +void asn1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); + +ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, + long length); +int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); +ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, + const unsigned char **pp, long length); +int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); +ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, + long length); + +/* Internal functions used by x_int64.c */ +int c2i_uint64_int(uint64_t *ret, int *neg, const unsigned char **pp, long len); +int i2c_uint64_int(unsigned char *p, uint64_t r, int neg); + +ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type); diff --git a/crypto/asn1/asn1_locl.h b/crypto/asn1/asn1_locl.h deleted file mode 100644 index 5720c9096a..0000000000 --- a/crypto/asn1/asn1_locl.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2005-2017 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (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 - */ - -/* Internal ASN1 structures and functions: not for application use */ - -typedef const ASN1_VALUE const_ASN1_VALUE; -SKM_DEFINE_STACK_OF(const_ASN1_VALUE, const ASN1_VALUE, ASN1_VALUE) - -int asn1_time_to_tm(struct tm *tm, const ASN1_TIME *d); -int asn1_utctime_to_tm(struct tm *tm, const ASN1_UTCTIME *d); -int asn1_generalizedtime_to_tm(struct tm *tm, const ASN1_GENERALIZEDTIME *d); - -/* ASN1 scan context structure */ - -struct asn1_sctx_st { - /* The ASN1_ITEM associated with this field */ - const ASN1_ITEM *it; - /* If ASN1_TEMPLATE associated with this field */ - const ASN1_TEMPLATE *tt; - /* Various flags associated with field and context */ - unsigned long flags; - /* If SEQUENCE OF or SET OF, field index */ - int skidx; - /* ASN1 depth of field */ - int depth; - /* Structure and field name */ - const char *sname, *fname; - /* If a primitive type the type of underlying field */ - int prim_type; - /* The field value itself */ - ASN1_VALUE **field; - /* Callback to pass information to */ - int (*scan_cb) (ASN1_SCTX *ctx); - /* Context specific application data */ - void *app_data; -} /* ASN1_SCTX */ ; - -typedef struct mime_param_st MIME_PARAM; -DEFINE_STACK_OF(MIME_PARAM) -typedef struct mime_header_st MIME_HEADER; -DEFINE_STACK_OF(MIME_HEADER) - -void asn1_string_embed_free(ASN1_STRING *a, int embed); - -int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_get_choice_selector_const(const ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_set_choice_selector(ASN1_VALUE **pval, int value, - const ASN1_ITEM *it); - -ASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); -const ASN1_VALUE **asn1_get_const_field_ptr(const ASN1_VALUE **pval, - const ASN1_TEMPLATE *tt); - -const ASN1_TEMPLATE *asn1_do_adb(const ASN1_VALUE *val, const ASN1_TEMPLATE *tt, - int nullerr); - -int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it); - -void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); -void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); -int asn1_enc_restore(int *len, unsigned char **out, const ASN1_VALUE **pval, - const ASN1_ITEM *it); -int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, - const ASN1_ITEM *it); - -void asn1_item_embed_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); -void asn1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); -void asn1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); - -ASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, - long length); -int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp); -ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, - const unsigned char **pp, long length); -int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp); -ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, - long length); - -/* Internal functions used by x_int64.c */ -int c2i_uint64_int(uint64_t *ret, int *neg, const unsigned char **pp, long len); -int i2c_uint64_int(unsigned char *p, uint64_t r, int neg); - -ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type); diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c index 571523e127..3282163199 100644 --- a/crypto/asn1/asn_mime.c +++ b/crypto/asn1/asn_mime.c @@ -16,7 +16,7 @@ #include #include "crypto/evp.h" #include "internal/bio.h" -#include "asn1_locl.h" +#include "asn1_local.h" /* * Generalised MIME like utilities for streaming ASN1. Although many have a diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c index 87c01f0beb..e7c49526fc 100644 --- a/crypto/asn1/tasn_dec.c +++ b/crypto/asn1/tasn_dec.c @@ -15,7 +15,7 @@ #include #include #include "internal/numbers.h" -#include "asn1_locl.h" +#include "asn1_local.h" /* diff --git a/crypto/asn1/tasn_enc.c b/crypto/asn1/tasn_enc.c index 0ca8460580..a499665a2f 100644 --- a/crypto/asn1/tasn_enc.c +++ b/crypto/asn1/tasn_enc.c @@ -14,7 +14,7 @@ #include #include #include "crypto/asn1.h" -#include "asn1_locl.h" +#include "asn1_local.h" static int asn1_i2d_ex_primitive(const ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); diff --git a/crypto/asn1/tasn_fre.c b/crypto/asn1/tasn_fre.c index bffa6f15d4..5749e2c770 100644 --- a/crypto/asn1/tasn_fre.c +++ b/crypto/asn1/tasn_fre.c @@ -11,7 +11,7 @@ #include #include #include -#include "asn1_locl.h" +#include "asn1_local.h" /* Free up an ASN1 structure */ diff --git a/crypto/asn1/tasn_new.c b/crypto/asn1/tasn_new.c index f9b924c190..155080dda1 100644 --- a/crypto/asn1/tasn_new.c +++ b/crypto/asn1/tasn_new.c @@ -13,7 +13,7 @@ #include #include #include -#include "asn1_locl.h" +#include "asn1_local.h" static int asn1_item_embed_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int embed); diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 149300e4fb..ff86400d66 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -16,7 +16,7 @@ #include #include #include "crypto/asn1.h" -#include "asn1_locl.h" +#include "asn1_local.h" /* * Print routines. diff --git a/crypto/asn1/tasn_scn.c b/crypto/asn1/tasn_scn.c index d09cf57f50..a8401c9d21 100644 --- a/crypto/asn1/tasn_scn.c +++ b/crypto/asn1/tasn_scn.c @@ -15,7 +15,7 @@ #include #include #include -#include "asn1_locl.h" +#include "asn1_local.h" /* * General ASN1 structure recursive scanner: iterate through all fields diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c index 53dad7af83..a31c7c275f 100644 --- a/crypto/asn1/tasn_utl.c +++ b/crypto/asn1/tasn_utl.c @@ -15,7 +15,7 @@ #include #include #include -#include "asn1_locl.h" +#include "asn1_local.h" /* Utility functions for manipulating fields and offsets */ diff --git a/crypto/asn1/x_int64.c b/crypto/asn1/x_int64.c index 1b55f4f81c..211cdc4e67 100644 --- a/crypto/asn1/x_int64.c +++ b/crypto/asn1/x_int64.c @@ -12,7 +12,7 @@ #include "internal/numbers.h" #include #include -#include "asn1_locl.h" +#include "asn1_local.h" /* * Custom primitive types for handling int32_t, int64_t, uint32_t, uint64_t. diff --git a/crypto/async/arch/async_null.c b/crypto/async/arch/async_null.c index 1ffc5d144e..675c1d35bf 100644 --- a/crypto/async/arch/async_null.c +++ b/crypto/async/arch/async_null.c @@ -8,7 +8,7 @@ */ /* This must be the first #include file */ -#include "../async_locl.h" +#include "../async_local.h" #ifdef ASYNC_NULL int ASYNC_is_capable(void) diff --git a/crypto/async/arch/async_posix.c b/crypto/async/arch/async_posix.c index 2a1cdfcc0f..7476970e6b 100644 --- a/crypto/async/arch/async_posix.c +++ b/crypto/async/arch/async_posix.c @@ -8,7 +8,7 @@ */ /* This must be the first #include file */ -#include "../async_locl.h" +#include "../async_local.h" #ifdef ASYNC_POSIX diff --git a/crypto/async/arch/async_win.c b/crypto/async/arch/async_win.c index 848f432b0f..0db9efe3c1 100644 --- a/crypto/async/arch/async_win.c +++ b/crypto/async/arch/async_win.c @@ -8,7 +8,7 @@ */ /* This must be the first #include file */ -#include "../async_locl.h" +#include "../async_local.h" #ifdef ASYNC_WIN diff --git a/crypto/async/async.c b/crypto/async/async.c index 7490419586..4743bb702b 100644 --- a/crypto/async/async.c +++ b/crypto/async/async.c @@ -16,7 +16,7 @@ #undef _FORTIFY_SOURCE /* This must be the first #include file */ -#include "async_locl.h" +#include "async_local.h" #include #include "crypto/cryptlib.h" diff --git a/crypto/async/async_local.h b/crypto/async/async_local.h new file mode 100644 index 0000000000..549a27e611 --- /dev/null +++ b/crypto/async/async_local.h @@ -0,0 +1,80 @@ +/* + * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (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 + */ + +/* + * Must do this before including any header files, because on MacOS/X + * includes which includes + */ +#if defined(__APPLE__) && defined(__MACH__) && !defined(_XOPEN_SOURCE) +# define _XOPEN_SOURCE /* Otherwise incomplete ucontext_t structure */ +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + +#if defined(_WIN32) +# include +#endif + +#include "crypto/async.h" +#include + +typedef struct async_ctx_st async_ctx; +typedef struct async_pool_st async_pool; + +#include "arch/async_win.h" +#include "arch/async_posix.h" +#include "arch/async_null.h" + +struct async_ctx_st { + async_fibre dispatcher; + ASYNC_JOB *currjob; + unsigned int blocked; +}; + +struct async_job_st { + async_fibre fibrectx; + int (*func) (void *); + void *funcargs; + int ret; + int status; + ASYNC_WAIT_CTX *waitctx; +}; + +struct fd_lookup_st { + const void *key; + OSSL_ASYNC_FD fd; + void *custom_data; + void (*cleanup)(ASYNC_WAIT_CTX *, const void *, OSSL_ASYNC_FD, void *); + int add; + int del; + struct fd_lookup_st *next; +}; + +struct async_wait_ctx_st { + struct fd_lookup_st *fds; + size_t numadd; + size_t numdel; + ASYNC_callback_fn callback; + void *callback_arg; + int status; +}; + +DEFINE_STACK_OF(ASYNC_JOB) + +struct async_pool_st { + STACK_OF(ASYNC_JOB) *jobs; + size_t curr_size; + size_t max_size; +}; + +void async_local_cleanup(void); +void async_start_func(void); +async_ctx *async_get_ctx(void); + +void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx); + diff --git a/crypto/async/async_locl.h b/crypto/async/async_locl.h deleted file mode 100644 index 549a27e611..0000000000 --- a/crypto/async/async_locl.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the Apache License 2.0 (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 - */ - -/* - * Must do this before including any header files, because on MacOS/X - * includes which includes - */ -#if defined(__APPLE__) && defined(__MACH__) && !defined(_XOPEN_SOURCE) -# define _XOPEN_SOURCE /* Otherwise incomplete ucontext_t structure */ -# pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - -#if defined(_WIN32) -# include -#endif - -#include "crypto/async.h" -#include - -typedef struct async_ctx_st async_ctx; -typedef struct async_pool_st async_pool; - -#include "arch/async_win.h" -#include "arch/async_posix.h" -#include "arch/async_null.h" - -struct async_ctx_st { - async_fibre dispatcher; - ASYNC_JOB *currjob; - unsigned int blocked; -}; - -struct async_job_st { - async_fibre fibrectx; - int (*func) (void *); - void *funcargs; - int ret; - int status; - ASYNC_WAIT_CTX *waitctx; -}; - -struct fd_lookup_st { - const void *key; - OSSL_ASYNC_FD fd; - void *custom_data; - void (*cleanup)(ASYNC_WAIT_CTX *, const void *, OSSL_ASYNC_FD, void *); - int add; - int del; - struct fd_lookup_st *next; -}; - -struct async_wait_ctx_st { - struct fd_lookup_st *fds; - size_t numadd; - size_t numdel; - ASYNC_callback_fn callback; - void *callback_arg; - int status; -}; - -DEFINE_STACK_OF(ASYNC_JOB) - -struct async_pool_st { - STACK_OF(ASYNC_JOB) *jobs; - size_t curr_size; - size_t max_size; -}; - -void async_local_cleanup(void); -void async_start_func(void); -async_ctx *async_get_ctx(void); - -void async_wait_ctx_reset_counts(ASYNC_WAIT_CTX *ctx); - diff --git a/crypto/async/async_wait.c b