[openssl] master update

matthias.st.pierre at ncp-e.com matthias.st.pierre at ncp-e.com
Sat Sep 28 18:34:05 UTC 2019


The branch master has been updated
       via  e7fb44e7c3f7a37ff83a6b69ba51a738e549bf5c (commit)
       via  d86167ec7513265bbafaf5c13fa60bd7c23aa732 (commit)
       via  ae4186b00487762f581b2276ba83e5214e0e7ee1 (commit)
       via  8c78f0ec63f3e16bac1b888dbabf2b6c2d53a1ae (commit)
       via  50cd4768c6b89c757645f28519236bb989216f8d (commit)
       via  706457b7bda7fdbab426b8dce83b318908339da4 (commit)
       via  25f2138b0ab54a65ba713c093ca3734d88f7cb51 (commit)
       via  ea8e1fe55b51d9da69977d8dc3f2ffd648d438df (commit)
      from  c18d2d94c8a27c1dcc5036bebdfcce92874a297c (commit)


- Log -----------------------------------------------------------------
commit e7fb44e7c3f7a37ff83a6b69ba51a738e549bf5c
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Sat Sep 28 00:46:00 2019 +0200

    Add util/fix-includes script
    
    This script contains all adjustments to header files which were made
    during the reorganization of the header files. It is meant as an aid
    for other contributors which encounter preprocessor #include errors
    after rebasing over this pull request. Simply running
    
      util/fix-includes
    
    from the root of the source directory should hopefully fix the problem.
    
    Note: such #include errors are expected only for pull requests which
    add a lot of new code, in particular new compilation modules.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

commit d86167ec7513265bbafaf5c13fa60bd7c23aa732
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Sat Sep 28 00:46:00 2019 +0200

    Add legacy include guards to public header files
    
    For every public header file, the old include guard definition needs
    to be added in addition to the new one
    
    include/openssl/file.h:
    
        #ifndef OPENSSL_FILE_H
        # define OPENSSL_FILE_H
        # pragma once
    
        # include <openssl/macros.h>
        # if !OPENSSL_API_3
        #  define HEADER_FILE_H
        # endif
        ...
    
    This is going to ensure that applications which use the old include guards
    externally, for example like this
    
        #ifndef HEADER_FILE_H
        # include <openssl/file.h>
        #endif
    
    will not fail to compile.
    
    In addition to the legacy guard, the public header files also receive a
    '# pragma once' directive.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

commit ae4186b00487762f581b2276ba83e5214e0e7ee1
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Sat Sep 28 00:45:57 2019 +0200

    Fix header file include guard names
    
    Make the include guards consistent by renaming them systematically according
    to the naming conventions below
    
    For the public header files (in the 'include/openssl' directory), the guard
    names try to match the path specified in the include directives, with
    all letters converted to upper case and '/' and '.' replaced by '_'. For the
    private header files files, an extra 'OSSL_' is added as prefix.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

commit 8c78f0ec63f3e16bac1b888dbabf2b6c2d53a1ae
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Sat Sep 28 00:45:46 2019 +0200

    Reorganize public header files (part 2)
    
    Add an <openssl/ossl_typ.h> compatibility header.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

commit 50cd4768c6b89c757645f28519236bb989216f8d
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Sat Sep 28 00:45:46 2019 +0200

    Reorganize public header files (part 1)
    
    Rename <openssl/ossl_typ.h> to <openssl/types.h>.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

commit 706457b7bda7fdbab426b8dce83b318908339da4
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Sat Sep 28 00:45:40 2019 +0200

    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 <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

commit 25f2138b0ab54a65ba713c093ca3734d88f7cb51
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Sat Sep 28 00:45:33 2019 +0200

    Reorganize private crypto header files
    
    Currently, there are two different directories which contain internal
    header files of libcrypto which are meant to be shared internally:
    
    While header files in 'include/internal' are intended to be shared
    between libcrypto and libssl, the files in 'crypto/include/internal'
    are intended to be shared inside libcrypto only.
    
    To make things complicated, the include search path is set up in such
    a way that the directive #include "internal/file.h" could refer to
    a file in either of these two directoroes. This makes it necessary
    in some cases to add a '_int.h' suffix to some files to resolve this
    ambiguity:
    
      #include "internal/file.h"      # located in 'include/internal'
      #include "internal/file_int.h"  # located in 'crypto/include/internal'
    
    This commit moves the private crypto headers from
    
      'crypto/include/internal'  to  'include/crypto'
    
    As a result, the include directives become unambiguous
    
      #include "internal/file.h"       # located in 'include/internal'
      #include "crypto/file.h"         # located in 'include/crypto'
    
    hence the superfluous '_int.h' suffixes can be stripped.
    
    The files 'store_int.h' and 'store.h' need to be treated specially;
    they are joined into a single file.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

commit ea8e1fe55b51d9da69977d8dc3f2ffd648d438df
Author: Dr. Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
Date:   Thu Aug 22 17:33:38 2019 +0200

    Add legacy include guard manually to opensslconf.h.in
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/9333)

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                                         |   2 +-
 Configurations/10-main.conf                        |   2 +-
 apps/include/apps.h                                |   6 +-
 apps/include/apps_ui.h                             |   4 +-
 apps/include/fmt.h                                 |   6 +-
 apps/include/function.h                            |   4 +-
 apps/include/opt.h                                 |   8 +-
 apps/include/platform.h                            |   4 +-
 apps/include/vms_term_sock.h                       |   4 +-
 apps/timeouts.h                                    |   6 +-
 build.info                                         |  14 +-
 crypto/aes/aes_core.c                              |   2 +-
 crypto/aes/aes_ecb.c                               |   2 +-
 crypto/aes/aes_ige.c                               |   2 +-
 crypto/aes/{aes_locl.h => aes_local.h}             |   6 +-
 crypto/aes/aes_misc.c                              |   2 +-
 crypto/aes/aes_x86core.c                           |   2 +-
 crypto/aria/aria.c                                 |   2 +-
 crypto/arm_arch.h                                  |   4 +-
 crypto/asn1/a_bitstr.c                             |   2 +-
 crypto/asn1/a_d2i_fp.c                             |   2 +-
 crypto/asn1/a_gentm.c                              |   2 +-
 crypto/asn1/a_int.c                                |   2 +-
 crypto/asn1/a_mbstr.c                              |   2 +-
 crypto/asn1/a_object.c                             |   6 +-
 crypto/asn1/a_print.c                              |   2 +-
 crypto/asn1/a_sign.c                               |   4 +-
 crypto/asn1/a_strex.c                              |   2 +-
 crypto/asn1/a_time.c                               |   4 +-
 crypto/asn1/a_type.c                               |   2 +-
 crypto/asn1/a_utctm.c                              |   2 +-
 crypto/asn1/a_verify.c                             |   4 +-
 crypto/asn1/ameth_lib.c                            |   4 +-
 crypto/asn1/asn1_lib.c                             |   2 +-
 crypto/asn1/{asn1_locl.h => asn1_local.h}          |   0
 crypto/asn1/asn_mime.c                             |   6 +-
 crypto/asn1/asn_moid.c                             |   6 +-
 crypto/asn1/d2i_param.c                            |   4 +-
 crypto/asn1/d2i_pr.c                               |   4 +-
 crypto/asn1/d2i_pu.c                               |   2 +-
 crypto/asn1/f_int.c                                |   2 +-
 crypto/asn1/f_string.c                             |   2 +-
 crypto/asn1/i2d_param.c                            |   4 +-
 crypto/asn1/i2d_pr.c                               |   4 +-
 crypto/asn1/p8_pkey.c                              |   2 +-
 crypto/asn1/t_pkey.c                               |   2 +-
 crypto/asn1/tasn_dec.c                             |   2 +-
 crypto/asn1/tasn_enc.c                             |   4 +-
 crypto/asn1/tasn_fre.c                             |   2 +-
 crypto/asn1/tasn_new.c                             |   2 +-
 crypto/asn1/tasn_prn.c                             |   4 +-
 crypto/asn1/tasn_scn.c                             |   2 +-
 crypto/asn1/tasn_utl.c                             |   2 +-
 crypto/asn1/x_algor.c                              |   2 +-
 crypto/asn1/x_int64.c                              |   2 +-
 crypto/asn1/x_sig.c                                |   2 +-
 crypto/asn1_dsa.c                                  |   2 +-
 crypto/async/arch/async_null.c                     |   2 +-
 crypto/async/arch/async_posix.c                    |   2 +-
 crypto/async/arch/async_posix.h                    |   6 +-
 crypto/async/arch/async_win.c                      |   2 +-
 crypto/async/async.c                               |   4 +-
 crypto/async/{async_locl.h => async_local.h}       |   2 +-
 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_locl.h => bf_local.h}                |   4 +-
 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_print.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_lib.c                               |   2 +-
 crypto/bio/{bio_lcl.h => bio_local.h}              |   8 +-
 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/blake2/m_blake2b.c                          |   2 +-
 crypto/blake2/m_blake2s.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                                |   4 +-
 crypto/bn/bn_ctx.c                                 |   2 +-
 crypto/bn/bn_depr.c                                |   2 +-
 crypto/bn/bn_dh.c                                  |   4 +-
 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_lib.c                                 |   4 +-
 crypto/bn/{bn_lcl.h => bn_local.h}                 |   8 +-
 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                                |   4 +-
 crypto/bn/bn_recp.c                                |   2 +-
 crypto/bn/bn_rsa_fips186_4.c                       |   4 +-
 crypto/bn/bn_shift.c                               |   2 +-
 crypto/bn/bn_sqr.c                                 |   2 +-
 crypto/bn/bn_sqrt.c                                |   2 +-
 crypto/bn/bn_srp.c                                 |   4 +-
 crypto/bn/bn_word.c                                |   2 +-
 crypto/bn/bn_x931p.c                               |   2 +-
 crypto/bn/rsaz_exp.h                               |   4 +-
 crypto/camellia/camellia.c                         |   2 +-
 crypto/camellia/cmll_ecb.c                         |   2 +-
 crypto/camellia/{cmll_locl.h => cmll_local.h}      |   6 +-
 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 => cast_local.h}           |   0
 crypto/chacha/chacha_enc.c                         |   2 +-
 crypto/cmac/cm_ameth.c                             |   2 +-
 crypto/cmp/cmp_asn.c                               |   2 +-
 crypto/cmp/cmp_ctx.c                               |   2 +-
 crypto/cmp/{cmp_int.h => cmp_local.h}              |   8 +-
 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                               |   6 +-
 crypto/cms/cms_ess.c                               |   6 +-
 crypto/cms/cms_io.c                                |   2 +-
 crypto/cms/cms_kari.c                              |   4 +-
 crypto/cms/cms_lib.c                               |   2 +-
 crypto/cms/{cms_lcl.h => cms_local.h}              |   4 +-
 crypto/cms/cms_pwri.c                              |   4 +-
 crypto/cms/cms_sd.c                                |  10 +-
 crypto/cms/cms_smime.c                             |   4 +-
 crypto/comp/c_zlib.c                               |   4 +-
 crypto/comp/comp_lib.c                             |   2 +-
 crypto/comp/{comp_lcl.h => comp_local.h}           |   0
 crypto/conf/conf_lib.c                             |   2 +-
 crypto/conf/{conf_lcl.h => conf_local.h}           |   0
 crypto/conf/conf_mall.c                            |   2 +-
 crypto/conf/conf_ssl.c                             |   2 +-
 crypto/context.c                                   |   2 +-
 crypto/core_namemap.c                              |   2 +-
 crypto/crmf/crmf_asn.c                             |   2 +-
 crypto/crmf/crmf_lib.c                             |   4 +-
 crypto/crmf/{crmf_int.h => crmf_local.h}           |   6 +-
 crypto/crmf/crmf_pbm.c                             |   2 +-
 crypto/cryptlib.c                                  |   4 +-
 crypto/ct/ct_b64.c                                 |   2 +-
 crypto/ct/{ct_locl.h => ct_local.h}                |   0
 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/ctype.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_locl.h => des_local.h}             |   4 +-
 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                               |   6 +-
 crypto/dh/dh_asn1.c                                |   2 +-
 crypto/dh/dh_check.c                               |   2 +-
 crypto/dh/dh_gen.c                                 |   2 +-
 crypto/dh/dh_key.c                                 |   4 +-
 crypto/dh/dh_lib.c                                 |   2 +-
 crypto/dh/{dh_locl.h => dh_local.h}                |   0
 crypto/dh/dh_meth.c                                |   2 +-
 crypto/dh/dh_pmeth.c                               |   4 +-
 crypto/dh/dh_rfc5114.c                             |   4 +-
 crypto/dh/dh_rfc7919.c                             |   4 +-
 crypto/dllmain.c                                   |   2 +-
 crypto/dsa/dsa_ameth.c                             |   6 +-
 crypto/dsa/dsa_asn1.c                              |   4 +-
 crypto/dsa/dsa_gen.c                               |   2 +-
 crypto/dsa/dsa_key.c                               |   2 +-
 crypto/dsa/dsa_lib.c                               |   2 +-
 crypto/dsa/{dsa_locl.h => dsa_local.h}             |   0
 crypto/dsa/dsa_meth.c                              |   2 +-
 crypto/dsa/dsa_ossl.c                              |   4 +-
 crypto/dsa/dsa_pmeth.c                             |   4 +-
 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_locl.h => dso_local.h}             |   2 +-
 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       |   8 +-
 crypto/ec/curve448/arch_32/f_impl.h                |   6 +-
 crypto/ec/curve448/curve448.c                      |   2 +-
 .../curve448/{curve448_lcl.h => curve448_local.h}  |   6 +-
 crypto/ec/curve448/curve448utils.h                 |   4 +-
 crypto/ec/curve448/ed448.h                         |   6 +-
 crypto/ec/curve448/eddsa.c                         |   2 +-
 crypto/ec/curve448/field.h                         |   8 +-
 crypto/ec/curve448/point_448.h                     |   6 +-
 crypto/ec/curve448/word.h                          |   6 +-
 crypto/ec/ec2_oct.c                                |   2 +-
 crypto/ec/ec2_smpl.c                               |   4 +-
 crypto/ec/ec_ameth.c                               |   6 +-
 crypto/ec/ec_asn1.c                                |   4 +-
 crypto/ec/ec_check.c                               |   2 +-
 crypto/ec/ec_curve.c                               |   2 +-
 crypto/ec/ec_cvt.c                                 |   4 +-
 crypto/ec/ec_key.c                                 |   2 +-
 crypto/ec/ec_kmeth.c                               |   2 +-
 crypto/ec/ec_lib.c                                 |   2 +-
 crypto/ec/{ec_lcl.h => ec_local.h}                 |   2 +-
 crypto/ec/ec_mult.c                                |   4 +-
 crypto/ec/ec_oct.c                                 |   2 +-
 crypto/ec/ec_pmeth.c                               |   4 +-
 crypto/ec/ec_print.c                               |   2 +-
 crypto/ec/ecdh_kdf.c                               |   2 +-
 crypto/ec/ecdh_ossl.c                              |   2 +-
 crypto/ec/ecdsa_ossl.c                             |   4 +-
 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                           |   4 +-
 crypto/ec/ecp_oct.c                                |   2 +-
 crypto/ec/ecp_s390x_nistp.c                        |   2 +-
 crypto/ec/ecp_smpl.c                               |   2 +-
 crypto/ec/ecx_meth.c                               |   8 +-
 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_lib.c                            |   2 +-
 crypto/engine/eng_list.c                           |   2 +-
 crypto/engine/{eng_int.h => eng_local.h}           |   8 +-
 crypto/engine/eng_openssl.c                        |   2 +-
 crypto/engine/eng_pkey.c                           |   2 +-
 crypto/engine/eng_rdrand.c                         |   2 +-
 crypto/engine/eng_table.c                          |   6 +-
 crypto/engine/tb_asnmth.c                          |   4 +-
 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                                   |  10 +-
 crypto/err/err_all.c                               |   2 +-
 crypto/err/err_blocks.c                            |   2 +-
 crypto/err/{err_locl.h => err_local.h}             |   0
 crypto/err/err_prn.c                               |   2 +-
 crypto/err/openssl.ec                              |  10 +-
 crypto/ess/ess_asn1.c                              |   2 +-
 crypto/ess/ess_lib.c                               |   2 +-
 crypto/evp/bio_md.c                                |   4 +-
 crypto/evp/bio_ok.c                                |   2 +-
 crypto/evp/c_allc.c                                |   2 +-
 crypto/evp/c_alld.c                                |   2 +-
 crypto/evp/cmeth_lib.c                             |   4 +-
 crypto/evp/digest.c                                |   4 +-
 crypto/evp/e_aes.c                                 |  10 +-
 crypto/evp/e_aes_cbc_hmac_sha1.c                   |   6 +-
 crypto/evp/e_aes_cbc_hmac_sha256.c                 |   6 +-
 crypto/evp/e_aria.c                                |   8 +-
 crypto/evp/e_bf.c                                  |   2 +-
 crypto/evp/e_camellia.c                            |   6 +-
 crypto/evp/e_cast.c                                |   2 +-
 crypto/evp/e_chacha20_poly1305.c                   |   8 +-
 crypto/evp/e_des.c                                 |   2 +-
 crypto/evp/e_des3.c                                |   4 +-
 crypto/evp/e_idea.c                                |   2 +-
 crypto/evp/e_null.c                                |   2 +-
 crypto/evp/e_rc2.c                                 |   2 +-
 crypto/evp/e_rc4.c                                 |   2 +-
 crypto/evp/e_rc4_hmac_md5.c                        |   2 +-
 crypto/evp/e_rc5.c                                 |   4 +-
 crypto/evp/e_seed.c                                |   2 +-
 crypto/evp/e_sm4.c                                 |   4 +-
 crypto/evp/e_xcbc_d.c                              |   2 +-
 crypto/evp/encode.c                                |   4 +-
 crypto/evp/evp_enc.c                               |   4 +-
 crypto/evp/evp_fetch.c                             |   6 +-
 crypto/evp/evp_lib.c                               |   4 +-
 crypto/evp/{evp_locl.h => evp_local.h}             |   2 +-
 crypto/evp/evp_pbe.c                               |   4 +-
 crypto/evp/evp_pkey.c                              |   6 +-
 crypto/evp/evp_utils.c                             |   8 +-
 crypto/evp/exchange.c                              |   4 +-
 crypto/evp/kdf_lib.c                               |   6 +-
 crypto/evp/kdf_meth.c                              |   4 +-
 crypto/evp/keymgmt_lib.c                           |   6 +-
 crypto/evp/keymgmt_meth.c                          |   4 +-
 crypto/evp/m_md2.c                                 |   2 +-
 crypto/evp/m_md4.c                                 |   2 +-
 crypto/evp/m_md5.c                                 |   2 +-
 crypto/evp/m_md5_sha1.c                            |   2 +-
 crypto/evp/m_mdc2.c                                |   2 +-
 crypto/evp/m_null.c                                |   2 +-
 crypto/evp/m_ripemd.c                              |   2 +-
 crypto/evp/m_sha1.c                                |   4 +-
 crypto/evp/m_sha3.c                                |   4 +-
 crypto/evp/m_sigver.c                              |   4 +-
 crypto/evp/m_wp.c                                  |   2 +-
 crypto/evp/mac_lib.c                               |   6 +-
 crypto/evp/mac_meth.c                              |   4 +-
 crypto/evp/names.c                                 |   4 +-
 crypto/evp/p5_crpt2.c                              |   4 +-
 crypto/evp/p_lib.c                                 |   4 +-
 crypto/evp/p_sign.c                                |   2 +-
 crypto/evp/p_verify.c                              |   2 +-
 crypto/evp/pkey_kdf.c                              |   2 +-
 crypto/evp/pkey_mac.c                              |   4 +-
 crypto/evp/pmeth_fn.c                              |   4 +-
 crypto/evp/pmeth_gn.c                              |   6 +-
 crypto/evp/pmeth_lib.c                             |   6 +-
 crypto/ex_data.c                                   |   2 +-
 crypto/hmac/hm_ameth.c                             |   4 +-
 crypto/hmac/hmac.c                                 |   2 +-
 crypto/hmac/{hmac_lcl.h => hmac_local.h}           |   4 +-
 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 => idea_local.h}           |   0
 crypto/include/internal/store.h                    |  10 -
 crypto/info.c                                      |   2 +-
 crypto/init.c                                      |  18 +-
 crypto/initthread.c                                |   2 +-
 crypto/lhash/lh_stats.c                            |   2 +-
 crypto/lhash/lhash.c                               |   6 +-
 crypto/lhash/{lhash_lcl.h => lhash_local.h}        |   0
 crypto/md4/md4_dgst.c                              |   4 +-
 crypto/md4/{md4_locl.h => md4_local.h}             |   2 +-
 crypto/md5/md5_dgst.c                              |   4 +-
 crypto/md5/{md5_locl.h => md5_local.h}             |   2 +-
 crypto/mem.c                                       |   2 +-
 crypto/mips_arch.h                                 |   4 +-
 crypto/modes/cbc128.c                              |   2 +-
 crypto/modes/ccm128.c                              |   2 +-
 crypto/modes/cfb128.c                              |   2 +-
 crypto/modes/ctr128.c                              |   2 +-
 crypto/modes/cts128.c                              |   2 +-
 crypto/modes/gcm128.c                              |   2 +-
 crypto/modes/ocb128.c                              |   2 +-
 crypto/modes/ofb128.c                              |   2 +-
 crypto/modes/siv128.c                              |   4 +-
 crypto/modes/xts128.c                              |   2 +-
 crypto/objects/o_names.c                           |   4 +-
 crypto/objects/obj_dat.c                           |   8 +-
 crypto/objects/obj_lib.c                           |   2 +-
 crypto/objects/{obj_lcl.h => obj_local.h}          |   0
 crypto/ocsp/ocsp_asn.c                             |   2 +-
 crypto/ocsp/ocsp_cl.c                              |   2 +-
 crypto/ocsp/ocsp_ext.c                             |   2 +-
 crypto/ocsp/ocsp_ht.c                              |   2 +-
 crypto/ocsp/ocsp_lib.c                             |   2 +-
 crypto/ocsp/{ocsp_lcl.h => ocsp_local.h}           |   0
 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/pem/pem_lib.c                               |   4 +-
 crypto/pem/pem_pkey.c                              |   4 +-
 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 => p12_local.h}           |   0
 crypto/pkcs12/p12_mutl.c                           |   2 +-
 crypto/pkcs12/p12_npas.c                           |   2 +-
 crypto/pkcs12/p12_p8e.c                            |   2 +-
 crypto/pkcs12/p12_sbag.c                           |   2 +-
 crypto/pkcs7/pk7_lib.c                             |   4 +-
 crypto/poly1305/poly1305.c                         |   4 +-
 crypto/poly1305/poly1305_ameth.c                   |   6 +-
 crypto/ppc_arch.h                                  |   4 +-
 crypto/ppccap.c                                    |   4 +-
 crypto/property/defn_cache.c                       |   2 +-
 crypto/property/property.c                         |   8 +-
 .../property/{property_lcl.h => property_local.h}  |   0
 crypto/property/property_parse.c                   |   4 +-
 crypto/property/property_string.c                  |   4 +-
 crypto/provider_core.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                             |   6 +-
 crypto/rand/rand_crng_test.c                       |   4 +-
 crypto/rand/rand_lib.c                             |   4 +-
 crypto/rand/{rand_lcl.h => rand_local.h}           |   6 +-
 crypto/rand/rand_unix.c                            |   4 +-
 crypto/rand/rand_vms.c                             |   4 +-
 crypto/rand/rand_vxworks.c                         |   4 +-
 crypto/rand/rand_win.c                             |   4 +-
 crypto/rc2/rc2_cbc.c                               |   2 +-
 crypto/rc2/rc2_ecb.c                               |   2 +-
 crypto/rc2/{rc2_locl.h => rc2_local.h}             |   0
 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_locl.h => rc4_local.h}             |   4 +-
 crypto/rc4/rc4_skey.c                              |   2 +-
 crypto/rc5/rc5_ecb.c                               |   2 +-
 crypto/rc5/rc5_enc.c                               |   2 +-
 crypto/rc5/{rc5_locl.h => rc5_local.h}             |   0
 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_locl.h => rmd_local.h}          |   4 +-
 crypto/rsa/rsa_ameth.c                             |   6 +-
 crypto/rsa/rsa_asn1.c                              |   2 +-
 crypto/rsa/rsa_chk.c                               |   2 +-
 crypto/rsa/rsa_crpt.c                              |   4 +-
 crypto/rsa/rsa_gen.c                               |   2 +-
 crypto/rsa/rsa_lib.c                               |   6 +-
 crypto/rsa/{rsa_locl.h => rsa_local.h}             |   6 +-
 crypto/rsa/rsa_meth.c                              |   2 +-
 crypto/rsa/rsa_mp.c                                |   2 +-
 crypto/rsa/rsa_oaep.c                              |   4 +-
 crypto/rsa/rsa_ossl.c                              |   6 +-
 crypto/rsa/rsa_pk1.c                               |   2 +-
 crypto/rsa/rsa_pmeth.c                             |   6 +-
 crypto/rsa/rsa_pss.c                               |   2 +-
 crypto/rsa/rsa_sign.c                              |   4 +-
 crypto/rsa/rsa_sp800_56b_check.c                   |   4 +-
 crypto/rsa/rsa_sp800_56b_gen.c                     |   4 +-
 crypto/rsa/rsa_ssl.c                               |   2 +-
 crypto/rsa/rsa_x931g.c                             |   2 +-
 crypto/s390x_arch.h                                |   4 +-
 crypto/s390xcap.c                                  |   2 +-
 crypto/seed/seed.c                                 |   2 +-
 crypto/seed/{seed_locl.h => seed_local.h}          |   6 +-
 crypto/sha/sha1dgst.c                              |   4 +-
 crypto/sha/sha256.c                                |   2 +-
 crypto/sha/sha512.c                                |   2 +-
 crypto/sha/{sha_locl.h => sha_local.h}             |   2 +-
 crypto/siphash/siphash.c                           |   2 +-
 crypto/siphash/siphash_ameth.c                     |   6 +-
 crypto/sm2/sm2_crypt.c                             |   6 +-
 crypto/sm2/sm2_err.c                               |   2 +-
 crypto/sm2/sm2_pmeth.c                             |   6 +-
 crypto/sm2/sm2_sign.c                              |   6 +-
 crypto/sm3/m_sm3.c                                 |   2 +-
 crypto/sm3/sm3.c                                   |   2 +-
 crypto/sm3/{sm3_locl.h => sm3_local.h}             |   2 +-
 crypto/sm4/sm4.c                                   |   2 +-
 crypto/sparc_arch.h                                |   6 +-
 crypto/sparse_array.c                              |   2 +-
 crypto/srp/srp_lib.c                               |   2 +-
 crypto/srp/srp_vfy.c                               |   2 +-
 crypto/store/loader_file.c                         |   8 +-
 crypto/store/store_init.c                          |   4 +-
 crypto/store/store_lib.c                           |   4 +-
 crypto/store/{store_locl.h => store_local.h}       |   0
 crypto/store/store_register.c                      |   4 +-
 crypto/trace.c                                     |   2 +-
 crypto/ts/ts_asn1.c                                |   2 +-
 crypto/ts/ts_lib.c                                 |   2 +-
 crypto/ts/{ts_lcl.h => ts_local.h}                 |   0
 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                            |   4 +-
 crypto/ts/ts_rsp_utils.c                           |   2 +-
 crypto/ts/ts_rsp_verify.c                          |   4 +-
 crypto/ts/ts_verify_ctx.c                          |   2 +-
 crypto/ui/ui_lib.c                                 |   2 +-
 crypto/ui/{ui_locl.h => ui_local.h}                |   4 +-
 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_locl.h => wp_local.h}          |   0
 crypto/x509/by_dir.c                               |   4 +-
 crypto/x509/by_file.c                              |   2 +-
 crypto/x509/pcy_cache.c                            |   4 +-
 crypto/x509/pcy_data.c                             |   2 +-
 crypto/x509/pcy_lib.c                              |   2 +-
 crypto/x509/{pcy_int.h => pcy_local.h}             |   0
 crypto/x509/pcy_map.c                              |   4 +-
 crypto/x509/pcy_node.c                             |   2 +-
 crypto/x509/pcy_tree.c                             |   2 +-
 crypto/x509/t_x509.c                               |   2 +-
 crypto/x509/v3_addr.c                              |   2 +-
 crypto/x509/v3_admis.c                             |   2 +-
 crypto/x509/v3_admis.h                             |   4 +-
 crypto/x509/v3_asid.c                              |   2 +-
 crypto/x509/v3_conf.c                              |   4 +-
 crypto/x509/v3_cpols.c                             |   2 +-
 crypto/x509/v3_crld.c                              |   2 +-
 crypto/x509/v3_ncons.c                             |   4 +-
 crypto/x509/v3_purp.c                              |   2 +-
 crypto/x509/v3_skey.c                              |   2 +-
 crypto/x509/v3_utl.c                               |   4 +-
 crypto/x509/x509_att.c                             |   2 +-
 crypto/x509/x509_cmp.c                             |   2 +-
 crypto/x509/x509_ext.c                             |   2 +-
 crypto/x509/{x509_lcl.h => x509_local.h}           |   0
 crypto/x509/x509_lu.c                              |   4 +-
 crypto/x509/x509_meth.c                            |   4 +-
 crypto/x509/x509_obj.c                             |   2 +-
 crypto/x509/x509_r2x.c                             |   2 +-
 crypto/x509/x509_req.c                             |   2 +-
 crypto/x509/x509_set.c                             |   6 +-
 crypto/x509/x509_trs.c                             |   2 +-
 crypto/x509/x509_v3.c                              |   2 +-
 crypto/x509/x509_vfy.c                             |   6 +-
 crypto/x509/x509_vpm.c                             |   4 +-
 crypto/x509/x509cset.c                             |   2 +-
 crypto/x509/x509name.c                             |   2 +-
 crypto/x509/x509rset.c                             |   2 +-
 crypto/x509/x_all.c                                |   6 +-
 crypto/x509/x_attrib.c                             |   2 +-
 crypto/x509/x_crl.c                                |   4 +-
 crypto/x509/x_exten.c                              |   2 +-
 crypto/x509/x_name.c                               |   8 +-
 crypto/x509/x_pubkey.c                             |   6 +-
 crypto/x509/x_req.c                                |   2 +-
 crypto/x509/x_x509.c                               |   2 +-
 crypto/x509/x_x509a.c                              |   2 +-
 doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod       |   2 +-
 doc/internal/man3/evp_generic_fetch.pod            |   2 +-
 .../man3/evp_keymgmt_export_to_provider.pod        |   2 +-
 doc/internal/man3/evp_keymgmt_freekey.pod          |   2 +-
 doc/internal/man3/openssl_ctx_get_data.pod         |   2 +-
 .../man3/ossl_cmp_asn1_octet_string_set1.pod       |   2 +-
 doc/internal/man3/ossl_init_thread_deregister.pod  |   2 +-
 doc/internal/man3/rand_bytes_ex.pod                |   2 +-
 e_os.h                                             |   4 +-
 engines/e_afalg.h                                  |   4 +-
 engines/e_afalg_err.h                              |   4 +-
 engines/e_capi_err.h                               |   4 +-
 engines/e_dasync_err.h                             |   4 +-
 engines/e_ossltest_err.h                           |   4 +-
 .../crypto}/__DECC_INCLUDE_EPILOGUE.H              |   0
 .../crypto}/__DECC_INCLUDE_PROLOGUE.H              |   0
 {crypto/include/internal => include/crypto}/aria.h |   4 +-
 .../internal/asn1_int.h => include/crypto/asn1.h   |   0
 .../include/internal => include/crypto}/asn1_dsa.h |   4 +-
 .../include/internal => include/crypto}/async.h    |   0
 .../internal/bn_int.h => include/crypto/bn.h       |   4 +-
 .../internal => include/crypto}/bn_conf.h.in       |   4 +-
 .../include/internal => include/crypto}/bn_dh.h    |   0
 .../include/internal => include/crypto}/bn_srp.h   |   0
 .../include/internal => include/crypto}/chacha.h   |   4 +-
 .../crypto}/ciphermode_platform.h                  |   6 +-
 .../internal/cms_int.h => include/crypto/cms.h     |   0
 .../cryptlib_int.h => include/crypto/cryptlib.h    |   0
 .../include/internal => include/crypto}/ctype.h    |   4 +-
 .../internal => include/crypto}/dso_conf.h.in      |   4 +-
 .../internal/ec_int.h => include/crypto/ec.h       |   4 +-
 .../include/internal => include/crypto}/engine.h   |   0
 .../internal/err_int.h => include/crypto/err.h     |   4 +-
 .../internal/ess_int.h => include/crypto/ess.h     |   0
 .../internal/evp_int.h => include/crypto/evp.h     |   0
 .../include/internal => include/crypto}/lhash.h    |   4 +-
 .../internal => include/crypto}/md32_common.h      |   0
 .../internal/modes_int.h => include/crypto/modes.h |   0
 .../include/internal => include/crypto}/objects.h  |   0
 .../include/internal => include/crypto}/poly1305.h |   0
 .../internal/rand_int.h => include/crypto/rand.h   |   4 +-
 {crypto/include/internal => include/crypto}/sha.h  |   4 +-
 .../include/internal => include/crypto}/siphash.h  |   0
 .../internal/siv_int.h => include/crypto/siv.h     |   0
 {crypto/include/internal => include/crypto}/sm2.h  |   4 +-
 .../include/internal => include/crypto}/sm2err.h   |   4 +-
 {crypto/include/internal => include/crypto}/sm4.h  |   4 +-
 .../internal => include/crypto}/sparse_array.h     |   4 +-
 .../internal/store_int.h => include/crypto/store.h |   8 +-
 .../internal/x509_int.h => include/crypto/x509.h   |   0
 include/internal/bio.h                             |   4 +-
 include/internal/conf.h                            |   4 +-
 .../{constant_time_locl.h => constant_time.h}      |   6 +-
 include/internal/cryptlib.h                        |   4 +-
 include/internal/dane.h                            |   6 +-
 include/internal/dso.h                             |   4 +-
 include/internal/dsoerr.h                          |   4 +-
 include/internal/err.h                             |   4 +-
 include/internal/md5_sha1.h                        |   6 +-
 include/internal/nelem.h                           |   4 +-
 include/internal/numbers.h                         |   4 +-
 include/internal/o_dir.h                           |   4 +-
 include/internal/packet.h                          |   6 +-
 include/internal/param_build.h                     |   2 +-
 include/internal/property.h                        |   4 +-
 include/internal/propertyerr.h                     |   4 +-
 include/internal/refcount.h                        |   4 +-
 include/internal/sha3.h                            |   6 +-
 include/internal/sm3.h                             |   6 +-
 include/internal/sockets.h                         |   4 +-
 include/internal/sslconf.h                         |   4 +-
 include/openssl/aes.h                              |  10 +-
 include/openssl/asn1.h                             |  12 +-
 include/openssl/asn1err.h                          |  10 +-
 include/openssl/asn1t.h                            |  10 +-
 include/openssl/async.h                            |  10 +-
 include/openssl/asyncerr.h                         |  10 +-
 include/openssl/bio.h                              |  10 +-
 include/openssl/bioerr.h                           |  10 +-
 include/openssl/blowfish.h                         |  10 +-
 include/openssl/bn.h                               |  12 +-
 include/openssl/bnerr.h                            |  10 +-
 include/openssl/buffer.h                           |  14 +-
 include/openssl/buffererr.h                        |  10 +-
 include/openssl/camellia.h                         |  10 +-
 include/openssl/cast.h                             |  10 +-
 include/openssl/cmac.h                             |  10 +-
 include/openssl/cmp.h                              |   8 +-
 include/openssl/cmp_util.h                         |   6 +-
 include/openssl/cmperr.h                           |   4 +-
 include/openssl/cms.h                              |  12 +-
 include/openssl/cmserr.h                           |  10 +-
 include/openssl/comp.h                             |  12 +-
 include/openssl/comperr.h                          |  10 +-
 include/openssl/conf.h                             |  12 +-
 include/openssl/conf_api.h                         |  10 +-
 include/openssl/conferr.h                          |  10 +-
 include/openssl/core.h                             |   6 +-
 include/openssl/core_names.h                       |   4 +-
 include/openssl/core_numbers.h                     |   4 +-
 include/openssl/crmf.h                             |   8 +-
 include/openssl/crmferr.h                          |   4 +-
 include/openssl/crypto.h                           |  12 +-
 include/openssl/cryptoerr.h                        |  10 +-
 include/openssl/ct.h                               |  12 +-
 include/openssl/cterr.h                            |  10 +-
 include/openssl/des.h                              |  10 +-
 include/openssl/dh.h                               |  12 +-
 include/openssl/dherr.h                            |  10 +-
 include/openssl/dsa.h                              |  12 +-
 include/openssl/dsaerr.h                           |  10 +-
 include/openssl/dtls1.h                            |  10 +-
 include/openssl/e_os2.h                            |  10 +-
 include/openssl/ebcdic.h                           |  10 +-
 include/openssl/ec.h                               |  10 +-
 include/openssl/ecerr.h                            |  10 +-
 include/openssl/engine.h                           |  12 +-
 include/openssl/engineerr.h                        |  10 +-
 include/openssl/err.h                              |  12 +-
 include/openssl/ess.h                              |   4 +-
 include/openssl/esserr.h                           |   4 +-
 include/openssl/evp.h                              |  12 +-
 include/openssl/evperr.h                           |  10 +-
 include/openssl/fips_names.h                       |   6 +-
 include/openssl/hmac.h                             |  10 +-
 include/openssl/idea.h                             |  10 +-
 include/openssl/kdf.h                              |  12 +-
 include/openssl/lhash.h                            |  10 +-
 include/openssl/md2.h                              |  10 +-
 include/openssl/md4.h                              |  10 +-
 include/openssl/md5.h                              |  10 +-
 include/openssl/mdc2.h                             |  10 +-
 include/openssl/modes.h                            |  12 +-
 include/openssl/objects.h                          |  10 +-
 include/openssl/objectserr.h                       |  10 +-
 include/openssl/ocsp.h                             |  12 +-
 include/openssl/ocsperr.h                          |  10 +-
 include/openssl/opensslconf.h.in                   |  14 +-
 include/openssl/opensslv.h                         |  12 +-
 include/openssl/ossl_typ.h                         | 214 +--------------------
 include/openssl/params.h                           |   4 +-
 include/openssl/pem.h                              |  10 +-
 include/openssl/pem2.h                             |  10 +-
 include/openssl/pemerr.h                           |  10 +-
 include/openssl/pkcs12.h                           |  10 +-
 include/openssl/pkcs12err.h                        |  10 +-
 include/openssl/pkcs7.h                            |  12 +-
 include/openssl/pkcs7err.h                         |  10 +-
 include/openssl/provider.h                         |   4 +-
 include/openssl/rand.h                             |  12 +-
 include/openssl/rand_drbg.h                        |  12 +-
 include/openssl/randerr.h                          |  10 +-
 include/openssl/rc2.h                              |  10 +-
 include/openssl/rc4.h                              |  10 +-
 include/openssl/rc5.h                              |  10 +-
 include/openssl/ripemd.h                           |  10 +-
 include/openssl/rsa.h                              |  12 +-
 include/openssl/rsaerr.h                           |  10 +-
 include/openssl/safestack.h                        |  10 +-
 include/openssl/seed.h                             |  10 +-
 include/openssl/sha.h                              |  10 +-
 include/openssl/srp.h                              |  10 +-
 include/openssl/srtp.h                             |  10 +-
 include/openssl/ssl.h                              |  12 +-
 include/openssl/ssl2.h                             |  10 +-
 include/openssl/ssl3.h                             |  10 +-
 include/openssl/sslerr.h                           |  10 +-
 include/openssl/stack.h                            |  10 +-
 include/openssl/store.h                            |  12 +-
 include/openssl/storeerr.h                         |  10 +-
 include/openssl/symhacks.h                         |  10 +-
 include/openssl/tls1.h                             |  10 +-
 include/openssl/trace.h                            |   4 +-
 include/openssl/ts.h                               |  10 +-
 include/openssl/tserr.h                            |  10 +-
 include/openssl/txt_db.h                           |  10 +-
 include/openssl/{ossl_typ.h => types.h}            |   6 +-
 include/openssl/ui.h                               |  12 +-
 include/openssl/uierr.h                            |  10 +-
 include/openssl/whrlpool.h                         |  10 +-
 include/openssl/x509.h                             |  12 +-
 include/openssl/x509_vfy.h                         |  12 +-
 include/openssl/x509err.h                          |  10 +-
 include/openssl/x509v3.h                           |  12 +-
 include/openssl/x509v3err.h                        |  10 +-
 providers/build.info                               |   4 +-
 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              |   4 +-
 providers/common/ciphers/cipher_gcm_hw.c           |   2 +-
 .../ciphers/{cipher_locl.h => cipher_local.h}      |   0
 providers/common/ciphers/cipher_tdes.c             |   4 +-
 providers/common/ciphers/cipher_tdes_hw.c          |   2 +-
 providers/common/digests/sha2_prov.c               |   2 +-
 .../common/include/internal/ciphers/ciphercommon.h |   4 +-
 providers/common/include/internal/digestcommon.h   |   6 +-
 .../common/include/internal/providercommonerr.h    |   4 +-
 providers/common/kdfs/hkdf.c                       |   2 +-
 providers/common/kdfs/kbkdf.c                      |   2 +-
 providers/common/kdfs/pbkdf2.c                     |   2 +-
 providers/common/kdfs/sskdf.c                      |   2 +-
 providers/common/kdfs/tls1_prf.c                   |   2 +-
 providers/default/ciphers/cipher_aria.h            |   2 +-
 providers/default/ciphers/cipher_aria_ccm.h        |   2 +-
 providers/default/ciphers/cipher_aria_gcm.h        |   2 +-
 providers/default/ciphers/cipher_des.c             |   4 +-
 providers/default/ciphers/cipher_sm4.h             |   2 +-
 providers/default/ciphers/cipher_tdes_wrap.c       |   4 +-
 providers/default/include/internal/blake2.h        |   6 +-
 providers/default/kdfs/scrypt.c                    |   2 +-
 providers/default/kdfs/sshkdf.c                    |   2 +-
 providers/default/kdfs/x942kdf.c                   |   2 +-
 providers/default/macs/poly1305_prov.c             |   2 +-
 providers/default/macs/siphash_prov.c              |   2 +-
 providers/fips/fipsprov.c                          |   2 +-
 providers/fips/selftest.h                          |   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_locl.h => record_local.h}       |   0
 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_locl.h => ssl_local.h}                    |   4 +-
 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_locl.h => statem_local.h}       |   0
 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/asn1_dsa_internal_test.c                      |   2 +-
 test/asn1_internal_test.c                          |   2 +-
 test/bn_internal_test.c                            |   2 +-
 test/build.info                                    |   6 +-
 test/chacha_internal_test.c                        |   2 +-
 test/cipher_overhead_test.c                        |   2 +-
 test/cmp_testlib.h                                 |   8 +-
 test/constant_time_test.c                          |   2 +-
 test/ctype_internal_test.c                         |   2 +-
 test/curve448_internal_test.c                      |   2 +-
 test/drbg_cavs_data.h                              |   4 +-
 test/drbg_cavs_test.c                              |   2 +-
 test/drbgtest.c                                    |   4 +-
 test/dtls_mtu_test.c                               |   2 +-
 test/ec_internal_test.c                            |   2 +-
 test/ecdsatest.h                                   |   6 +-
 test/evp_extra_test.c                              |   2 +-
 test/handshake_helper.c                            |   2 +-
 test/handshake_helper.h                            |   6 +-
 test/mdc2test.c                                    |   2 +-
 test/modes_internal_test.c                         |   2 +-
 test/ossl_shim/async_bio.h                         |   6 +-
 test/ossl_shim/include/openssl/base.h              |   6 +-
 test/ossl_shim/packeted_bio.h                      |   6 +-
 test/ossl_shim/test_config.h                       |   6 +-
 test/ossl_test_endian.h                            |   4 +-
 test/poly1305_internal_test.c                      |   2 +-
 test/property_test.c                               |   2 +-
 test/rsa_sp800_56b_test.c                          |   2 +-
 test/shlibloadtest.c                               |   4 +-
 test/siphash_internal_test.c                       |   2 +-
 test/sm2_internal_test.c                           |   2 +-
 test/sm4_internal_test.c                           |   2 +-
 test/sparse_array_test.c                           |   2 +-
 test/ssl_cert_table_internal_test.c                |   2 +-
 test/ssl_test_ctx.h                                |   6 +-
 test/sslapitest.c                                  |   2 +-
 test/ssltestlib.h                                  |   6 +-
 test/testutil.h                                    |   6 +-
 test/testutil/output.h                             |   6 +-
 test/tls13encryptiontest.c                         |   4 +-
 test/tls13secretstest.c                            |   2 +-
 util/fix-includes                                  |  19 ++
 util/fix-includes.sed                              |   6 +
 util/mkerr.pl                                      |   4 +-
 891 files changed, 2030 insertions(+), 1629 deletions(-)
 rename crypto/aes/{aes_locl.h => aes_local.h} (90%)
 rename crypto/asn1/{asn1_locl.h => asn1_local.h} (100%)
 rename crypto/async/{async_locl.h => async_local.h} (98%)
 rename crypto/bf/{bf_locl.h => bf_local.h} (98%)
 rename crypto/bio/{bio_lcl.h => bio_local.h} (97%)
 rename crypto/bn/{bn_lcl.h => bn_local.h} (99%)
 rename crypto/camellia/{cmll_locl.h => cmll_local.h} (91%)
 rename crypto/cast/{cast_lcl.h => cast_local.h} (100%)
 rename crypto/cmp/{cmp_int.h => cmp_local.h} (99%)
 rename crypto/cms/{cms_lcl.h => cms_local.h} (99%)
 rename crypto/comp/{comp_lcl.h => comp_local.h} (100%)
 rename crypto/conf/{conf_lcl.h => conf_local.h} (100%)
 rename crypto/crmf/{crmf_int.h => crmf_local.h} (99%)
 rename crypto/ct/{ct_locl.h => ct_local.h} (100%)
 rename crypto/des/{des_locl.h => des_local.h} (99%)
 rename crypto/dh/{dh_locl.h => dh_local.h} (100%)
 rename crypto/dsa/{dsa_locl.h => dsa_local.h} (100%)
 rename crypto/dso/{dso_locl.h => dso_local.h} (99%)
 rename crypto/ec/curve448/{curve448_lcl.h => curve448_local.h} (92%)
 rename crypto/ec/{ec_lcl.h => ec_local.h} (99%)
 rename crypto/engine/{eng_int.h => eng_local.h} (97%)
 rename crypto/err/{err_locl.h => err_local.h} (100%)
 rename crypto/evp/{evp_locl.h => evp_local.h} (99%)
 rename crypto/hmac/{hmac_lcl.h => hmac_local.h} (90%)
 rename crypto/idea/{idea_lcl.h => idea_local.h} (100%)
 delete mode 100644 crypto/include/internal/store.h
 rename crypto/lhash/{lhash_lcl.h => lhash_local.h} (100%)
 rename crypto/md4/{md4_locl.h => md4_local.h} (98%)
 rename crypto/md5/{md5_locl.h => md5_local.h} (98%)
 rename crypto/objects/{obj_lcl.h => obj_local.h} (100%)
 rename crypto/ocsp/{ocsp_lcl.h => ocsp_local.h} (100%)
 rename crypto/pkcs12/{p12_lcl.h => p12_local.h} (100%)
 rename crypto/property/{property_lcl.h => property_local.h} (100%)
 rename crypto/rand/{rand_lcl.h => rand_local.h} (99%)
 rename crypto/rc2/{rc2_locl.h => rc2_local.h} (100%)
 rename crypto/rc4/{rc4_locl.h => rc4_local.h} (86%)
 rename crypto/rc5/{rc5_locl.h => rc5_local.h} (100%)
 rename crypto/ripemd/{rmd_locl.h => rmd_local.h} (96%)
 rename crypto/rsa/{rsa_locl.h => rsa_local.h} (98%)
 rename crypto/seed/{seed_locl.h => seed_local.h} (97%)
 rename crypto/sha/{sha_locl.h => sha_local.h} (99%)
 rename crypto/sm3/{sm3_locl.h => sm3_local.h} (98%)
 rename crypto/store/{store_locl.h => store_local.h} (100%)
 rename crypto/ts/{ts_lcl.h => ts_local.h} (100%)
 rename crypto/ui/{ui_locl.h => ui_local.h} (98%)
 rename crypto/whrlpool/{wp_locl.h => wp_local.h} (100%)
 rename crypto/x509/{pcy_int.h => pcy_local.h} (100%)
 rename crypto/x509/{x509_lcl.h => x509_local.h} (100%)
 rename {crypto/include/internal => include/crypto}/__DECC_INCLUDE_EPILOGUE.H (100%)
 rename {crypto/include/internal => include/crypto}/__DECC_INCLUDE_PROLOGUE.H (100%)
 rename {crypto/include/internal => include/crypto}/aria.h (96%)
 rename crypto/include/internal/asn1_int.h => include/crypto/asn1.h (100%)
 rename {crypto/include/internal => include/crypto}/asn1_dsa.h (92%)
 rename {crypto/include/internal => include/crypto}/async.h (100%)
 rename crypto/include/internal/bn_int.h => include/crypto/bn.h (98%)
 rename {crypto/include/internal => include/crypto}/bn_conf.h.in (93%)
 rename {crypto/include/internal => include/crypto}/bn_dh.h (100%)
 rename {crypto/include/internal => include/crypto}/bn_srp.h (100%)
 rename {crypto/include/internal => include/crypto}/chacha.h (96%)
 rename {crypto/include/internal => include/crypto}/ciphermode_platform.h (99%)
 rename crypto/include/internal/cms_int.h => include/crypto/cms.h (100%)
 rename crypto/include/internal/cryptlib_int.h => include/crypto/cryptlib.h (100%)
 rename {crypto/include/internal => include/crypto}/ctype.h (98%)
 rename {crypto/include/internal => include/crypto}/dso_conf.h.in (95%)
 rename crypto/include/internal/ec_int.h => include/crypto/ec.h (96%)
 rename {crypto/include/internal => include/crypto}/engine.h (100%)
 rename crypto/include/internal/err_int.h => include/crypto/err.h (89%)
 rename crypto/include/internal/ess_int.h => include/crypto/ess.h (100%)
 rename crypto/include/internal/evp_int.h => include/crypto/evp.h (100%)
 rename {crypto/include/internal => include/crypto}/lhash.h (87%)
 rename {crypto/include/internal => include/crypto}/md32_common.h (100%)
 rename crypto/include/internal/modes_int.h => include/crypto/modes.h (100%)
 rename {crypto/include/internal => include/crypto}/objects.h (100%)
 rename {crypto/include/internal => include/crypto}/poly1305.h (100%)
 rename crypto/include/internal/rand_int.h => include/crypto/rand.h (98%)
 rename {crypto/include/internal => include/crypto}/sha.h (90%)
 rename {crypto/include/internal => include/crypto}/siphash.h (100%)
 rename crypto/include/internal/siv_int.h => include/crypto/siv.h (100%)
 rename {crypto/include/internal => include/crypto}/sm2.h (97%)
 rename {crypto/include/internal => include/crypto}/sm2err.h (97%)
 rename {crypto/include/internal => include/crypto}/sm4.h (94%)
 rename {crypto/include/internal => include/crypto}/sparse_array.h (97%)
 rename crypto/include/internal/store_int.h => include/crypto/store.h (82%)
 rename crypto/include/internal/x509_int.h => include/crypto/x509.h (100%)
 rename include/internal/{constant_time_locl.h => constant_time.h} (98%)
 copy include/openssl/{ossl_typ.h => types.h} (98%)
 rename providers/common/ciphers/{cipher_locl.h => cipher_local.h} (100%)
 rename ssl/record/{record_locl.h => record_local.h} (100%)
 rename ssl/{ssl_locl.h => ssl_local.h} (99%)
 rename ssl/statem/{statem_locl.h => statem_local.h} (100%)
 create mode 100755 util/fix-includes
 create mode 100644 util/fix-includes.sed

diff --git a/.gitignore b/.gitignore
index 9fdd588e4f..50f461533e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,7 +26,7 @@ Makefile
 
 # Auto generated headers
 /crypto/buildinf.h
-/crypto/include/internal/*_conf.h
+/include/crypto/*_conf.h
 /openssl/include/opensslconf.h
 /util/domd
 
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/apps/include/apps.h b/apps/include/apps.h
index 8b28d749e9..41db80740b 100644
--- a/apps/include/apps.h
+++ b/apps/include/apps.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_APPS_H
-# define HEADER_APPS_H
+#ifndef OSSL_APPS_H
+# define OSSL_APPS_H
 
 # include "e_os.h" /* struct timeval for DTLS */
 # include "internal/nelem.h"
@@ -21,7 +21,7 @@
 # endif
 
 # include <openssl/e_os2.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/bio.h>
 # include <openssl/x509.h>
 # include <openssl/conf.h>
diff --git a/apps/include/apps_ui.h b/apps/include/apps_ui.h
index 36e0864a08..55a6b510a4 100644
--- a/apps/include/apps_ui.h
+++ b/apps/include/apps_ui.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_APPS_UI_H
-# define HEADER_APPS_UI_H
+#ifndef OSSL_APPS_UI_H
+# define OSSL_APPS_UI_H
 
 
 # define PW_MIN_LENGTH 4
diff --git a/apps/include/fmt.h b/apps/include/fmt.h
index e3da9a44cd..01acf86694 100644
--- a/apps/include/fmt.h
+++ b/apps/include/fmt.h
@@ -14,8 +14,8 @@
  * shared fields have been moved into this file.
  */
 
-#ifndef HEADER_FMT_H
-#define HEADER_FMT_H
+#ifndef OSSL_APPS_FMT_H
+#define OSSL_APPS_FMT_H
 
 /* On some platforms, it's important to distinguish between text and binary
  * files.  On some, there might even be specific file formats for different
@@ -41,4 +41,4 @@
 
 int FMT_istext(int format);
 
-#endif /* HEADER_FMT_H_ */
+#endif /* OSSL_APPS_FMT_H_ */
diff --git a/apps/include/function.h b/apps/include/function.h
index 4125979305..1911a64947 100644
--- a/apps/include/function.h
+++ b/apps/include/function.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef APPS_FUNCTION_H
-# define APPS_FUNCTION_H
+#ifndef OSSL_APPS_FUNCTION_H
+# define OSSL_APPS_FUNCTION_H
 
 # include <openssl/lhash.h>
 # include "opt.h"
diff --git a/apps/include/opt.h b/apps/include/opt.h
index 92a7fd1d82..5493563004 100644
--- a/apps/include/opt.h
+++ b/apps/include/opt.h
@@ -6,12 +6,12 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-#ifndef HEADER_OPT_H
-#define HEADER_OPT_H
+#ifndef OSSL_APPS_OPT_H
+#define OSSL_APPS_OPT_H
 
 #include <sys/types.h>
 #include <openssl/e_os2.h>
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 #include <stdarg.h>
 
 /*
@@ -347,4 +347,4 @@ int opt_format_error(const char *s, unsigned long flags);
 int opt_isdir(const char *name);
 int opt_printf_stderr(const char *fmt, ...);
 
-#endif /* HEADER_OPT_H */
+#endif /* OSSL_APPS_OPT_H */
diff --git a/apps/include/platform.h b/apps/include/platform.h
index 49276b6fc9..491559df31 100644
--- a/apps/include/platform.h
+++ b/apps/include/platform.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PLATFORM_H
-# define HEADER_PLATFORM_H
+#ifndef OSSL_APPS_PLATFORM_H
+# define OSSL_APPS_PLATFORM_H
 
 # include <openssl/e_os2.h>
 
diff --git a/apps/include/vms_term_sock.h b/apps/include/vms_term_sock.h
index d4c7c3d160..eae37b1af9 100644
--- a/apps/include/vms_term_sock.h
+++ b/apps/include/vms_term_sock.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef TERM_SOCK_H
-# define TERM_SOCK_H
+#ifndef OSSL_APPS_VMS_TERM_SOCK_H
+# define OSSL_APPS_VMS_TERM_SOCK_H
 
 /*
 ** Terminal Socket Function Codes
diff --git a/apps/timeouts.h b/apps/timeouts.h
index 932be1cc30..0028527247 100644
--- a/apps/timeouts.h
+++ b/apps/timeouts.h
@@ -7,11 +7,11 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef INCLUDED_TIMEOUTS_H
-# define INCLUDED_TIMEOUTS_H
+#ifndef OSSL_APPS_TIMEOUTS_H
+# define OSSL_APPS_TIMEOUTS_H
 
 /* numbers in us */
 # define DGRAM_RCV_TIMEOUT         250000
 # define DGRAM_SND_TIMEOUT         250000
 
-#endif                          /* ! INCLUDED_TIMEOUTS_H */
+#endif                          /* ! OSSL_APPS_TIMEOUTS_H */
diff --git a/build.info b/build.info
index a0ecb21881..83dc6ed164 100644
--- a/build.info
+++ b/build.info
@@ -3,20 +3,20 @@
 SUBDIRS=crypto ssl apps test util tools fuzz engines providers
 
 LIBS=libcrypto libssl
-INCLUDE[libcrypto]=. crypto/include include
+INCLUDE[libcrypto]=. include
 INCLUDE[libssl]=. include
 DEPEND[libssl]=libcrypto
 
 # Empty DEPEND "indices" means the dependencies are expected to be built
 # unconditionally before anything else.
-DEPEND[]=include/openssl/opensslconf.h crypto/include/internal/bn_conf.h \
-         crypto/include/internal/dso_conf.h doc/man7/openssl_user_macros.pod
+DEPEND[]=include/openssl/opensslconf.h include/crypto/bn_conf.h \
+         include/crypto/dso_conf.h doc/man7/openssl_user_macros.pod
 DEPEND[include/openssl/opensslconf.h]=configdata.pm
 GENERATE[include/openssl/opensslconf.h]=include/openssl/opensslconf.h.in
-DEPEND[crypto/include/internal/bn_conf.h]=configdata.pm
-GENERATE[crypto/include/internal/bn_conf.h]=crypto/include/internal/bn_conf.h.in
-DEPEND[crypto/include/internal/dso_conf.h]=configdata.pm
-GENERATE[crypto/include/internal/dso_conf.h]=crypto/include/internal/dso_conf.h.in
+DEPEND[include/crypto/bn_conf.h]=configdata.pm
+GENERATE[include/crypto/bn_conf.h]=include/crypto/bn_conf.h.in
+DEPEND[include/crypto/dso_conf.h]=configdata.pm
+GENERATE[include/crypto/dso_conf.h]=include/crypto/dso_conf.h.in
 DEPEND[doc/man7/openssl_user_macros.pod]=configdata.pm
 GENERATE[doc/man7/openssl_user_macros.pod]=doc/man7/openssl_user_macros.pod.in
 
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 <stdlib.h>
 #include <openssl/crypto.h>
 #include <openssl/aes.h>
-#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 <assert.h>
 
 #include <openssl/aes.h>
-#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 <openssl/aes.h>
-#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_locl.h b/crypto/aes/aes_local.h
similarity index 90%
rename from crypto/aes/aes_locl.h
rename to crypto/aes/aes_local.h
index 273c4fd288..b201905831 100644
--- a/crypto/aes/aes_locl.h
+++ b/crypto/aes/aes_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_AES_LOCL_H
-# define HEADER_AES_LOCL_H
+#ifndef OSSL_CRYPTO_AES_LOCAL_H
+# define OSSL_CRYPTO_AES_LOCAL_H
 
 # include <openssl/e_os2.h>
 # include <stdio.h>
@@ -39,4 +39,4 @@ typedef unsigned char u8;
 /* This controls loop-unrolling in aes_core.c */
 # undef FULL_UNROLL
 
-#endif                          /* !HEADER_AES_LOCL_H */
+#endif                          /* !OSSL_CRYPTO_AES_LOCAL_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 <openssl/opensslv.h>
 #include <openssl/aes.h>
-#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 <stdlib.h>
 #include <openssl/aes.h>
-#include "aes_locl.h"
+#include "aes_local.h"
 
 /*
  * These two parameters control which table, 256-byte or 2KB, is
diff --git a/crypto/aria/aria.c b/crypto/aria/aria.c
index 67bd8d95d8..c1b2254af7 100644
--- a/crypto/aria/aria.c
+++ b/crypto/aria/aria.c
@@ -19,7 +19,7 @@
  */
 
 #include <openssl/e_os2.h>
-#include "internal/aria.h"
+#include "crypto/aria.h"
 
 #include <assert.h>
 #include <string.h>
diff --git a/crypto/arm_arch.h b/crypto/arm_arch.h
index 5b156d3c44..2d279d6459 100644
--- a/crypto/arm_arch.h
+++ b/crypto/arm_arch.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef __ARM_ARCH_H__
-# define __ARM_ARCH_H__
+#ifndef OSSL_CRYPTO_ARM_ARCH_H
+# define OSSL_CRYPTO_ARM_ARCH_H
 
 # if !defined(__ARM_ARCH__)
 #  if defined(__CC_ARM)
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 <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
-#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_d2i_fp.c b/crypto/asn1/a_d2i_fp.c
index a8d80090cf..186e7ec413 100644
--- a/crypto/asn1/a_d2i_fp.c
+++ b/crypto/asn1/a_d2i_fp.c
@@ -13,7 +13,7 @@
 #include "internal/numbers.h"
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 
 #ifndef NO_OLD_ASN1
 # ifndef OPENSSL_NO_STDIO
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 <time.h>
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
-#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 <limits.h>
 #include <openssl/asn1.h>
 #include <openssl/bn.h>
-#include "asn1_locl.h"
+#include "asn1_local.h"
 
 ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x)
 {
diff --git a/crypto/asn1/a_mbstr.c b/crypto/asn1/a_mbstr.c
index ea08edc219..122cafd02c 100644
--- a/crypto/asn1/a_mbstr.c
+++ b/crypto/asn1/a_mbstr.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
 
diff --git a/crypto/asn1/a_object.c b/crypto/asn1/a_object.c
index 913fa9a14d..123f93000b 100644
--- a/crypto/asn1/a_object.c
+++ b/crypto/asn1/a_object.c
@@ -9,14 +9,14 @@
 
 #include <stdio.h>
 #include <limits.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
 #include <openssl/objects.h>
 #include <openssl/bn.h>
-#include "internal/asn1_int.h"
-#include "asn1_locl.h"
+#include "crypto/asn1.h"
+#include "asn1_local.h"
 
 int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp)
 {
diff --git a/crypto/asn1/a_print.c b/crypto/asn1/a_print.c
index 516f091916..328e0abcc5 100644
--- a/crypto/asn1/a_print.c
+++ b/crypto/asn1/a_print.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
 
diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c
index e2ef60f773..fdf25b204b 100644
--- a/crypto/asn1/a_sign.c
+++ b/crypto/asn1/a_sign.c
@@ -18,8 +18,8 @@
 #include <openssl/x509.h>
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 #ifndef NO_ASN1_OLD
 
diff --git a/crypto/asn1/a_strex.c b/crypto/asn1/a_strex.c
index 4f431480c2..91d78c6634 100644
--- a/crypto/asn1/a_strex.c
+++ b/crypto/asn1/a_strex.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "internal/cryptlib.h"
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c
index 16f0cc3fe3..c978248d3e 100644
--- a/crypto/asn1/a_time.c
+++ b/crypto/asn1/a_time.c
@@ -16,10 +16,10 @@
 
 #include <stdio.h>
 #include <time.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
-#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 <openssl/asn1t.h>
 #include <openssl/objects.h>
-#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 <time.h>
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
-#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/a_verify.c b/crypto/asn1/a_verify.c
index d26c523600..9484bccf4c 100644
--- a/crypto/asn1/a_verify.c
+++ b/crypto/asn1/a_verify.c
@@ -18,8 +18,8 @@
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 #ifndef NO_ASN1_OLD
 
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index b2bcd5acac..4295d889cb 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -13,8 +13,8 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/engine.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 #include "standard_methods.h"
 
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 <limits.h>
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
-#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_locl.h b/crypto/asn1/asn1_local.h
similarity index 100%
rename from crypto/asn1/asn1_locl.h
rename to crypto/asn1/asn1_local.h
diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c
index 5c3493832b..3282163199 100644
--- a/crypto/asn1/asn_mime.c
+++ b/crypto/asn1/asn_mime.c
@@ -8,15 +8,15 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/rand.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
-#include "internal/evp_int.h"
+#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/asn_moid.c b/crypto/asn1/asn_moid.c
index 251a7efcc6..90f8076048 100644
--- a/crypto/asn1/asn_moid.c
+++ b/crypto/asn1/asn_moid.c
@@ -8,13 +8,13 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
 #include <openssl/conf.h>
 #include <openssl/x509.h>
-#include "internal/asn1_int.h"
-#include "internal/objects.h"
+#include "crypto/asn1.h"
+#include "crypto/objects.h"
 
 /* Simple ASN1 OID module: add all objects in a given section */
 
diff --git a/crypto/asn1/d2i_param.c b/crypto/asn1/d2i_param.c
index e852470a66..c82b4a8fa8 100644
--- a/crypto/asn1/d2i_param.c
+++ b/crypto/asn1/d2i_param.c
@@ -11,8 +11,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/asn1.h>
-#include "internal/evp_int.h"
-#include "internal/asn1_int.h"
+#include "crypto/evp.h"
+#include "crypto/asn1.h"
 
 EVP_PKEY *d2i_KeyParams(int type, EVP_PKEY **a, const unsigned char **pp,
                         long length)
diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c
index c683f62c47..b24f99118e 100644
--- a/crypto/asn1/d2i_pr.c
+++ b/crypto/asn1/d2i_pr.c
@@ -15,8 +15,8 @@
 #include <openssl/engine.h>
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,
                          long length)
diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c
index 8876878fd0..4b26ec0400 100644
--- a/crypto/asn1/d2i_pu.c
+++ b/crypto/asn1/d2i_pu.c
@@ -17,7 +17,7 @@
 #include <openssl/dsa.h>
 #include <openssl/ec.h>
 
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
                         long length)
diff --git a/crypto/asn1/f_int.c b/crypto/asn1/f_int.c
index de7d983695..295ecb6fc5 100644
--- a/crypto/asn1/f_int.c
+++ b/crypto/asn1/f_int.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
diff --git a/crypto/asn1/f_string.c b/crypto/asn1/f_string.c
index dbca0c0613..0b930dfd0a 100644
--- a/crypto/asn1/f_string.c
+++ b/crypto/asn1/f_string.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/asn1.h>
diff --git a/crypto/asn1/i2d_param.c b/crypto/asn1/i2d_param.c
index 2e9000891a..1e1ebc95b2 100644
--- a/crypto/asn1/i2d_param.c
+++ b/crypto/asn1/i2d_param.c
@@ -12,8 +12,8 @@
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/asn1.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 int i2d_KeyParams(const EVP_PKEY *a, unsigned char **pp)
 {
diff --git a/crypto/asn1/i2d_pr.c b/crypto/asn1/i2d_pr.c
index 7133d3da9c..4decdb1dd7 100644
--- a/crypto/asn1/i2d_pr.c
+++ b/crypto/asn1/i2d_pr.c
@@ -11,8 +11,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/x509.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 int i2d_PrivateKey(const EVP_PKEY *a, unsigned char **pp)
 {
diff --git a/crypto/asn1/p8_pkey.c b/crypto/asn1/p8_pkey.c
index 94b32646cc..c55353ae11 100644
--- a/crypto/asn1/p8_pkey.c
+++ b/crypto/asn1/p8_pkey.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 /* Minor tweak to operation: zero private key data */
 static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c
index 483dd10921..03579c877c 100644
--- a/crypto/asn1/t_pkey.c
+++ b/crypto/asn1/t_pkey.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
-#include "internal/bn_int.h"
+#include "crypto/bn.h"
 
 /* Number of octets per line */
 #define ASN1_BUF_PRINT_WIDTH    15
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 <openssl/buffer.h>
 #include <openssl/err.h>
 #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 8ab9c370fd..a499665a2f 100644
--- a/crypto/asn1/tasn_enc.c
+++ b/crypto/asn1/tasn_enc.c
@@ -13,8 +13,8 @@
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
-#include "internal/asn1_int.h"
-#include "asn1_locl.h"
+#include "crypto/asn1.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 <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
-#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 <openssl/err.h>
 #include <openssl/asn1t.h>
 #include <string.h>
-#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 0f56fb092d..ff86400d66 100644
--- a/crypto/asn1/tasn_prn.c
+++ b/crypto/asn1/tasn_prn.c
@@ -15,8 +15,8 @@
 #include <openssl/buffer.h>
 #include <openssl/err.h>
 #include <openssl/x509v3.h>
-#include "internal/asn1_int.h"
-#include "asn1_locl.h"
+#include "crypto/asn1.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 <openssl/buffer.h>
 #include <openssl/err.h>
 #include <openssl/x509v3.h>
-#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 <openssl/asn1t.h>
 #include <openssl/objects.h>
 #include <openssl/err.h>
-#include "asn1_locl.h"
+#include "asn1_local.h"
 
 /* Utility functions for manipulating fields and offsets */
 
diff --git a/crypto/asn1/x_algor.c b/crypto/asn1/x_algor.c
index 77363fe75d..94c2aa3a2b 100644
--- a/crypto/asn1/x_algor.c
+++ b/crypto/asn1/x_algor.c
@@ -11,7 +11,7 @@
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 ASN1_SEQUENCE(X509_ALGOR) = {
         ASN1_SIMPLE(X509_ALGOR, algorithm, ASN1_OBJECT),
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 <openssl/asn1t.h>
 #include <openssl/bn.h>
-#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/asn1/x_sig.c b/crypto/asn1/x_sig.c
index f8ca810fbe..759a956653 100644
--- a/crypto/asn1/x_sig.c
+++ b/crypto/asn1/x_sig.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 ASN1_SEQUENCE(X509_SIG) = {
         ASN1_SIMPLE(X509_SIG, algor, X509_ALGOR),
diff --git a/crypto/asn1_dsa.c b/crypto/asn1_dsa.c
index 8423ff883f..972a9eb905 100644
--- a/crypto/asn1_dsa.c
+++ b/crypto/asn1_dsa.c
@@ -23,7 +23,7 @@
 
 #include <openssl/crypto.h>
 #include <openssl/bn.h>
-#include "internal/asn1_dsa.h"
+#include "crypto/asn1_dsa.h"
 #include "internal/packet.h"
 
 #define ID_SEQUENCE 0x30
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_posix.h b/crypto/async/arch/async_posix.h
index 528733e1aa..aba713e759 100644
--- a/crypto/async/arch/async_posix.h
+++ b/crypto/async/arch/async_posix.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H
-#define OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H
+#ifndef OSSL_CRYPTO_ASYNC_POSIX_H
+#define OSSL_CRYPTO_ASYNC_POSIX_H
 #include <openssl/e_os2.h>
 
 #if defined(OPENSSL_SYS_UNIX) \
@@ -55,4 +55,4 @@ void async_fibre_free(async_fibre *fibre);
 
 # endif
 #endif
-#endif /* OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H */
+#endif /* OSSL_CRYPTO_ASYNC_POSIX_H */
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 43b16a7b7c..4743bb702b 100644
--- a/crypto/async/async.c
+++ b/crypto/async/async.c
@@ -16,10 +16,10 @@
 #undef _FORTIFY_SOURCE
 
 /* This must be the first #include file */
-#include "async_locl.h"
+#include "async_local.h"
 
 #include <openssl/err.h>
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include <string.h>
 
 #define ASYNC_JOB_RUNNING   0
diff --git a/crypto/async/async_locl.h b/crypto/async/async_local.h
similarity index 98%
rename from crypto/async/async_locl.h
rename to crypto/async/async_local.h
index 85dfcfa632..549a27e611 100644
--- a/crypto/async/async_locl.h
+++ b/crypto/async/async_local.h
@@ -20,7 +20,7 @@
 # include <windows.h>
 #endif
 
-#include "internal/async.h"
+#include "crypto/async.h"
 #include <openssl/crypto.h>
 
 typedef struct async_ctx_st async_ctx;
diff --git a/crypto/async/async_wait.c b/crypto/async/async_wait.c
index 642b781f7e..87e480d949 100644
--- a/crypto/async/async_wait.c
+++ b/crypto/async/async_wait.c
@@ -8,7 +8,7 @@
  */
 
 /* This must be the first #include file */
-#include "async_locl.h"
+#include "async_local.h"
 
 #include <openssl/err.h>
 
diff --git a/crypto/bf/bf_cfb64.c b/crypto/bf/bf_cfb64.c
index ec1ec0d924..6f4fe33e5e 100644
--- a/crypto/bf/bf_cfb64.c
+++ b/crypto/bf/bf_cfb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/blowfish.h>
-#include "bf_locl.h"
+#include "bf_local.h"
 
 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/crypto/bf/bf_ecb.c b/crypto/bf/bf_ecb.c
index e07da3927f..512d717608 100644
--- a/crypto/bf/bf_ecb.c
+++ b/crypto/bf/bf_ecb.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/blowfish.h>
-#include "bf_locl.h"
+#include "bf_local.h"
 #include <openssl/opensslv.h>
 
 /*
diff --git a/crypto/bf/bf_enc.c b/crypto/bf/bf_enc.c
index 216163ad54..3f0c5b4e4d 100644
--- a/crypto/bf/bf_enc.c
+++ b/crypto/bf/bf_enc.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/blowfish.h>
-#include "bf_locl.h"
+#include "bf_local.h"
 
 /*
  * Blowfish as implemented from 'Blowfish: Springer-Verlag paper' (From
diff --git a/crypto/bf/bf_locl.h b/crypto/bf/bf_local.h
similarity index 98%
rename from crypto/bf/bf_locl.h
rename to crypto/bf/bf_local.h
index a59ceae8a9..080f37a5f9 100644
--- a/crypto/bf/bf_locl.h
+++ b/crypto/bf/bf_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BF_LOCL_H
-# define HEADER_BF_LOCL_H
+#ifndef OSSL_CRYPTO_BF_LOCAL_H
+# define OSSL_CRYPTO_BF_LOCAL_H
 # include <openssl/opensslconf.h>
 
 /* NOTE - c is not incremented as per n2l */
diff --git a/crypto/bf/bf_ofb64.c b/crypto/bf/bf_ofb64.c
index 7403833649..8df34aa186 100644
--- a/crypto/bf/bf_ofb64.c
+++ b/crypto/bf/bf_ofb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/blowfish.h>
-#include "bf_locl.h"
+#include "bf_local.h"
 
 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/crypto/bf/bf_skey.c b/crypto/bf/bf_skey.c
index 29d804439a..e358b1ded7 100644
--- a/crypto/bf/bf_skey.c
+++ b/crypto/bf/bf_skey.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <openssl/blowfish.h>
-#include "bf_locl.h"
+#include "bf_local.h"
 #include "bf_pi.h"
 
 void BF_set_key(BF_KEY *key, int len, const unsigned char *data)
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c
index ae82f098a9..40cf89da5b 100644
--- a/crypto/bio/b_addr.c
+++ b/crypto/bio/b_addr.c
@@ -10,7 +10,7 @@
 #include <assert.h>
 #include <string.h>
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include <openssl/crypto.h>
 
 #ifndef OPENSSL_NO_SOCK
@@ -22,7 +22,7 @@ CRYPTO_RWLOCK *bio_lookup_lock;
 static CRYPTO_ONCE bio_lookup_init = CRYPTO_ONCE_STATIC_INIT;
 
 /*
- * Throughout this file and bio_lcl.h, the existence of the macro
+ * Throughout this file and bio_local.h, the existence of the macro
  * AI_PASSIVE is used to detect the availability of struct addrinfo,
  * getnameinfo() and getaddrinfo().  If that macro doesn't exist,
  * we use our own implementation instead, using gethostbyname,
@@ -695,7 +695,7 @@ int BIO_lookup_ex(const char *host, const char *service, int lookup_type,
             hints.ai_flags |= AI_PASSIVE;
 
         /* Note that |res| SHOULD be a 'struct addrinfo **' thanks to
-         * macro magic in bio_lcl.h
+         * macro magic in bio_local.h
          */
       retry:
         switch ((gai_ret = getaddrinfo(host, service, &hints, res))) {
diff --git a/crypto/bio/b_dump.c b/crypto/bio/b_dump.c
index 018c4acb27..b99ebc0486 100644
--- a/crypto/bio/b_dump.c
+++ b/crypto/bio/b_dump.c
@@ -12,7 +12,7 @@
  */
 
 #include <stdio.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 
 #define DUMP_WIDTH      16
 #define DUMP_WIDTH_LESS_INDENT(i) (DUMP_WIDTH - ((i - (i > 6 ? 6 : i) + 3) / 4))
diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c
index 438cd0e636..0d6fafcc2d 100644
--- a/crypto/bio/b_print.c
+++ b/crypto/bio/b_print.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "internal/cryptlib.h"
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/numbers.h"
 #include <openssl/bio.h>
 
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index 1747cce658..8e40d8644c 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #ifndef OPENSSL_NO_SOCK
 # define SOCKET_PROTOCOL IPPROTO_TCP
 # ifdef SO_MAXCONN
diff --git a/crypto/bio/b_sock2.c b/crypto/bio/b_sock2.c
index abfd704772..942825a8e0 100644
--- a/crypto/bio/b_sock2.c
+++ b/crypto/bio/b_sock2.c
@@ -11,7 +11,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 
 #include <openssl/err.h>
 
diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c
index f39f6f0a50..80db0b57ab 100644
--- a/crypto/bio/bf_buff.c
+++ b/crypto/bio/bf_buff.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 
 static int buffer_write(BIO *h, const char *buf, int num);
diff --git a/crypto/bio/bf_lbuf.c b/crypto/bio/bf_lbuf.c
index edc727477c..6b5a241a0e 100644
--- a/crypto/bio/bf_lbuf.c
+++ b/crypto/bio/bf_lbuf.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
 
diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c
index cbf14cff55..6f6ccfb1a8 100644
--- a/crypto/bio/bf_nbio.c
+++ b/crypto/bio/bf_nbio.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 #include <openssl/rand.h>
 
diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c
index 8e1a803d88..e548bdc90d 100644
--- a/crypto/bio/bf_null.c
+++ b/crypto/bio/bf_null.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 
 /*
diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c
index 3ff6dfed91..154fb5c9f0 100644
--- a/crypto/bio/bio_cb.c
+++ b/crypto/bio/bio_cb.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 #include <openssl/err.h>
 
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index 9d63b491e2..b60568e066 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <openssl/crypto.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 
 
diff --git a/crypto/bio/bio_lcl.h b/crypto/bio/bio_local.h
similarity index 97%
rename from crypto/bio/bio_lcl.h
rename to crypto/bio/bio_local.h
index 95f3a937c5..30e56cba8d 100644
--- a/crypto/bio/bio_lcl.h
+++ b/crypto/bio/bio_local.h
@@ -27,11 +27,11 @@
  * For clarity, we check for internal/cryptlib.h since it's a common header
  * that also includes bio.h.
  */
-# ifdef HEADER_CRYPTLIB_H
-#  error internal/cryptlib.h included before bio_lcl.h
+# ifdef OSSL_INTERNAL_CRYPTLIB_H
+#  error internal/cryptlib.h included before bio_local.h
 # endif
-# ifdef HEADER_BIO_H
-#  error openssl/bio.h included before bio_lcl.h
+# ifdef OPENSSL_BIO_H
+#  error openssl/bio.h included before bio_local.h
 # endif
 
 /*
diff --git a/crypto/bio/bio_meth.c b/crypto/bio/bio_meth.c
index c1b30480a2..d32aeadf42 100644
--- a/crypto/bio/bio_meth.c
+++ b/crypto/bio/bio_meth.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/thread_once.h"
 
 CRYPTO_RWLOCK *bio_type_lock = NULL;
diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c
index 830c1b9679..3c2b279b3f 100644
--- a/crypto/bio/bss_acpt.c
+++ b/crypto/bio/bss_acpt.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 
 #ifndef OPENSSL_NO_SOCK
 
diff --git a/crypto/bio/bss_bio.c b/crypto/bio/bss_bio.c
index 8a9d8590fe..268f010fe8 100644
--- a/crypto/bio/bss_bio.c
+++ b/crypto/bio/bss_bio.c
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include <openssl/err.h>
 #include <openssl/crypto.h>
 
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c
index 56fb392c61..afcf436749 100644
--- a/crypto/bio/bss_conn.c
+++ b/crypto/bio/bss_conn.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 
 #ifndef OPENSSL_NO_SOCK
 
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index c52b0f047f..ff961450dd 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 #ifndef OPENSSL_NO_DGRAM
 
 # ifndef OPENSSL_NO_SCTP
diff --git a/crypto/bio/bss_fd.c b/crypto/bio/bss_fd.c
index c599dada93..9db3317e9a 100644
--- a/crypto/bio/bss_fd.c
+++ b/crypto/bio/bss_fd.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 
 #if defined(OPENSSL_NO_POSIX_IO)
 /*
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c
index c1acad9851..a57bd973f7 100644
--- a/crypto/bio/bss_file.c
+++ b/crypto/bio/bss_file.c
@@ -27,7 +27,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include <openssl/err.h>
 
 #if !defined(OPENSSL_NO_STDIO)
diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c
index 083f0041e2..274e52317d 100644
--- a/crypto/bio/bss_log.c
+++ b/crypto/bio/bss_log.c
@@ -19,7 +19,7 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 
 #if defined(OPENSSL_SYS_WINCE)
diff --git a/crypto/bio/bss_mem.c b/crypto/bio/bss_mem.c
index 19a3bd88ba..4043043626 100644
--- a/crypto/bio/bss_mem.c
+++ b/crypto/bio/bss_mem.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 
 static int mem_write(BIO *h, const char *buf, int num);
diff --git a/crypto/bio/bss_null.c b/crypto/bio/bss_null.c
index 091f82f958..f677bbbb15 100644
--- a/crypto/bio/bss_null.c
+++ b/crypto/bio/bss_null.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 
 static int null_write(BIO *h, const char *buf, int num);
diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c
index 0c9945939c..ed513495ff 100644
--- a/crypto/bio/bss_sock.c
+++ b/crypto/bio/bss_sock.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "bio_lcl.h"
+#include "bio_local.h"
 #include "internal/cryptlib.h"
 #include "internal/ktls.h"
 
diff --git a/crypto/blake2/m_blake2b.c b/crypto/blake2/m_blake2b.c
index b429d2d7f2..816dd06b6c 100644
--- a/crypto/blake2/m_blake2b.c
+++ b/crypto/blake2/m_blake2b.c
@@ -11,7 +11,7 @@
 
 # include <stddef.h>
 # include <openssl/obj_mac.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include "internal/blake2.h"
 
 static int init(EVP_MD_CTX *ctx)
diff --git a/crypto/blake2/m_blake2s.c b/crypto/blake2/m_blake2s.c
index dd4b68fa1c..caf8a6657a 100644
--- a/crypto/blake2/m_blake2s.c
+++ b/crypto/blake2/m_blake2s.c
@@ -11,7 +11,7 @@
 
 # include <stddef.h>
 # include <openssl/obj_mac.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include "internal/blake2.h"
 
 static int init(EVP_MD_CTX *ctx)
diff --git a/crypto/bn/README.pod b/crypto/bn/README.pod
index 237f2af3d6..1286fc0d41 100644
--- a/crypto/bn/README.pod
+++ b/crypto/bn/README.pod
@@ -188,7 +188,7 @@ B<a> and the 2*B<n> word arrays B<tmp> and B<r>.
 
 The implementations use the following macros which, depending on the
 architecture, may use "long long" C operations or inline assembler.
-They are defined in C<bn_lcl.h>.
+They are defined in C<bn_local.h>.
 
 mul(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<c> and places the
 low word of the result in B<r> and the high word in B<c>.
diff --git a/crypto/bn/asm/x86_64-gcc.c b/crypto/bn/asm/x86_64-gcc.c
index af32fcfc09..68453b3d52 100644
--- a/crypto/bn/asm/x86_64-gcc.c
+++ b/crypto/bn/asm/x86_64-gcc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "../bn_lcl.h"
+#include "../bn_local.h"
 #if !(defined(__GNUC__) && __GNUC__>=2)
 # include "../bn_asm.c"         /* kind of dirty hack for Sun Studio */
 #else
diff --git a/crypto/bn/bn_add.c b/crypto/bn/bn_add.c
index f35a1a419a..545e1038ba 100644
--- a/crypto/bn/bn_add.c
+++ b/crypto/bn/bn_add.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /* signed add of b to a. */
 int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b)
diff --git a/crypto/bn/bn_asm.c b/crypto/bn/bn_asm.c
index 41d448b52e..257701d9dc 100644
--- a/crypto/bn/bn_asm.c
+++ b/crypto/bn/bn_asm.c
@@ -10,7 +10,7 @@
 #include <assert.h>
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 #if defined(BN_LLONG) || defined(BN_UMULT_HIGH)
 
diff --git a/crypto/bn/bn_blind.c b/crypto/bn/bn_blind.c
index 826f3f06aa..c078d8dce7 100644
--- a/crypto/bn/bn_blind.c
+++ b/crypto/bn/bn_blind.c
@@ -9,7 +9,7 @@
 
 #include <openssl/opensslconf.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 #define BN_BLINDING_COUNTER     32
 
diff --git a/crypto/bn/bn_conv.c b/crypto/bn/bn_conv.c
index 9219fa4cb8..fd21464d74 100644
--- a/crypto/bn/bn_conv.c
+++ b/crypto/bn/bn_conv.c
@@ -8,8 +8,8 @@
  */
 
 #include <openssl/err.h>
-#include "internal/ctype.h"
-#include "bn_lcl.h"
+#include "crypto/ctype.h"
+#include "bn_local.h"
 
 static const char Hex[] = "0123456789ABCDEF";
 
diff --git a/crypto/bn/bn_ctx.c b/crypto/bn/bn_ctx.c
index a60c7442a4..ecc0034bbc 100644
--- a/crypto/bn/bn_ctx.c
+++ b/crypto/bn/bn_ctx.c
@@ -9,7 +9,7 @@
 
 #include <openssl/trace.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /*-
  * TODO list
diff --git a/crypto/bn/bn_depr.c b/crypto/bn/bn_depr.c
index 2ff0eedd22..18d02d894e 100644
--- a/crypto/bn/bn_depr.c
+++ b/crypto/bn/bn_depr.c
@@ -20,7 +20,7 @@ NON_EMPTY_TRANSLATION_UNIT
 # include <stdio.h>
 # include <time.h>
 # include "internal/cryptlib.h"
-# include "bn_lcl.h"
+# include "bn_local.h"
 
 BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
                           const BIGNUM *add, const BIGNUM *rem,
diff --git a/crypto/bn/bn_dh.c b/crypto/bn/bn_dh.c
index 668be57a18..390f904d51 100644
--- a/crypto/bn/bn_dh.c
+++ b/crypto/bn/bn_dh.c
@@ -7,12 +7,12 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "bn_lcl.h"
+#include "bn_local.h"
 #include "internal/nelem.h"
 
 #ifndef OPENSSL_NO_DH
 #include <openssl/dh.h>
-#include "internal/bn_dh.h"
+#include "crypto/bn_dh.h"
 /* DH parameters from RFC5114 */
 
 # if BN_BITS2 == 64
diff --git a/crypto/bn/bn_div.c b/crypto/bn/bn_div.c
index 88fcaf7f95..42459706a3 100644
--- a/crypto/bn/bn_div.c
+++ b/crypto/bn/bn_div.c
@@ -10,7 +10,7 @@
 #include <assert.h>
 #include <openssl/bn.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /* The old slow way */
 #if 0
diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c
index 9ea120be18..50190b058f 100644
--- a/crypto/bn/bn_exp.c
+++ b/crypto/bn/bn_exp.c
@@ -8,8 +8,8 @@
  */
 
 #include "internal/cryptlib.h"
-#include "internal/constant_time_locl.h"
-#include "bn_lcl.h"
+#include "internal/constant_time.h"
+#include "bn_local.h"
 
 #include <stdlib.h>
 #ifdef _WIN32
diff --git a/crypto/bn/bn_exp2.c b/crypto/bn/bn_exp2.c
index 4157a96230..99f843b98c 100644
--- a/crypto/bn/bn_exp2.c
+++ b/crypto/bn/bn_exp2.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 #define TABLE_SIZE      32
 
diff --git a/crypto/bn/bn_gcd.c b/crypto/bn/bn_gcd.c
index 9ee54407e5..87eb9da02c 100644
--- a/crypto/bn/bn_gcd.c
+++ b/crypto/bn/bn_gcd.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 static BIGNUM *euclid(BIGNUM *a, BIGNUM *b);
 
diff --git a/crypto/bn/bn_gf2m.c b/crypto/bn/bn_gf2m.c
index e025dae6c1..bfece40c59 100644
--- a/crypto/bn/bn_gf2m.c
+++ b/crypto/bn/bn_gf2m.c
@@ -12,7 +12,7 @@
 #include <limits.h>
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 #ifndef OPENSSL_NO_EC2M
 
diff --git a/crypto/bn/bn_intern.c b/crypto/bn/bn_intern.c
index f30e9b385c..d92403608b 100644
--- a/crypto/bn/bn_intern.c
+++ b/crypto/bn/bn_intern.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /*
  * Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'.
diff --git a/crypto/bn/bn_kron.c b/crypto/bn/bn_kron.c
index 2f8787babe..8258536dca 100644
--- a/crypto/bn/bn_kron.c
+++ b/crypto/bn/bn_kron.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /* least significant word */
 #define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index 01c9da116f..bdd4caa21d 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -10,9 +10,9 @@
 #include <assert.h>
 #include <limits.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 #include <openssl/opensslconf.h>
-#include "internal/constant_time_locl.h"
+#include "internal/constant_time.h"
 
 /* This stuff appears to be completely unused, so is deprecated */
 #if !OPENSSL_API_0_9_8
diff --git a/crypto/bn/bn_lcl.h b/crypto/bn/bn_local.h
similarity index 99%
rename from crypto/bn/bn_lcl.h
rename to crypto/bn/bn_local.h
index 38e66ab123..4c86986804 100644
--- a/crypto/bn/bn_lcl.h
+++ b/crypto/bn/bn_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BN_LCL_H
-# define HEADER_BN_LCL_H
+#ifndef OSSL_CRYPTO_BN_LOCAL_H
+# define OSSL_CRYPTO_BN_LOCAL_H
 
 /*
  * The EDK2 build doesn't use bn_conf.h; it sets THIRTY_TWO_BIT or
@@ -18,10 +18,10 @@
 # include <openssl/opensslconf.h>
 
 # if !defined(OPENSSL_SYS_UEFI)
-#  include "internal/bn_conf.h"
+#  include "crypto/bn_conf.h"
 # endif
 
-# include "internal/bn_int.h"
+# include "crypto/bn.h"
 
 /*
  * These preprocessor symbols control various aspects of the bignum headers
diff --git a/crypto/bn/bn_mod.c b/crypto/bn/bn_mod.c
index 20f643a13f..18933d0ebe 100644
--- a/crypto/bn/bn_mod.c
+++ b/crypto/bn/bn_mod.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
 {
diff --git a/crypto/bn/bn_mont.c b/crypto/bn/bn_mont.c
index cb71417ab3..6e6848c647 100644
--- a/crypto/bn/bn_mont.c
+++ b/crypto/bn/bn_mont.c
@@ -15,7 +15,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 #define MONT_WORD               /* use the faster word-based algorithm */
 
diff --git a/crypto/bn/bn_mpi.c b/crypto/bn/bn_mpi.c
index ff7eabf80a..504cddffec 100644
--- a/crypto/bn/bn_mpi.c
+++ b/crypto/bn/bn_mpi.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 int BN_bn2mpi(const BIGNUM *a, unsigned char *d)
 {
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c
index 4fc1e8ca0c..dc6b6f5a12 100644
--- a/crypto/bn/bn_mul.c
+++ b/crypto/bn/bn_mul.c
@@ -9,7 +9,7 @@
 
 #include <assert.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 #if defined(OPENSSL_NO_ASM) || !defined(OPENSSL_BN_ASM_PART_WORDS)
 /*
diff --git a/crypto/bn/bn_nist.c b/crypto/bn/bn_nist.c
index 187070881f..17881233a4 100644
--- a/crypto/bn/bn_nist.c
+++ b/crypto/bn/bn_nist.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "bn_lcl.h"
+#include "bn_local.h"
 #include "internal/cryptlib.h"
 
 #define BN_NIST_192_TOP (192+BN_BITS2-1)/BN_BITS2
diff --git a/crypto/bn/bn_prime.c b/crypto/bn/bn_prime.c
index 9e735b7233..99b3199bac 100644
--- a/crypto/bn/bn_prime.c
+++ b/crypto/bn/bn_prime.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <time.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /*
  * The quick sieve algorithm approach to weeding out primes is Philip
diff --git a/crypto/bn/bn_print.c b/crypto/bn/bn_print.c
index 2274b85c88..ccc954c5b1 100644
--- a/crypto/bn/bn_print.c
+++ b/crypto/bn/bn_print.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <openssl/bio.h>
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 static const char Hex[] = "0123456789ABCDEF";
 
diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c
index 2b3e6f2076..d61b08dba2 100644
--- a/crypto/bn/bn_rand.c
+++ b/crypto/bn/bn_rand.c
@@ -10,8 +10,8 @@
 #include <stdio.h>
 #include <time.h>
 #include "internal/cryptlib.h"
-#include "internal/rand_int.h"
-#include "bn_lcl.h"
+#include "crypto/rand.h"
+#include "bn_local.h"
 #include <openssl/rand.h>
 #include <openssl/sha.h>
 #include <openssl/evp.h>
diff --git a/crypto/bn/bn_recp.c b/crypto/bn/bn_recp.c
index 7eda16de1d..2cfe3156b9 100644
--- a/crypto/bn/bn_recp.c
+++ b/crypto/bn/bn_recp.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 void BN_RECP_CTX_init(BN_RECP_CTX *recp)
 {
diff --git a/crypto/bn/bn_rsa_fips186_4.c b/crypto/bn/bn_rsa_fips186_4.c
index 9a3041e2e1..e5e4eccb22 100644
--- a/crypto/bn/bn_rsa_fips186_4.c
+++ b/crypto/bn/bn_rsa_fips186_4.c
@@ -29,8 +29,8 @@
  */
 #include <stdio.h>
 #include <openssl/bn.h>
-#include "bn_lcl.h"
-#include "internal/bn_int.h"
+#include "bn_local.h"
+#include "crypto/bn.h"
 
 /*
  * FIPS 186-4 Table B.1. "Min length of auxiliary primes p1, p2, q1, q2".
diff --git a/crypto/bn/bn_shift.c b/crypto/bn/bn_shift.c
index 13a4337ff3..b1f8dbd2d3 100644
--- a/crypto/bn/bn_shift.c
+++ b/crypto/bn/bn_shift.c
@@ -9,7 +9,7 @@
 
 #include <assert.h>
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 int BN_lshift1(BIGNUM *r, const BIGNUM *a)
 {
diff --git a/crypto/bn/bn_sqr.c b/crypto/bn/bn_sqr.c
index 6e1aa99d43..990bed90b5 100644
--- a/crypto/bn/bn_sqr.c
+++ b/crypto/bn/bn_sqr.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /* r must not be a */
 /*
diff --git a/crypto/bn/bn_sqrt.c b/crypto/bn/bn_sqrt.c
index 2107487b72..d39f65f53b 100644
--- a/crypto/bn/bn_sqrt.c
+++ b/crypto/bn/bn_sqrt.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 /*
diff --git a/crypto/bn/bn_srp.c b/crypto/bn/bn_srp.c
index d722f59eb7..34e11ce774 100644
--- a/crypto/bn/bn_srp.c
+++ b/crypto/bn/bn_srp.c
@@ -7,13 +7,13 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "bn_lcl.h"
+#include "bn_local.h"
 #include "internal/nelem.h"
 
 #ifndef OPENSSL_NO_SRP
 
 #include <openssl/srp.h>
-#include "internal/bn_srp.h"
+#include "crypto/bn_srp.h"
 
 # if (BN_BYTES == 8)
 #  if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)
diff --git a/crypto/bn/bn_word.c b/crypto/bn/bn_word.c
index 1fb41e8961..93c014793e 100644
--- a/crypto/bn/bn_word.c
+++ b/crypto/bn/bn_word.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w)
 {
diff --git a/crypto/bn/bn_x931p.c b/crypto/bn/bn_x931p.c
index c79e427854..211886f5ee 100644
--- a/crypto/bn/bn_x931p.c
+++ b/crypto/bn/bn_x931p.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <openssl/bn.h>
-#include "bn_lcl.h"
+#include "bn_local.h"
 
 /* X9.31 routines for prime derivation */
 
diff --git a/crypto/bn/rsaz_exp.h b/crypto/bn/rsaz_exp.h
index c92af6ff13..c05a5d937e 100644
--- a/crypto/bn/rsaz_exp.h
+++ b/crypto/bn/rsaz_exp.h
@@ -12,8 +12,8 @@
  * (2) University of Haifa, Israel
  */
 
-#ifndef RSAZ_EXP_H
-# define RSAZ_EXP_H
+#ifndef OSSL_CRYPTO_BN_RSAZ_EXP_H
+# define OSSL_CRYPTO_BN_RSAZ_EXP_H
 
 # undef RSAZ_ENABLED
 # if defined(OPENSSL_BN_ASM_MONT) && \
diff --git a/crypto/camellia/camellia.c b/crypto/camellia/camellia.c
index 75080a11a2..cb285d05ed 100644
--- a/crypto/camellia/camellia.c
+++ b/crypto/camellia/camellia.c
@@ -40,7 +40,7 @@
  */
 
 #include <openssl/camellia.h>
-#include "cmll_locl.h"
+#include "cmll_local.h"
 #include <string.h>
 #include <stdlib.h>
 
diff --git a/crypto/camellia/cmll_ecb.c b/crypto/camellia/cmll_ecb.c
index 1385b2f5db..6a2c77750b 100644
--- a/crypto/camellia/cmll_ecb.c
+++ b/crypto/camellia/cmll_ecb.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/camellia.h>
-#include "cmll_locl.h"
+#include "cmll_local.h"
 
 void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
                           const CAMELLIA_KEY *key, const int enc)
diff --git a/crypto/camellia/cmll_locl.h b/crypto/camellia/cmll_local.h
similarity index 91%
rename from crypto/camellia/cmll_locl.h
rename to crypto/camellia/cmll_local.h
index cf3d38db45..c1d940d3d8 100644
--- a/crypto/camellia/cmll_locl.h
+++ b/crypto/camellia/cmll_local.h
@@ -22,8 +22,8 @@
  * to the OpenSSL project.
  */
 
-#ifndef HEADER_CAMELLIA_LOCL_H
-# define HEADER_CAMELLIA_LOCL_H
+#ifndef OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H
+# define OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H
 
 typedef unsigned int u32;
 typedef unsigned char u8;
@@ -40,4 +40,4 @@ void Camellia_EncryptBlock(int keyBitLength, const u8 plaintext[],
                            const KEY_TABLE_TYPE keyTable, u8 ciphertext[]);
 void Camellia_DecryptBlock(int keyBitLength, const u8 ciphertext[],
                            const KEY_TABLE_TYPE keyTable, u8 plaintext[]);
-#endif                          /* #ifndef HEADER_CAMELLIA_LOCL_H */
+#endif                          /* #ifndef OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H */
diff --git a/crypto/camellia/cmll_misc.c b/crypto/camellia/cmll_misc.c
index 987bdb921d..b38fcc0491 100644
--- a/crypto/camellia/cmll_misc.c
+++ b/crypto/camellia/cmll_misc.c
@@ -9,7 +9,7 @@
 
 #include <openssl/opensslv.h>
 #include <openssl/camellia.h>
-#include "cmll_locl.h"
+#include "cmll_local.h"
 
 int Camellia_set_key(const unsigned char *userKey, const int bits,
                      CAMELLIA_KEY *key)
diff --git a/crypto/cast/c_cfb64.c b/crypto/cast/c_cfb64.c
index 7bac5c72df..1ae13bc3d8 100644
--- a/crypto/cast/c_cfb64.c
+++ b/crypto/cast/c_cfb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/cast.h>
-#include "cast_lcl.h"
+#include "cast_local.h"
 
 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/crypto/cast/c_ecb.c b/crypto/cast/c_ecb.c
index 50b225e32b..2b841ac919 100644
--- a/crypto/cast/c_ecb.c
+++ b/crypto/cast/c_ecb.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/cast.h>
-#include "cast_lcl.h"
+#include "cast_local.h"
 #include <openssl/opensslv.h>
 
 void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
diff --git a/crypto/cast/c_enc.c b/crypto/cast/c_enc.c
index ad8a02a4cf..7e2461dfca 100644
--- a/crypto/cast/c_enc.c
+++ b/crypto/cast/c_enc.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/cast.h>
-#include "cast_lcl.h"
+#include "cast_local.h"
 
 void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key)
 {
diff --git a/crypto/cast/c_ofb64.c b/crypto/cast/c_ofb64.c
index 797917cf8a..bc598d4d1b 100644
--- a/crypto/cast/c_ofb64.c
+++ b/crypto/cast/c_ofb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/cast.h>
-#include "cast_lcl.h"
+#include "cast_local.h"
 
 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/crypto/cast/c_skey.c b/crypto/cast/c_skey.c
index 1f353a7942..c21ecdf89c 100644
--- a/crypto/cast/c_skey.c
+++ b/crypto/cast/c_skey.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/cast.h>
-#include "cast_lcl.h"
+#include "cast_local.h"
 #include "cast_s.h"
 
 #define CAST_exp(l,A,a,n) \
diff --git a/crypto/cast/cast_lcl.h b/crypto/cast/cast_local.h
similarity index 100%
rename from crypto/cast/cast_lcl.h
rename to crypto/cast/cast_local.h
diff --git a/crypto/chacha/chacha_enc.c b/crypto/chacha/chacha_enc.c
index e350c9b0f1..05a716b5d4 100644
--- a/crypto/chacha/chacha_enc.c
+++ b/crypto/chacha/chacha_enc.c
@@ -11,7 +11,7 @@
 
 #include <string.h>
 
-#include "internal/chacha.h"
+#include "crypto/chacha.h"
 
 typedef unsigned int u32;
 typedef unsigned char u8;
diff --git a/crypto/cmac/cm_ameth.c b/crypto/cmac/cm_ameth.c
index b1ee0d3d2f..9db2562157 100644
--- a/crypto/cmac/cm_ameth.c
+++ b/crypto/cmac/cm_ameth.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 
 /*
  * CMAC "ASN1" method. This is just here to indicate the maximum CMAC output
diff --git a/crypto/cmp/cmp_asn.c b/crypto/cmp/cmp_asn.c
index e764e532d5..fa7c26d78e 100644
--- a/crypto/cmp/cmp_asn.c
+++ b/crypto/cmp/cmp_asn.c
@@ -11,7 +11,7 @@
 
 #include <openssl/asn1t.h>
 
-#include "cmp_int.h"
+#include "cmp_local.h"
 
 /* explicit #includes not strictly needed since implied by the above: */
 #include <openssl/cmp.h>
diff --git a/crypto/cmp/cmp_ctx.c b/crypto/cmp/cmp_ctx.c
index 4bec73c3b7..6ec23ad877 100644
--- a/crypto/cmp/cmp_ctx.c
+++ b/crypto/cmp/cmp_ctx.c
@@ -13,7 +13,7 @@
 #include <openssl/bio.h>
 #include <openssl/ocsp.h> /* for OCSP_REVOKED_STATUS_* */
 
-#include "cmp_int.h"
+#include "cmp_local.h"
 
 /* explicit #includes not strictly needed since implied by the above: */
 #include <openssl/cmp.h>
diff --git a/crypto/cmp/cmp_int.h b/crypto/cmp/cmp_local.h
similarity index 99%
rename from crypto/cmp/cmp_int.h
rename to crypto/cmp/cmp_local.h
index 1f47dca0d0..1a7dcca3bd 100644
--- a/crypto/cmp/cmp_int.h
+++ b/crypto/cmp/cmp_local.h
@@ -9,8 +9,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_HEADER_CMP_INT_H
-# define OSSL_HEADER_CMP_INT_H
+#ifndef OSSL_CRYPTO_CMP_LOCAL_H
+# define OSSL_CRYPTO_CMP_LOCAL_H
 
 # include "internal/cryptlib.h"
 
@@ -19,7 +19,7 @@
 
 /* explicit #includes not strictly needed since implied by the above: */
 # include <openssl/crmf.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/safestack.h>
 # include <openssl/x509.h>
 # include <openssl/x509v3.h>
@@ -722,4 +722,4 @@ int ossl_cmp_ctx_set1_recipNonce(OSSL_CMP_CTX *ctx,
 
 #  define OSSL_CMP_TRANSACTIONID_LENGTH 16
 
-#endif /* !defined OSSL_HEADER_CMP_INT_H */
+#endif /* !defined OSSL_CRYPTO_CMP_LOCAL_H */
diff --git a/crypto/cmp/cmp_util.c b/crypto/cmp/cmp_util.c
index 1ca981bf7b..9490496cbe 100644
--- a/crypto/cmp/cmp_util.c
+++ b/crypto/cmp/cmp_util.c
@@ -11,7 +11,7 @@
 
 #include <string.h>
 #include <openssl/cmp_util.h>
-#include "cmp_int.h" /* just for decls of internal functions defined here */
+#include "cmp_local.h" /* just for decls of internal functions defined here */
 #include <openssl/cmperr.h>
 #include <openssl/err.h> /* should be implied by cmperr.h */
 #include <openssl/x509v3.h>
diff --git a/crypto/cms/cms_asn1.c b/crypto/cms/cms_asn1.c
index 64d5d3b119..082885dca8 100644
--- a/crypto/cms/cms_asn1.c
+++ b/crypto/cms/cms_asn1.c
@@ -11,7 +11,7 @@
 #include <openssl/pem.h>
 #include <openssl/x509v3.h>
 #include <openssl/cms.h>
-#include "cms_lcl.h"
+#include "cms_local.h"
 
 
 ASN1_SEQUENCE(CMS_IssuerAndSerialNumber) = {
diff --git a/crypto/cms/cms_att.c b/crypto/cms/cms_att.c
index e54818053b..2c8138f13e 100644
--- a/crypto/cms/cms_att.c
+++ b/crypto/cms/cms_att.c
@@ -12,7 +12,7 @@
 #include <openssl/x509v3.h>
 #include <openssl/err.h>
 #include <openssl/cms.h>
-#include "cms_lcl.h"
+#include "cms_local.h"
 #include "internal/nelem.h"
 
 /*-
diff --git a/crypto/cms/cms_cd.c b/crypto/cms/cms_cd.c
index 5a11928e30..ac40275b63 100644
--- a/crypto/cms/cms_cd.c
+++ b/crypto/cms/cms_cd.c
@@ -15,7 +15,7 @@
 #include <openssl/cms.h>
 #include <openssl/bio.h>
 #include <openssl/comp.h>
-#include "cms_lcl.h"
+#include "cms_local.h"
 
 #ifdef ZLIB
 
diff --git a/crypto/cms/cms_dd.c b/crypto/cms/cms_dd.c
index 8bdbdfde21..9da26476e0 100644
--- a/crypto/cms/cms_dd.c
+++ b/crypto/cms/cms_dd.c
@@ -13,7 +13,7 @@
 #include <openssl/x509v3.h>
 #include <openssl/err.h>
 #include <openssl/cms.h>
-#include "cms_lcl.h"
+#include "cms_local.h"
 
 /* CMS DigestedData Utilities */
 
diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c
index d3a087b3ca..3a17a2798b 100644
--- a/crypto/cms/cms_enc.c
+++ b/crypto/cms/cms_enc.c
@@ -14,7 +14,7 @@
 #include <openssl/err.h>
 #include <openssl/cms.h>
 #include <openssl/rand.h>
-#include "cms_lcl.h"
+#include "cms_local.h"
 
 /* CMS EncryptedData Utilities */
 
diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c
index 27e98ce0a7..bcb6162b18 100644
--- a/crypto/cms/cms_env.c
+++ b/crypto/cms/cms_env.c
@@ -14,9 +14,9 @@
 #include <openssl/err.h>
 #include <openssl/cms.h>
 #include <openssl/aes.h>
-#include "cms_lcl.h"
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "cms_local.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 /* CMS EnvelopedData Utilities */
 
diff --git a/crypto/cms/cms_ess.c b/crypto/cms/cms_ess.c
index 8f80f6ba5d..1a6c05f1af 100644
--- a/crypto/cms/cms_ess.c
+++ b/crypto/cms/cms_ess.c
@@ -15,9 +15,9 @@
 #include <openssl/err.h>
 #include <openssl/cms.h>
 #include <openssl/ess.h>
-#include "cms_lcl.h"
-#include "internal/ess_int.h"
-#include "internal/cms_int.h"
+#include "cms_local.h"
+#include "crypto/ess.h"
+#include "crypto/cms.h"
 
 IMPLEMENT_ASN1_FUNCTIONS(CMS_ReceiptRequest)
 
diff --git a/crypto/cms/cms_io.c b/crypto/cms/cms_io.c
index f3b58740be..06c5a1bb27 100644
--- a/crypto/cms/cms_io.c
+++ b/crypto/cms/cms_io.c
@@ -12,7 +12,7 @@
 #include <openssl/err.h>
 #include <openssl/pem.h>
 #include <openssl/cms.h>
-#include "cms_lcl.h"
+#include "cms_local.h"
 
 /* unfortunately cannot constify BIO_new_NDEF() due to this and PKCS7_stream() */
 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms)
diff --git a/crypto/cms/cms_kari.c b/crypto/cms/cms_kari.c
index 866749a171..bffa9351ae 100644
--- a/crypto/cms/cms_kari.c
+++ b/crypto/cms/cms_kari.c
@@ -14,8 +14,8 @@
 #include <openssl/err.h>
 #include <openssl/cms.h>
 #include <openssl/aes.h>
-#include "cms_lcl.h"
-#include "internal/asn1_int.h"
+#include "cms_local.h"
+#include "crypto/asn1.h"
 
 /* Key Agreement Recipient Info (KARI) routines */
 
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c
index 29eacce2ea..5de5e9dc6d 100644
--- a/crypto/cms/cms_lib.c
+++ b/crypto/cms/cms_lib.c
@@ -14,7 +14,7 @@
 #include <openssl/bio.h>
 #include <openssl/asn1.h>
 #include <openssl/cms.h>
-#include "cms_lcl.h"
+#include "cms_local.h"
 
 IMPLEMENT_ASN1_FUNCTIONS(CMS_ContentInfo)
 IMPLEMENT_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
diff --git a/crypto/cms/cms_lcl.h b/crypto/cms/cms_local.h
similarity index 99%
rename from crypto/cms/cms_lcl.h
rename to crypto/cms/cms_local.h
index 40d9c4bb7d..6cb31955eb 100644
--- a/crypto/cms/cms_lcl.h
+++ b/crypto/cms/cms_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CMS_LCL_H
-# define HEADER_CMS_LCL_H
+#ifndef OSSL_CRYPTO_CMS_LOCAL_H
+# define OSSL_CRYPTO_CMS_LOCAL_H
 
 # include <openssl/x509.h>
 
diff --git a/crypto/cms/cms_pwri.c b/crypto/cms/cms_pwri.c
index f0502a4510..740c7e6946 100644
--- a/crypto/cms/cms_pwri.c
+++ b/crypto/cms/cms_pwri.c
@@ -15,8 +15,8 @@
 #include <openssl/cms.h>
 #include <openssl/rand.h>
 #include <openssl/aes.h>
-#include "cms_lcl.h"
-#include "internal/asn1_int.h"
+#include "cms_local.h"
+#include "crypto/asn1.h"
 
 int CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,
                                     unsigned char *pass, ossl_ssize_t passlen)
diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c
index 6715e84d2f..b207ebe280 100644
--- a/crypto/cms/cms_sd.c
+++ b/crypto/cms/cms_sd.c
@@ -15,11 +15,11 @@
 #include <openssl/err.h>
 #include <openssl/cms.h>
 #include <openssl/ess.h>
-#include "cms_lcl.h"
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
-#include "internal/cms_int.h"
-#include "internal/ess_int.h"
+#include "cms_local.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
+#include "crypto/cms.h"
+#include "crypto/ess.h"
 
 /* CMS SignedData Utilities */
 
diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c
index ae95ff2dd2..171eeb31b8 100644
--- a/crypto/cms/cms_smime.c
+++ b/crypto/cms/cms_smime.c
@@ -13,8 +13,8 @@
 #include <openssl/x509v3.h>
 #include <openssl/err.h>
 #include <openssl/cms.h>
-#include "cms_lcl.h"
-#include "internal/asn1_int.h"
+#include "cms_local.h"
+#include "crypto/asn1.h"
 
 static BIO *cms_get_text_bio(BIO *out, unsigned int flags)
 {
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
index 1dd7d67998..0d84a52726 100644
--- a/crypto/comp/c_zlib.c
+++ b/crypto/comp/c_zlib.c
@@ -13,9 +13,9 @@
 #include <openssl/objects.h>
 #include "internal/comp.h"
 #include <openssl/err.h>
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include "internal/bio.h"
-#include "comp_lcl.h"
+#include "comp_local.h"
 
 COMP_METHOD *COMP_zlib(void);
 
diff --git a/crypto/comp/comp_lib.c b/crypto/comp/comp_lib.c
index 44f0478ee0..49195de3d2 100644
--- a/crypto/comp/comp_lib.c
+++ b/crypto/comp/comp_lib.c
@@ -13,7 +13,7 @@
 #include <openssl/objects.h>
 #include <openssl/comp.h>
 #include <openssl/err.h>
-#include "comp_lcl.h"
+#include "comp_local.h"
 
 COMP_CTX *COMP_CTX_new(COMP_METHOD *meth)
 {
diff --git a/crypto/comp/comp_lcl.h b/crypto/comp/comp_local.h
similarity index 100%
rename from crypto/comp/comp_lcl.h
rename to crypto/comp/comp_local.h
diff --git a/crypto/conf/conf_lib.c b/crypto/conf/conf_lib.c
index 13d061b298..833b7a6551 100644
--- a/crypto/conf/conf_lib.c
+++ b/crypto/conf/conf_lib.c
@@ -11,7 +11,7 @@
 #include <stdio.h>
 #include <string.h>
 #include "internal/conf.h"
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <openssl/crypto.h>
 #include <openssl/err.h>
 #include <openssl/conf.h>
diff --git a/crypto/conf/conf_lcl.h b/crypto/conf/conf_local.h
similarity index 100%
rename from crypto/conf/conf_lcl.h
rename to crypto/conf/conf_local.h
diff --git a/crypto/conf/conf_mall.c b/crypto/conf/conf_mall.c
index 28003a8fae..033c1ada18 100644
--- a/crypto/conf/conf_mall.c
+++ b/crypto/conf/conf_mall.c
@@ -15,7 +15,7 @@
 #include <openssl/asn1.h>
 #include <openssl/engine.h>
 #include "internal/provider.h"
-#include "conf_lcl.h"
+#include "conf_local.h"
 
 /* Load all OpenSSL builtin modules */
 
diff --git a/crypto/conf/conf_ssl.c b/crypto/conf/conf_ssl.c
index d703f73630..5855c50c7b 100644
--- a/crypto/conf/conf_ssl.c
+++ b/crypto/conf/conf_ssl.c
@@ -12,7 +12,7 @@
 #include <openssl/conf.h>
 #include <openssl/err.h>
 #include "internal/sslconf.h"
-#include "conf_lcl.h"
+#include "conf_local.h"
 
 /*
  * SSL library configuration module placeholder. We load it here but defer
diff --git a/crypto/context.c b/crypto/context.c
index a2e19bac54..02fecf9f35 100644
--- a/crypto/context.c
+++ b/crypto/context.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include "internal/thread_once.h"
 #include "internal/property.h"
 
diff --git a/crypto/core_namemap.c b/crypto/core_namemap.c
index cf5f1e54c3..cb26b429b7 100644
--- a/crypto/core_namemap.c
+++ b/crypto/core_namemap.c
@@ -10,7 +10,7 @@
 #include "e_os.h"                /* strcasecmp */
 #include "internal/namemap.h"
 #include <openssl/lhash.h>
-#include "internal/lhash.h"      /* openssl_lh_strcasehash */
+#include "crypto/lhash.h"      /* openssl_lh_strcasehash */
 
 /*-
  * The namenum entry
diff --git a/crypto/crmf/crmf_asn.c b/crypto/crmf/crmf_asn.c
index 05442c2c12..4380156795 100644
--- a/crypto/crmf/crmf_asn.c
+++ b/crypto/crmf/crmf_asn.c
@@ -13,7 +13,7 @@
 
 #include <openssl/asn1t.h>
 
-#include "crmf_int.h"
+#include "crmf_local.h"
 
 /* explicit #includes not strictly needed since implied by the above: */
 #include <openssl/crmf.h>
diff --git a/crypto/crmf/crmf_lib.c b/crypto/crmf/crmf_lib.c
index 85444017ff..6ba3f7ab3f 100644
--- a/crypto/crmf/crmf_lib.c
+++ b/crypto/crmf/crmf_lib.c
@@ -28,8 +28,8 @@
 
 #include <openssl/asn1t.h>
 
-#include "crmf_int.h"
-#include "internal/constant_time_locl.h"
+#include "crmf_local.h"
+#include "internal/constant_time.h"
 
 /* explicit #includes not strictly needed since implied by the above: */
 #include <openssl/crmf.h>
diff --git a/crypto/crmf/crmf_int.h b/crypto/crmf/crmf_local.h
similarity index 99%
rename from crypto/crmf/crmf_int.h
rename to crypto/crmf/crmf_local.h
index 54f9a4a225..577187f55b 100644
--- a/crypto/crmf/crmf_int.h
+++ b/crypto/crmf/crmf_local.h
@@ -11,14 +11,14 @@
  * CRMF implementation by Martin Peylo, Miikka Viljanen, and David von Oheimb.
  */
 
-#ifndef OSSL_HEADER_CRMF_INT_H
-# define OSSL_HEADER_CRMF_INT_H
+#ifndef OSSL_CRYPTO_CRMF_LOCAL_H
+# define OSSL_CRYPTO_CRMF_LOCAL_H
 
 # include <openssl/crmf.h>
 # include <openssl/err.h>
 
 /* explicit #includes not strictly needed since implied by the above: */
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/safestack.h>
 # include <openssl/x509.h>
 # include <openssl/x509v3.h>
diff --git a/crypto/crmf/crmf_pbm.c b/crypto/crmf/crmf_pbm.c
index 47dc86a550..c5e08c47de 100644
--- a/crypto/crmf/crmf_pbm.c
+++ b/crypto/crmf/crmf_pbm.c
@@ -17,7 +17,7 @@
 #include <openssl/rand.h>
 #include <openssl/evp.h>
 
-#include "crmf_int.h"
+#include "crmf_local.h"
 
 /* explicit #includes not strictly needed since implied by the above: */
 #include <openssl/asn1t.h>
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c
index 7e89bbd6b5..bc29a3b583 100644
--- a/crypto/cryptlib.c
+++ b/crypto/cryptlib.c
@@ -9,7 +9,7 @@
  */
 
 #include "e_os.h"
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include <openssl/safestack.h>
 
 #if     defined(__i386)   || defined(__i386__)   || defined(_M_IX86) || \
@@ -49,7 +49,7 @@ typedef char variant_char;
 #   define ossl_getenv getenv
 #  endif
 
-#  include "internal/ctype.h"
+#  include "crypto/ctype.h"
 
 static int todigit(variant_char c)
 {
diff --git a/crypto/ct/ct_b64.c b/crypto/ct/ct_b64.c
index cacec2fd8a..f080088289 100644
--- a/crypto/ct/ct_b64.c
+++ b/crypto/ct/ct_b64.c
@@ -14,7 +14,7 @@
 #include <openssl/err.h>
 #include <openssl/evp.h>
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 /*
  * Decodes the base64 string |in| into |out|.
diff --git a/crypto/ct/ct_locl.h b/crypto/ct/ct_local.h
similarity index 100%
rename from crypto/ct/ct_locl.h
rename to crypto/ct/ct_local.h
diff --git a/crypto/ct/ct_oct.c b/crypto/ct/ct_oct.c
index 76fc222273..cdab02fdf8 100644
--- a/crypto/ct/ct_oct.c
+++ b/crypto/ct/ct_oct.c
@@ -19,7 +19,7 @@
 #include <openssl/ct.h>
 #include <openssl/err.h>
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len)
 {
diff --git a/crypto/ct/ct_policy.c b/crypto/ct/ct_policy.c
index 93311475c2..0305970a94 100644
--- a/crypto/ct/ct_policy.c
+++ b/crypto/ct/ct_policy.c
@@ -15,7 +15,7 @@
 #include <openssl/err.h>
 #include <time.h>
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 /*
  * Number of seconds in the future that an SCT timestamp can be, by default,
diff --git a/crypto/ct/ct_prn.c b/crypto/ct/ct_prn.c
index 62d01238cd..4c5760d694 100644
--- a/crypto/ct/ct_prn.c
+++ b/crypto/ct/ct_prn.c
@@ -14,7 +14,7 @@
 #include <openssl/asn1.h>
 #include <openssl/bio.h>
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 static void SCT_signature_algorithms_print(const SCT *sct, BIO *out)
 {
diff --git a/crypto/ct/ct_sct.c b/crypto/ct/ct_sct.c
index ce2f814532..bd510d9edb 100644
--- a/crypto/ct/ct_sct.c
+++ b/crypto/ct/ct_sct.c
@@ -17,7 +17,7 @@
 #include <openssl/tls1.h>
 #include <openssl/x509.h>
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 SCT *SCT_new(void)
 {
diff --git a/crypto/ct/ct_sct_ctx.c b/crypto/ct/ct_sct_ctx.c
index 64d97b61f9..aa9d2d75ef 100644
--- a/crypto/ct/ct_sct_ctx.c
+++ b/crypto/ct/ct_sct_ctx.c
@@ -18,7 +18,7 @@
 #include <openssl/obj_mac.h>
 #include <openssl/x509.h>
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 SCT_CTX *SCT_CTX_new(void)
 {
diff --git a/crypto/ct/ct_vfy.c b/crypto/ct/ct_vfy.c
index c686de6fa7..f206edd061 100644
--- a/crypto/ct/ct_vfy.c
+++ b/crypto/ct/ct_vfy.c
@@ -14,7 +14,7 @@
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 typedef enum sct_signature_type_t {
     SIGNATURE_TYPE_NOT_SET = -1,
diff --git a/crypto/ct/ct_x509v3.c b/crypto/ct/ct_x509v3.c
index 92d088a75a..1665b985eb 100644
--- a/crypto/ct/ct_x509v3.c
+++ b/crypto/ct/ct_x509v3.c
@@ -11,7 +11,7 @@
 # error "CT is disabled"
 #endif
 
-#include "ct_locl.h"
+#include "ct_local.h"
 
 static char *i2s_poison(const X509V3_EXT_METHOD *method, void *val)
 {
diff --git a/crypto/ctype.c b/crypto/ctype.c
index e7bc25b976..dbd7891399 100644
--- a/crypto/ctype.c
+++ b/crypto/ctype.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "openssl/ebcdic.h"
 
 /*
diff --git a/crypto/des/cbc_cksm.c b/crypto/des/cbc_cksm.c
index 707841ba1b..1fb76b5562 100644
--- a/crypto/des/cbc_cksm.c
+++ b/crypto/des/cbc_cksm.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 DES_LONG DES_cbc_cksum(const unsigned char *in, DES_cblock *output,
                        long length, DES_key_schedule *schedule,
diff --git a/crypto/des/cfb64ede.c b/crypto/des/cfb64ede.c
index 82e9a37837..cb5dad2ca6 100644
--- a/crypto/des/cfb64ede.c
+++ b/crypto/des/cfb64ede.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/crypto/des/cfb64enc.c b/crypto/des/cfb64enc.c
index 8a75626db6..7c44f2ac3f 100644
--- a/crypto/des/cfb64enc.c
+++ b/crypto/des/cfb64enc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/crypto/des/cfb_enc.c b/crypto/des/cfb_enc.c
index 6d3155ed74..8630cc4293 100644
--- a/crypto/des/cfb_enc.c
+++ b/crypto/des/cfb_enc.c
@@ -8,7 +8,7 @@
  */
 
 #include "e_os.h"
-#include "des_locl.h"
+#include "des_local.h"
 #include <assert.h>
 
 /*
diff --git a/crypto/des/des_enc.c b/crypto/des/des_enc.c
index bb740f720a..5666c6e303 100644
--- a/crypto/des/des_enc.c
+++ b/crypto/des/des_enc.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/crypto.h>
-#include "des_locl.h"
+#include "des_local.h"
 #include "spr.h"
 
 void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
diff --git a/crypto/des/des_locl.h b/crypto/des/des_local.h
similarity index 99%
rename from crypto/des/des_locl.h
rename to crypto/des/des_local.h
index 230a30f1e5..f888cb8001 100644
--- a/crypto/des/des_locl.h
+++ b/crypto/des/des_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DES_LOCL_H
-# define HEADER_DES_LOCL_H
+#ifndef OSSL_CRYPTO_DES_LOCAL_H
+# define OSSL_CRYPTO_DES_LOCAL_H
 
 # include <openssl/e_os2.h>
 
diff --git a/crypto/des/ecb3_enc.c b/crypto/des/ecb3_enc.c
index dbd0b5f3ff..7244b7b588 100644
--- a/crypto/des/ecb3_enc.c
+++ b/crypto/des/ecb3_enc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
                       DES_key_schedule *ks1, DES_key_schedule *ks2,
diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c
index 6e0b33d43d..39b8237ce7 100644
--- a/crypto/des/ecb_enc.c
+++ b/crypto/des/ecb_enc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 #include <openssl/opensslv.h>
 #include <openssl/bio.h>
 
diff --git a/crypto/des/fcrypt.c b/crypto/des/fcrypt.c
index 91f59cca19..9aebf2847c 100644
--- a/crypto/des/fcrypt.c
+++ b/crypto/des/fcrypt.c
@@ -19,7 +19,7 @@
 #endif
 
 #include <openssl/crypto.h>
-#include "des_locl.h"
+#include "des_local.h"
 
 /*
  * Added more values to handle illegal salt values the way normal crypt()
diff --git a/crypto/des/fcrypt_b.c b/crypto/des/fcrypt_b.c
index c522ddd1a5..87ad1b3025 100644
--- a/crypto/des/fcrypt_b.c
+++ b/crypto/des/fcrypt_b.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 
 #define DES_FCRYPT
-#include "des_locl.h"
+#include "des_local.h"
 #undef DES_FCRYPT
 
 #undef PERM_OP
diff --git a/crypto/des/ncbc_enc.c b/crypto/des/ncbc_enc.c
index 1b73d824af..e8decf1fbe 100644
--- a/crypto/des/ncbc_enc.c
+++ b/crypto/des/ncbc_enc.c
@@ -13,7 +13,7 @@
  *    des_enc.c  (DES_ncbc_encrypt)
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 #ifdef CBC_ENC_C__DONT_UPDATE_IV
 void DES_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
diff --git a/crypto/des/ofb64ede.c b/crypto/des/ofb64ede.c
index 8e916e7c69..284224df6c 100644
--- a/crypto/des/ofb64ede.c
+++ b/crypto/des/ofb64ede.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/crypto/des/ofb64enc.c b/crypto/des/ofb64enc.c
index 519e1636c5..eec46ae7de 100644
--- a/crypto/des/ofb64enc.c
+++ b/crypto/des/ofb64enc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/crypto/des/ofb_enc.c b/crypto/des/ofb_enc.c
index 96fbec9778..75100005ce 100644
--- a/crypto/des/ofb_enc.c
+++ b/crypto/des/ofb_enc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 /*
  * The input and output are loaded in multiples of 8 bits. What this means is
diff --git a/crypto/des/pcbc_enc.c b/crypto/des/pcbc_enc.c
index c7c11c2238..13df94218b 100644
--- a/crypto/des/pcbc_enc.c
+++ b/crypto/des/pcbc_enc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,
                       long length, DES_key_schedule *schedule,
diff --git a/crypto/des/qud_cksm.c b/crypto/des/qud_cksm.c
index b6ce887c82..5123914852 100644
--- a/crypto/des/qud_cksm.c
+++ b/crypto/des/qud_cksm.c
@@ -13,7 +13,7 @@
  * only based on the code in this paper and is almost definitely not the same
  * as the MIT implementation.
  */
-#include "des_locl.h"
+#include "des_local.h"
 
 #define Q_B0(a) (((DES_LONG)(a)))
 #define Q_B1(a) (((DES_LONG)(a))<<8)
diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c
index d42cebdadc..7972d84ac2 100644
--- a/crypto/des/set_key.c
+++ b/crypto/des/set_key.c
@@ -16,7 +16,7 @@
  * 1.0 First working version
  */
 #include <openssl/crypto.h>
-#include "des_locl.h"
+#include "des_local.h"
 
 static const unsigned char odd_parity[256] = {
     1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14,
diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c
index 81416ebb0d..d348c06d6b 100644
--- a/crypto/des/str2key.c
+++ b/crypto/des/str2key.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/crypto.h>
-#include "des_locl.h"
+#include "des_local.h"
 
 void DES_string_to_key(const char *str, DES_cblock *key)
 {
diff --git a/crypto/des/xcbc_enc.c b/crypto/des/xcbc_enc.c
index 7fdce59003..8a952f63a6 100644
--- a/crypto/des/xcbc_enc.c
+++ b/crypto/des/xcbc_enc.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "des_locl.h"
+#include "des_local.h"
 
 /* RSA's DESX */
 
diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c
index 84f1f8b952..bb319e774d 100644
--- a/crypto/dh/dh_ameth.c
+++ b/crypto/dh/dh_ameth.c
@@ -11,10 +11,10 @@
 #include "internal/cryptlib.h"
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
-#include "dh_locl.h"
+#include "dh_local.h"
 #include <openssl/bn.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 #include <openssl/cms.h>
 #include <openssl/core_names.h>
 #include "internal/param_build.h"
diff --git a/crypto/dh/dh_asn1.c b/crypto/dh/dh_asn1.c
index 71379d73bb..2708a81cd0 100644
--- a/crypto/dh/dh_asn1.c
+++ b/crypto/dh/dh_asn1.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/bn.h>
-#include "dh_locl.h"
+#include "dh_local.h"
 #include <openssl/objects.h>
 #include <openssl/asn1t.h>
 
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c
index 2d19a8f120..45c699b33b 100644
--- a/crypto/dh/dh_check.c
+++ b/crypto/dh/dh_check.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/bn.h>
-#include "dh_locl.h"
+#include "dh_local.h"
 
 # define DH_NUMBER_ITERATIONS_FOR_PRIME 64
 
diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c
index 76d6ad018e..0506bbe2e5 100644
--- a/crypto/dh/dh_gen.c
+++ b/crypto/dh/dh_gen.c
@@ -15,7 +15,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/bn.h>
-#include "dh_locl.h"
+#include "dh_local.h"
 
 static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
                                 BN_GENCB *cb);
diff --git a/crypto/dh/dh_key.c b/crypto/dh/dh_key.c
index 8731cc2c73..a8a9dbe764 100644
--- a/crypto/dh/dh_key.c
+++ b/crypto/dh/dh_key.c
@@ -9,8 +9,8 @@
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "dh_locl.h"
-#include "internal/bn_int.h"
+#include "dh_local.h"
+#include "crypto/bn.h"
 
 static int generate_key(DH *dh);
 static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index 0382e442d5..670ba1f7fc 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include "internal/refcount.h"
 #include <openssl/bn.h>
-#include "dh_locl.h"
+#include "dh_local.h"
 #include <openssl/engine.h>
 
 int DH_set_method(DH *dh, const DH_METHOD *meth)
diff --git a/crypto/dh/dh_locl.h b/crypto/dh/dh_local.h
similarity index 100%
rename from crypto/dh/dh_locl.h
rename to crypto/dh/dh_local.h
diff --git a/crypto/dh/dh_meth.c b/crypto/dh/dh_meth.c
index 8cdb61f353..be04b76a44 100644
--- a/crypto/dh/dh_meth.c
+++ b/crypto/dh/dh_meth.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "dh_locl.h"
+#include "dh_local.h"
 #include <string.h>
 #include <openssl/err.h>
 
diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c
index 4676a222e2..9eb17b4795 100644
--- a/crypto/dh/dh_pmeth.c
+++ b/crypto/dh/dh_pmeth.c
@@ -12,11 +12,11 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/evp.h>
-#include "dh_locl.h"
+#include "dh_local.h"
 #include <openssl/bn.h>
 #include <openssl/dsa.h>
 #include <openssl/objects.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 /* DH pkey context structure */
 
diff --git a/crypto/dh/dh_rfc5114.c b/crypto/dh/dh_rfc5114.c
index 1cc323839b..823f6d92e3 100644
--- a/crypto/dh/dh_rfc5114.c
+++ b/crypto/dh/dh_rfc5114.c
@@ -9,9 +9,9 @@
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "dh_locl.h"
+#include "dh_local.h"
 #include <openssl/bn.h>
-#include "internal/bn_dh.h"
+#include "crypto/bn_dh.h"
 
 /*
  * Macro to make a DH structure from BIGNUM data. NB: although just copying
diff --git a/crypto/dh/dh_rfc7919.c b/crypto/dh/dh_rfc7919.c
index 4e676fd3d1..e36712facf 100644
--- a/crypto/dh/dh_rfc7919.c
+++ b/crypto/dh/dh_rfc7919.c
@@ -9,10 +9,10 @@
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "dh_locl.h"
+#include "dh_local.h"
 #include <openssl/bn.h>
 #include <openssl/objects.h>
-#include "internal/bn_dh.h"
+#include "crypto/bn_dh.h"
 
 static DH *dh_param_init(const BIGNUM *p, int32_t nbits)
 {
diff --git a/crypto/dllmain.c b/crypto/dllmain.c
index 6f12741f9a..48c0cd3122 100644
--- a/crypto/dllmain.c
+++ b/crypto/dllmain.c
@@ -8,7 +8,7 @@
  */
 
 #include "e_os.h"
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 
 #if defined(_WIN32) || defined(__CYGWIN__)
 # ifdef __CYGWIN__
diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c
index f3aab34856..3fbec04900 100644
--- a/crypto/dsa/dsa_ameth.c
+++ b/crypto/dsa/dsa_ameth.c
@@ -14,10 +14,10 @@
 #include <openssl/cms.h>
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 #include "internal/param_build.h"
-#include "dsa_locl.h"
+#include "dsa_local.h"
 
 static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
 {
diff --git a/crypto/dsa/dsa_asn1.c b/crypto/dsa/dsa_asn1.c
index eddcc11819..bf16e282d5 100644
--- a/crypto/dsa/dsa_asn1.c
+++ b/crypto/dsa/dsa_asn1.c
@@ -9,11 +9,11 @@
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "dsa_locl.h"
+#include "dsa_local.h"
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/rand.h>
-#include "internal/asn1_dsa.h"
+#include "crypto/asn1_dsa.h"
 
 DSA_SIG *DSA_SIG_new(void)
 {
diff --git a/crypto/dsa/dsa_gen.c b/crypto/dsa/dsa_gen.c
index 14cb8e9f53..00feba381a 100644
--- a/crypto/dsa/dsa_gen.c
+++ b/crypto/dsa/dsa_gen.c
@@ -21,7 +21,7 @@
 #include <openssl/bn.h>
 #include <openssl/rand.h>
 #include <openssl/sha.h>
-#include "dsa_locl.h"
+#include "dsa_local.h"
 
 int DSA_generate_parameters_ex(DSA *ret, int bits,
                                const unsigned char *seed_in, int seed_len,
diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c
index 86f79b804e..6e5039a696 100644
--- a/crypto/dsa/dsa_key.c
+++ b/crypto/dsa/dsa_key.c
@@ -11,7 +11,7 @@
 #include <time.h>
 #include "internal/cryptlib.h"
 #include <openssl/bn.h>
-#include "dsa_locl.h"
+#include "dsa_local.h"
 
 static int dsa_builtin_keygen(DSA *dsa);
 
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c
index 034300fc7e..4670c433c5 100644
--- a/crypto/dsa/dsa_lib.c
+++ b/crypto/dsa/dsa_lib.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include "internal/refcount.h"
 #include <openssl/bn.h>
-#include "dsa_locl.h"
+#include "dsa_local.h"
 #include <openssl/asn1.h>
 #include <openssl/engine.h>
 #include <openssl/dh.h>
diff --git a/crypto/dsa/dsa_locl.h b/crypto/dsa/dsa_local.h
similarity index 100%
rename from crypto/dsa/dsa_locl.h
rename to crypto/dsa/dsa_local.h
diff --git a/crypto/dsa/dsa_meth.c b/crypto/dsa/dsa_meth.c
index 2202260c1b..226ea34085 100644
--- a/crypto/dsa/dsa_meth.c
+++ b/crypto/dsa/dsa_meth.c
@@ -15,7 +15,7 @@
  * or in the file LICENSE in the source distribution.
  */
 
-#include "dsa_locl.h"
+#include "dsa_local.h"
 #include <string.h>
 #include <openssl/err.h>
 
diff --git a/crypto/dsa/dsa_ossl.c b/crypto/dsa/dsa_ossl.c
index 08f2e9f025..5e34fc5586 100644
--- a/crypto/dsa/dsa_ossl.c
+++ b/crypto/dsa/dsa_ossl.c
@@ -9,10 +9,10 @@
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
-#include "internal/bn_int.h"
+#include "crypto/bn.h"
 #include <openssl/bn.h>
 #include <openssl/sha.h>
-#include "dsa_locl.h"
+#include "dsa_local.h"
 #include <openssl/asn1.h>
 
 static DSA_SIG *dsa_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);
diff --git a/crypto/dsa/dsa_pmeth.c b/crypto/dsa/dsa_pmeth.c
index 496063d876..24d5dbd3fd 100644
--- a/crypto/dsa/dsa_pmeth.c
+++ b/crypto/dsa/dsa_pmeth.c
@@ -13,8 +13,8 @@
 #include <openssl/x509.h>
 #include <openssl/evp.h>
 #include <openssl/bn.h>
-#include "internal/evp_int.h"
-#include "dsa_locl.h"
+#include "crypto/evp.h"
+#include "dsa_local.h"
 
 /* DSA pkey context structure */
 
diff --git a/crypto/dsa/dsa_sign.c b/crypto/dsa/dsa_sign.c
index 19582a077f..68501efab5 100644
--- a/crypto/dsa/dsa_sign.c
+++ b/crypto/dsa/dsa_sign.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "dsa_locl.h"
+#include "dsa_local.h"
 #include <openssl/bn.h>
 
 DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
diff --git a/crypto/dsa/dsa_vrf.c b/crypto/dsa/dsa_vrf.c
index 4066aa66f7..cf4412b5e1 100644
--- a/crypto/dsa/dsa_vrf.c
+++ b/crypto/dsa/dsa_vrf.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "dsa_locl.h"
+#include "dsa_local.h"
 
 int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig,
                   DSA *dsa)
diff --git a/crypto/dso/dso_dl.c b/crypto/dso/dso_dl.c
index 1ce3ac6acb..5469789345 100644
--- a/crypto/dso/dso_dl.c
+++ b/crypto/dso/dso_dl.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "dso_locl.h"
+#include "dso_local.h"
 
 #ifdef DSO_DL
 
diff --git a/crypto/dso/dso_dlfcn.c b/crypto/dso/dso_dlfcn.c
index d076c7ebc4..b01c2f6ac5 100644
--- a/crypto/dso/dso_dlfcn.c
+++ b/crypto/dso/dso_dlfcn.c
@@ -16,7 +16,7 @@
 # define _GNU_SOURCE            /* make sure dladdr is declared */
 #endif
 
-#include "dso_locl.h"
+#include "dso_local.h"
 #include "e_os.h"
 
 #ifdef DSO_DLFCN
diff --git a/crypto/dso/dso_lib.c b/crypto/dso/dso_lib.c
index f1b193bb3a..a464c391be 100644
--- a/crypto/dso/dso_lib.c
+++ b/crypto/dso/dso_lib.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "dso_locl.h"
+#include "dso_local.h"
 #include "internal/refcount.h"
 
 static DSO_METHOD *default_DSO_meth = NULL;
diff --git a/crypto/dso/dso_locl.h b/crypto/dso/dso_local.h
similarity index 99%
rename from crypto/dso/dso_locl.h
rename to crypto/dso/dso_local.h
index 5d365aab25..8aa29c1826 100644
--- a/crypto/dso/dso_locl.h
+++ b/crypto/dso/dso_local.h
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include "internal/dso.h"
-#include "internal/dso_conf.h"
+#include "crypto/dso_conf.h"
 #include "internal/refcount.h"
 
 /**********************************************************************/
diff --git a/crypto/dso/dso_openssl.c b/crypto/dso/dso_openssl.c
index 0e2443804c..3f264a6c65 100644
--- a/crypto/dso/dso_openssl.c
+++ b/crypto/dso/dso_openssl.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "dso_locl.h"
+#include "dso_local.h"
 
 #ifdef DSO_NONE
 
diff --git a/crypto/dso/dso_vms.c b/crypto/dso/dso_vms.c
index 8b0af2e636..d1993ceb4a 100644
--- a/crypto/dso/dso_vms.c
+++ b/crypto/dso/dso_vms.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "dso_locl.h"
+#include "dso_local.h"
 
 #ifdef OPENSSL_SYS_VMS
 
diff --git a/crypto/dso/dso_win32.c b/crypto/dso/dso_win32.c
index 9c7799216e..adf2e63688 100644
--- a/crypto/dso/dso_win32.c
+++ b/crypto/dso/dso_win32.c
@@ -8,7 +8,7 @@
  */
 
 #include "e_os.h"
-#include "dso_locl.h"
+#include "dso_local.h"
 
 #if defined(DSO_WIN32)
 
diff --git a/crypto/ec/curve25519.c b/crypto/ec/curve25519.c
index ca2b6cc580..89b1e3c2c1 100644
--- a/crypto/ec/curve25519.c
+++ b/crypto/ec/curve25519.c
@@ -8,7 +8,7 @@
  */
 
 #include <string.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/sha.h>
 
 #if defined(X25519_ASM) && (defined(__x86_64) || defined(__x86_64__) || \
diff --git a/crypto/ec/curve448/arch_32/arch_intrinsics.h b/crypto/ec/curve448/arch_32/arch_intrinsics.h
index 5db66f4a8a..7a54903ac9 100644
--- a/crypto/ec/curve448/arch_32/arch_intrinsics.h
+++ b/crypto/ec/curve448/arch_32/arch_intrinsics.h
@@ -10,10 +10,10 @@
  * Originally written by Mike Hamburg
  */
 
-#ifndef HEADER_ARCH_32_ARCH_INTRINSICS_H
-# define HEADER_ARCH_32_ARCH_INTRINSICS_H
+#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H
+# define OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H
 
-#include "internal/constant_time_locl.h"
+#include "internal/constant_time.h"
 
 # define ARCH_WORD_BITS 32
 
@@ -24,4 +24,4 @@ static ossl_inline uint64_t widemul(uint32_t a, uint32_t b)
     return ((uint64_t)a) * b;
 }
 
-#endif                          /* HEADER_ARCH_32_ARCH_INTRINSICS_H */
+#endif                          /* OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H */
diff --git a/crypto/ec/curve448/arch_32/f_impl.h b/crypto/ec/curve448/arch_32/f_impl.h
index 4ca283fe86..5cd25c04e1 100644
--- a/crypto/ec/curve448/arch_32/f_impl.h
+++ b/crypto/ec/curve448/arch_32/f_impl.h
@@ -10,8 +10,8 @@
  * Originally written by Mike Hamburg
  */
 
-#ifndef HEADER_ARCH_32_F_IMPL_H
-# define HEADER_ARCH_32_F_IMPL_H
+#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H
+# define OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H
 
 # define GF_HEADROOM 2
 # define LIMB(x) ((x) & ((1 << 28) - 1)), ((x) >> 28)
@@ -57,4 +57,4 @@ void gf_weak_reduce(gf a)
     a->limb[0] = (a->limb[0] & mask) + tmp;
 }
 
-#endif                  /* HEADER_ARCH_32_F_IMPL_H */
+#endif                  /* OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H */
diff --git a/crypto/ec/curve448/curve448.c b/crypto/ec/curve448/curve448.c
index 59f4479518..e3dffd09c9 100644
--- a/crypto/ec/curve448/curve448.c
+++ b/crypto/ec/curve448/curve448.c
@@ -15,7 +15,7 @@
 
 #include "point_448.h"
 #include "ed448.h"
-#include "curve448_lcl.h"
+#include "curve448_local.h"
 
 #define COFACTOR 4
 
diff --git a/crypto/ec/curve448/curve448_lcl.h b/crypto/ec/curve448/curve448_local.h
similarity index 92%
rename from crypto/ec/curve448/curve448_lcl.h
rename to crypto/ec/curve448/curve448_local.h
index 9459f002cb..197627f6b8 100644
--- a/crypto/ec/curve448/curve448_lcl.h
+++ b/crypto/ec/curve448/curve448_local.h
@@ -6,8 +6,8 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-#ifndef HEADER_CURVE448_LCL_H
-# define HEADER_CURVE448_LCL_H
+#ifndef OSSL_CRYPTO_EC_CURVE448_LOCAL_H
+# define OSSL_CRYPTO_EC_CURVE448_LOCAL_H
 # include "curve448utils.h"
 
 int X448(uint8_t out_shared_key[56], const uint8_t private_key[56],
@@ -36,4 +36,4 @@ int ED448ph_verify(OPENSSL_CTX *ctx, const uint8_t hash[64],
 int ED448_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[57],
                               const uint8_t private_key[57]);
 
-#endif              /* HEADER_CURVE448_LCL_H */
+#endif              /* OSSL_CRYPTO_EC_CURVE448_LOCAL_H */
diff --git a/crypto/ec/curve448/curve448utils.h b/crypto/ec/curve448/curve448utils.h
index 0ac69a6688..fa06cb02ec 100644
--- a/crypto/ec/curve448/curve448utils.h
+++ b/crypto/ec/curve448/curve448utils.h
@@ -10,8 +10,8 @@
  * Originally written by Mike Hamburg
  */
 
-#ifndef HEADER_CURVE448UTILS_H
-# define HEADER_CURVE448UTILS_H
+#ifndef OSSL_CRYPTO_EC_CURVE448UTILS_H
+# define OSSL_CRYPTO_EC_CURVE448UTILS_H
 
 # include <openssl/e_os2.h>
 
diff --git a/crypto/ec/curve448/ed448.h b/crypto/ec/curve448/ed448.h
index b198f36e3a..4f99fe6901 100644
--- a/crypto/ec/curve448/ed448.h
+++ b/crypto/ec/curve448/ed448.h
@@ -10,8 +10,8 @@
  * Originally written by Mike Hamburg
  */
 
-#ifndef HEADER_ED448_H
-# define HEADER_ED448_H
+#ifndef OSSL_CRYPTO_EC_CURVE448_ED448_H
+# define OSSL_CRYPTO_EC_CURVE448_ED448_H
 
 # include "point_448.h"
 
@@ -198,4 +198,4 @@ c448_error_t c448_ed448_convert_private_key_to_x448(
                             uint8_t x[X448_PRIVATE_BYTES],
                             const uint8_t ed[EDDSA_448_PRIVATE_BYTES]);
 
-#endif                          /* HEADER_ED448_H */
+#endif                          /* OSSL_CRYPTO_EC_CURVE448_ED448_H */
diff --git a/crypto/ec/curve448/eddsa.c b/crypto/ec/curve448/eddsa.c
index 45b6c4ab69..95fd66571e 100644
--- a/crypto/ec/curve448/eddsa.c
+++ b/crypto/ec/curve448/eddsa.c
@@ -12,7 +12,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/evp.h>
-#include "curve448_lcl.h"
+#include "curve448_local.h"
 #include "word.h"
 #include "ed448.h"
 #include "internal/numbers.h"
diff --git a/crypto/ec/curve448/field.h b/crypto/ec/curve448/field.h
index 4e46d3eae6..9d6ee1cacc 100644
--- a/crypto/ec/curve448/field.h
+++ b/crypto/ec/curve448/field.h
@@ -10,10 +10,10 @@
  * Originally written by Mike Hamburg
  */
 
-#ifndef HEADER_FIELD_H
-# define HEADER_FIELD_H
+#ifndef OSSL_CRYPTO_EC_CURVE448_FIELD_H
+# define OSSL_CRYPTO_EC_CURVE448_FIELD_H
 
-# include "internal/constant_time_locl.h"
+# include "internal/constant_time.h"
 # include <string.h>
 # include <assert.h>
 # include "word.h"
@@ -165,4 +165,4 @@ static ossl_inline void gf_cond_swap(gf x, gf_s * RESTRICT y, mask_t swap)
     }
 }
 
-#endif                          /* HEADER_FIELD_H */
+#endif                          /* OSSL_CRYPTO_EC_CURVE448_FIELD_H */
diff --git a/crypto/ec/curve448/point_448.h b/crypto/ec/curve448/point_448.h
index 1708b57fe8..9f09aea13f 100644
--- a/crypto/ec/curve448/point_448.h
+++ b/crypto/ec/curve448/point_448.h
@@ -10,8 +10,8 @@
  * Originally written by Mike Hamburg
  */
 
-#ifndef HEADER_POINT_448_H
-# define HEADER_POINT_448_H
+#ifndef OSSL_CRYPTO_EC_CURVE448_POINT_448_H
+# define OSSL_CRYPTO_EC_CURVE448_POINT_448_H
 
 # include "curve448utils.h"
 # include "field.h"
@@ -298,4 +298,4 @@ void curve448_scalar_destroy(curve448_scalar_t scalar);
 /* Overwrite point with zeros. */
 void curve448_point_destroy(curve448_point_t point);
 
-#endif                          /* HEADER_POINT_448_H */
+#endif                          /* OSSL_CRYPTO_EC_CURVE448_POINT_448_H */
diff --git a/crypto/ec/curve448/word.h b/crypto/ec/curve448/word.h
index 250720bea9..d3e6ff863b 100644
--- a/crypto/ec/curve448/word.h
+++ b/crypto/ec/curve448/word.h
@@ -10,8 +10,8 @@
  * Originally written by Mike Hamburg
  */
 
-#ifndef HEADER_WORD_H
-# define HEADER_WORD_H
+#ifndef OSSL_CRYPTO_EC_CURVE448_WORD_H
+# define OSSL_CRYPTO_EC_CURVE448_WORD_H
 
 # include <string.h>
 # include <assert.h>
@@ -78,4 +78,4 @@ static ossl_inline mask_t bool_to_mask(c448_bool_t m)
     return ret;
 }
 
-#endif                          /* HEADER_WORD_H */
+#endif                          /* OSSL_CRYPTO_EC_CURVE448_WORD_H */
diff --git a/crypto/ec/ec2_oct.c b/crypto/ec/ec2_oct.c
index f9ee3be931..1f92680f7b 100644
--- a/crypto/ec/ec2_oct.c
+++ b/crypto/ec/ec2_oct.c
@@ -10,7 +10,7 @@
 
 #include <openssl/err.h>
 
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 #ifndef OPENSSL_NO_EC2M
 
diff --git a/crypto/ec/ec2_smpl.c b/crypto/ec/ec2_smpl.c
index f377b1f11e..21ce6e12d3 100644
--- a/crypto/ec/ec2_smpl.c
+++ b/crypto/ec/ec2_smpl.c
@@ -10,8 +10,8 @@
 
 #include <openssl/err.h>
 
-#include "internal/bn_int.h"
-#include "ec_lcl.h"
+#include "crypto/bn.h"
+#include "ec_local.h"
 
 #ifndef OPENSSL_NO_EC2M
 
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index 2beeb82707..a0965ea78d 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -14,9 +14,9 @@
 #include <openssl/bn.h>
 #include <openssl/cms.h>
 #include <openssl/asn1t.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
-#include "ec_lcl.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
+#include "ec_local.h"
 
 #ifndef OPENSSL_NO_CMS
 static int ecdh_cms_decrypt(CMS_RecipientInfo *ri);
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index 2726f5d151..128ea71afc 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -8,12 +8,12 @@
  */
 
 #include <string.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/err.h>
 #include <openssl/asn1t.h>
 #include <openssl/objects.h>
 #include "internal/nelem.h"
-#include "internal/asn1_dsa.h"
+#include "crypto/asn1_dsa.h"
 
 #ifndef FIPS_MODE
 
diff --git a/crypto/ec/ec_check.c b/crypto/ec/ec_check.c
index 974fcb2446..f8723aab47 100644
--- a/crypto/ec/ec_check.c
+++ b/crypto/ec/ec_check.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/err.h>
 
 int EC_GROUP_check_named_curve(const EC_GROUP *group, int nist_only,
diff --git a/crypto/ec/ec_curve.c b/crypto/ec/ec_curve.c
index bf10938664..2639b1b547 100644
--- a/crypto/ec/ec_curve.c
+++ b/crypto/ec/ec_curve.c
@@ -9,7 +9,7 @@
  */
 
 #include <string.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/err.h>
 #include <openssl/obj_mac.h>
 #include <openssl/opensslconf.h>
diff --git a/crypto/ec/ec_cvt.c b/crypto/ec/ec_cvt.c
index 9b3087ed09..ec8989f64a 100644
--- a/crypto/ec/ec_cvt.c
+++ b/crypto/ec/ec_cvt.c
@@ -9,8 +9,8 @@
  */
 
 #include <openssl/err.h>
-#include "internal/bn_int.h"
-#include "ec_lcl.h"
+#include "crypto/bn.h"
+#include "ec_local.h"
 
 EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,
                                  const BIGNUM *b, BN_CTX *ctx)
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c
index 6a02a3bc86..2ae5a654c3 100644
--- a/crypto/ec/ec_key.c
+++ b/crypto/ec/ec_key.c
@@ -10,7 +10,7 @@
 
 #include "internal/cryptlib.h"
 #include <string.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include "internal/refcount.h"
 #include <openssl/err.h>
 #include <openssl/engine.h>
diff --git a/crypto/ec/ec_kmeth.c b/crypto/ec/ec_kmeth.c
index 036fec8726..9556a94210 100644
--- a/crypto/ec/ec_kmeth.c
+++ b/crypto/ec/ec_kmeth.c
@@ -11,7 +11,7 @@
 #include <openssl/ec.h>
 #include <openssl/engine.h>
 #include <openssl/err.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 
 static const EC_KEY_METHOD openssl_ec_key_method = {
diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c
index bc52e63443..e45b8352cd 100644
--- a/crypto/ec/ec_lib.c
+++ b/crypto/ec/ec_lib.c
@@ -13,7 +13,7 @@
 #include <openssl/err.h>
 #include <openssl/opensslv.h>
 
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 /* functions for EC_GROUP objects */
 
diff --git a/crypto/ec/ec_lcl.h b/crypto/ec/ec_local.h
similarity index 99%
rename from crypto/ec/ec_lcl.h
rename to crypto/ec/ec_local.h
index b33d30982c..a523ab6422 100644
--- a/crypto/ec/ec_lcl.h
+++ b/crypto/ec/ec_local.h
@@ -14,7 +14,7 @@
 #include <openssl/ec.h>
 #include <openssl/bn.h>
 #include "internal/refcount.h"
-#include "internal/ec_int.h"
+#include "crypto/ec.h"
 
 #if defined(__SUNPRO_C)
 # if __SUNPRO_C >= 0x520
diff --git a/crypto/ec/ec_mult.c b/crypto/ec/ec_mult.c
index be4f230623..2f2e66c679 100644
--- a/crypto/ec/ec_mult.c
+++ b/crypto/ec/ec_mult.c
@@ -12,8 +12,8 @@
 #include <openssl/err.h>
 
 #include "internal/cryptlib.h"
-#include "internal/bn_int.h"
-#include "ec_lcl.h"
+#include "crypto/bn.h"
+#include "ec_local.h"
 #include "internal/refcount.h"
 
 /*
diff --git a/crypto/ec/ec_oct.c b/crypto/ec/ec_oct.c
index 8783b592e5..e9b1b87a5f 100644
--- a/crypto/ec/ec_oct.c
+++ b/crypto/ec/ec_oct.c
@@ -13,7 +13,7 @@
 #include <openssl/err.h>
 #include <openssl/opensslv.h>
 
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 int EC_POINT_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point,
                                         const BIGNUM *x, int y_bit, BN_CTX *ctx)
diff --git a/crypto/ec/ec_pmeth.c b/crypto/ec/ec_pmeth.c
index ded2858ee4..1750e43d16 100644
--- a/crypto/ec/ec_pmeth.c
+++ b/crypto/ec/ec_pmeth.c
@@ -12,9 +12,9 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/ec.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 /* EC pkey context structure */
 
diff --git a/crypto/ec/ec_print.c b/crypto/ec/ec_print.c
index 0315b7a792..bb372d86d2 100644
--- a/crypto/ec/ec_print.c
+++ b/crypto/ec/ec_print.c
@@ -9,7 +9,7 @@
 
 #include <openssl/crypto.h>
 #include <openssl/err.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 BIGNUM *EC_POINT_point2bn(const EC_GROUP *group,
                           const EC_POINT *point,
diff --git a/crypto/ec/ecdh_kdf.c b/crypto/ec/ecdh_kdf.c
index a19080940a..8c4d530b11 100644
--- a/crypto/ec/ecdh_kdf.c
+++ b/crypto/ec/ecdh_kdf.c
@@ -12,7 +12,7 @@
 #include <openssl/ec.h>
 #include <openssl/evp.h>
 #include <openssl/kdf.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 /* Key derivation function from X9.63/SECG */
 int ecdh_KDF_X9_63(unsigned char *out, size_t outlen,
diff --git a/crypto/ec/ecdh_ossl.c b/crypto/ec/ecdh_ossl.c
index b3fb879246..5c64ce1a15 100644
--- a/crypto/ec/ecdh_ossl.c
+++ b/crypto/ec/ecdh_ossl.c
@@ -17,7 +17,7 @@
 #include <openssl/bn.h>
 #include <openssl/objects.h>
 #include <openssl/ec.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 int ossl_ecdh_compute_key(unsigned char **psec, size_t *pseclen,
                           const EC_POINT *pub_key, const EC_KEY *ecdh)
diff --git a/crypto/ec/ecdsa_ossl.c b/crypto/ec/ecdsa_ossl.c
index afa65233be..5593d5d68c 100644
--- a/crypto/ec/ecdsa_ossl.c
+++ b/crypto/ec/ecdsa_ossl.c
@@ -11,8 +11,8 @@
 #include <openssl/err.h>
 #include <openssl/obj_mac.h>
 #include <openssl/rand.h>
-#include "internal/bn_int.h"
-#include "ec_lcl.h"
+#include "crypto/bn.h"
+#include "ec_local.h"
 
 int ossl_ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp,
                           BIGNUM **rp)
diff --git a/crypto/ec/ecdsa_sign.c b/crypto/ec/ecdsa_sign.c
index 01b3a6fb6b..7d0215b326 100644
--- a/crypto/ec/ecdsa_sign.c
+++ b/crypto/ec/ecdsa_sign.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/ec.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/err.h>
 
 ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey)
diff --git a/crypto/ec/ecdsa_vrf.c b/crypto/ec/ecdsa_vrf.c
index 7773dff5ed..75dfe5b92b 100644
--- a/crypto/ec/ecdsa_vrf.c
+++ b/crypto/ec/ecdsa_vrf.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/ec.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/err.h>
 
 /*-
diff --git a/crypto/ec/ecp_mont.c b/crypto/ec/ecp_mont.c
index 61a203c178..44b6635361 100644
--- a/crypto/ec/ecp_mont.c
+++ b/crypto/ec/ecp_mont.c
@@ -10,7 +10,7 @@
 
 #include <openssl/err.h>
 
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 const EC_METHOD *EC_GFp_mont_method(void)
 {
diff --git a/crypto/ec/ecp_nist.c b/crypto/ec/ecp_nist.c
index 99cc74b66d..3b5666d15c 100644
--- a/crypto/ec/ecp_nist.c
+++ b/crypto/ec/ecp_nist.c
@@ -12,7 +12,7 @@
 
 #include <openssl/err.h>
 #include <openssl/obj_mac.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 const EC_METHOD *EC_GFp_nist_method(void)
 {
diff --git a/crypto/ec/ecp_nistp224.c b/crypto/ec/ecp_nistp224.c
index 8922a47bab..a726f8e249 100644
--- a/crypto/ec/ecp_nistp224.c
+++ b/crypto/ec/ecp_nistp224.c
@@ -38,7 +38,7 @@ NON_EMPTY_TRANSLATION_UNIT
 # include <stdint.h>
 # include <string.h>
 # include <openssl/err.h>
-# include "ec_lcl.h"
+# include "ec_local.h"
 
 # if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__==16
   /* even with gcc, the typedef won't work for 32-bit platforms */
diff --git a/crypto/ec/ecp_nistp256.c b/crypto/ec/ecp_nistp256.c
index 4d284fa326..4cbac522cd 100644
--- a/crypto/ec/ecp_nistp256.c
+++ b/crypto/ec/ecp_nistp256.c
@@ -39,7 +39,7 @@ NON_EMPTY_TRANSLATION_UNIT
 # include <stdint.h>
 # include <string.h>
 # include <openssl/err.h>
-# include "ec_lcl.h"
+# include "ec_local.h"
 
 # if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__==16
   /* even with gcc, the typedef won't work for 32-bit platforms */
diff --git a/crypto/ec/ecp_nistp521.c b/crypto/ec/ecp_nistp521.c
index 7b134bb7e7..6b5dc8eb99 100644
--- a/crypto/ec/ecp_nistp521.c
+++ b/crypto/ec/ecp_nistp521.c
@@ -38,7 +38,7 @@ NON_EMPTY_TRANSLATION_UNIT
 
 # include <string.h>
 # include <openssl/err.h>
-# include "ec_lcl.h"
+# include "ec_local.h"
 
 # if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__==16
   /* even with gcc, the typedef won't work for 32-bit platforms */
diff --git a/crypto/ec/ecp_nistputil.c b/crypto/ec/ecp_nistputil.c
index 0715370b51..98e0b72d10 100644
--- a/crypto/ec/ecp_nistputil.c
+++ b/crypto/ec/ecp_nistputil.c
@@ -33,7 +33,7 @@ NON_EMPTY_TRANSLATION_UNIT
  */
 
 # include <stddef.h>
-# include "ec_lcl.h"
+# include "ec_local.h"
 
 /*
  * Convert an array of points into affine coordinates. (If the point at
diff --git a/crypto/ec/ecp_nistz256.c b/crypto/ec/ecp_nistz256.c
index a09e9c5d99..603557ced5 100644
--- a/crypto/ec/ecp_nistz256.c
+++ b/crypto/ec/ecp_nistz256.c
@@ -21,8 +21,8 @@
 #include <string.h>
 
 #include "internal/cryptlib.h"
-#include "internal/bn_int.h"
-#include "ec_lcl.h"
+#include "crypto/bn.h"
+#include "ec_local.h"
 #include "internal/refcount.h"
 
 #if BN_BITS2 != 64
diff --git a/crypto/ec/ecp_oct.c b/crypto/ec/ecp_oct.c
index a00eac35be..e6bc153f51 100644
--- a/crypto/ec/ecp_oct.c
+++ b/crypto/ec/ecp_oct.c
@@ -11,7 +11,7 @@
 #include <openssl/err.h>
 #include <openssl/symhacks.h>
 
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 int ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group,
                                              EC_POINT *point,
diff --git a/crypto/ec/ecp_s390x_nistp.c b/crypto/ec/ecp_s390x_nistp.c
index 9533698b0f..a7cb5d3186 100644
--- a/crypto/ec/ecp_s390x_nistp.c
+++ b/crypto/ec/ecp_s390x_nistp.c
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include "s390x_arch.h"
 
 /* Size of parameter blocks */
diff --git a/crypto/ec/ecp_smpl.c b/crypto/ec/ecp_smpl.c
index bf7aeb1017..e06177ee14 100644
--- a/crypto/ec/ecp_smpl.c
+++ b/crypto/ec/ecp_smpl.c
@@ -11,7 +11,7 @@
 #include <openssl/err.h>
 #include <openssl/symhacks.h>
 
-#include "ec_lcl.h"
+#include "ec_local.h"
 
 const EC_METHOD *EC_GFp_simple_method(void)
 {
diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c
index aaaca64426..eace1a88cd 100644
--- a/crypto/ec/ecx_meth.c
+++ b/crypto/ec/ecx_meth.c
@@ -12,10 +12,10 @@
 #include <openssl/x509.h>
 #include <openssl/ec.h>
 #include <openssl/rand.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
-#include "ec_lcl.h"
-#include "curve448/curve448_lcl.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
+#include "ec_local.h"
+#include "curve448/curve448_local.h"
 
 #define X25519_BITS          253
 #define X25519_SECURITY_BITS 128
diff --git a/crypto/engine/README b/crypto/engine/README
index c7a5696ca1..0f8a8fbde4 100644
--- a/crypto/engine/README
+++ b/crypto/engine/README
@@ -9,7 +9,7 @@ for masochists" document *and* a rather extensive commit log message. (I'd get
 lynched for sticking all this in CHANGES or the commit mails :-).
 
 ENGINE_TABLE underlies this restructuring, as described in the internal header
-"eng_int.h", implemented in eng_table.c, and used in each of the "class" files;
+"eng_local.h", implemented in eng_table.c, and used in each of the "class" files;
 tb_rsa.c, tb_dsa.c, etc.
 
 However, "EVP_CIPHER" underlies the motivation and design of ENGINE_TABLE so
diff --git a/crypto/engine/eng_all.c b/crypto/engine/eng_all.c
index e1f09acddf..0c5e4bdfd5 100644
--- a/crypto/engine/eng_all.c
+++ b/crypto/engine/eng_all.c
@@ -8,7 +8,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "eng_int.h"
+#include "eng_local.h"
 
 void ENGINE_load_builtin_engines(void)
 {
diff --git a/crypto/engine/eng_cnf.c b/crypto/engine/eng_cnf.c
index 9f647c4a9a..221981942c 100644
--- a/crypto/engine/eng_cnf.c
+++ b/crypto/engine/eng_cnf.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 #include <openssl/conf.h>
 #include <openssl/trace.h>
 
diff --git a/crypto/engine/eng_ctrl.c b/crypto/engine/eng_ctrl.c
index d036f80e3b..39cfb17089 100644
--- a/crypto/engine/eng_ctrl.c
+++ b/crypto/engine/eng_ctrl.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 /*
  * When querying a ENGINE-specific control command's 'description', this
diff --git a/crypto/engine/eng_dyn.c b/crypto/engine/eng_dyn.c
index bde760253a..7b1bc6ed84 100644
--- a/crypto/engine/eng_dyn.c
+++ b/crypto/engine/eng_dyn.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 #include "internal/dso.h"
 #include <openssl/crypto.h>
 
diff --git a/crypto/engine/eng_fat.c b/crypto/engine/eng_fat.c
index e6938a41ce..428e66733b 100644
--- a/crypto/engine/eng_fat.c
+++ b/crypto/engine/eng_fat.c
@@ -8,7 +8,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 #include <openssl/conf.h>
 
 int ENGINE_set_default(ENGINE *e, unsigned int flags)
diff --git a/crypto/engine/eng_init.c b/crypto/engine/eng_init.c
index 6d74a2ddb1..34f01388a2 100644
--- a/crypto/engine/eng_init.c
+++ b/crypto/engine/eng_init.c
@@ -8,7 +8,7 @@
  */
 
 #include "e_os.h"
-#include "eng_int.h"
+#include "eng_local.h"
 
 /*
  * Initialise a engine type for use (or up its functional reference count if
diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c
index be893fe5bf..4ba235ca75 100644
--- a/crypto/engine/eng_lib.c
+++ b/crypto/engine/eng_lib.c
@@ -8,7 +8,7 @@
  */
 
 #include "e_os.h"
-#include "eng_int.h"
+#include "eng_local.h"
 #include <openssl/rand.h>
 #include "internal/refcount.h"
 
diff --git a/crypto/engine/eng_list.c b/crypto/engine/eng_list.c
index a0c56c506e..7659231e56 100644
--- a/crypto/engine/eng_list.c
+++ b/crypto/engine/eng_list.c
@@ -8,7 +8,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 /*
  * The linked-list of pointers to engine types. engine_list_head incorporates
diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_local.h
similarity index 97%
rename from crypto/engine/eng_int.h
rename to crypto/engine/eng_local.h
index d45617567c..1862920157 100644
--- a/crypto/engine/eng_int.h
+++ b/crypto/engine/eng_local.h
@@ -8,12 +8,12 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ENGINE_INT_H
-# define HEADER_ENGINE_INT_H
+#ifndef OSSL_CRYPTO_ENGINE_ENG_LOCAL_H
+# define OSSL_CRYPTO_ENGINE_ENG_LOCAL_H
 
 # include <openssl/trace.h>
 # include "internal/cryptlib.h"
-# include "internal/engine.h"
+# include "crypto/engine.h"
 # include "internal/thread_once.h"
 # include "internal/refcount.h"
 
@@ -151,4 +151,4 @@ typedef struct st_engine_pile ENGINE_PILE;
 
 DEFINE_LHASH_OF(ENGINE_PILE);
 
-#endif                          /* HEADER_ENGINE_INT_H */
+#endif                          /* OSSL_CRYPTO_ENGINE_ENG_LOCAL_H */
diff --git a/crypto/engine/eng_openssl.c b/crypto/engine/eng_openssl.c
index debbb16a79..53edb41a3e 100644
--- a/crypto/engine/eng_openssl.c
+++ b/crypto/engine/eng_openssl.c
@@ -11,7 +11,7 @@
 #include <stdio.h>
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
-#include "internal/engine.h"
+#include "crypto/engine.h"
 #include <openssl/pem.h>
 #include <openssl/evp.h>
 #include <openssl/rand.h>
diff --git a/crypto/engine/eng_pkey.c b/crypto/engine/eng_pkey.c
index 7282d5ddbf..1f67eaa4fc 100644
--- a/crypto/engine/eng_pkey.c
+++ b/crypto/engine/eng_pkey.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 /* Basic get/set stuff */
 
diff --git a/crypto/engine/eng_rdrand.c b/crypto/engine/eng_rdrand.c
index 7dd3b9fdf6..b6d1988d13 100644
--- a/crypto/engine/eng_rdrand.c
+++ b/crypto/engine/eng_rdrand.c
@@ -11,7 +11,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#include "internal/engine.h"
+#include "crypto/engine.h"
 #include "internal/cryptlib.h"
 #include <openssl/rand.h>
 #include <openssl/err.h>
diff --git a/crypto/engine/eng_table.c b/crypto/engine/eng_table.c
index 62e9416869..f6dfad9867 100644
--- a/crypto/engine/eng_table.c
+++ b/crypto/engine/eng_table.c
@@ -11,7 +11,7 @@
 #include <openssl/evp.h>
 #include <openssl/lhash.h>
 #include <openssl/trace.h>
-#include "eng_int.h"
+#include "eng_local.h"
 
 /* The type of the items in the table */
 struct st_engine_pile {
@@ -27,7 +27,7 @@ struct st_engine_pile {
     int uptodate;
 };
 
-/* The type exposed in eng_int.h */
+/* The type exposed in eng_local.h */
 struct st_engine_table {
     LHASH_OF(ENGINE_PILE) piles;
 };                              /* ENGINE_TABLE */
@@ -77,7 +77,7 @@ static int int_table_check(ENGINE_TABLE **t, int create)
 }
 
 /*
- * Privately exposed (via eng_int.h) functions for adding and/or removing
+ * Privately exposed (via eng_local.h) functions for adding and/or removing
  * ENGINEs from the implementation table
  */
 int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
diff --git a/crypto/engine/tb_asnmth.c b/crypto/engine/tb_asnmth.c
index 2f167c84a8..5e356312a0 100644
--- a/crypto/engine/tb_asnmth.c
+++ b/crypto/engine/tb_asnmth.c
@@ -8,9 +8,9 @@
  */
 
 #include "e_os.h"
-#include "eng_int.h"
+#include "eng_local.h"
 #include <openssl/evp.h>
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 
 /*
  * If this symbol is defined then ENGINE_get_pkey_asn1_meth_engine(), the
diff --git a/crypto/engine/tb_cipher.c b/crypto/engine/tb_cipher.c
index 8aa3be7e48..c669907a53 100644
--- a/crypto/engine/tb_cipher.c
+++ b/crypto/engine/tb_cipher.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 static ENGINE_TABLE *cipher_table = NULL;
 
diff --git a/crypto/engine/tb_dh.c b/crypto/engine/tb_dh.c
index 5e2824ae95..e877fce2fc 100644
--- a/crypto/engine/tb_dh.c
+++ b/crypto/engine/tb_dh.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 static ENGINE_TABLE *dh_table = NULL;
 static const int dummy_nid = 1;
diff --git a/crypto/engine/tb_digest.c b/crypto/engine/tb_digest.c
index 4221f6d898..8a5a8332a9 100644
--- a/crypto/engine/tb_digest.c
+++ b/crypto/engine/tb_digest.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 static ENGINE_TABLE *digest_table = NULL;
 
diff --git a/crypto/engine/tb_dsa.c b/crypto/engine/tb_dsa.c
index 15492d56b8..a22e8f6941 100644
--- a/crypto/engine/tb_dsa.c
+++ b/crypto/engine/tb_dsa.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 static ENGINE_TABLE *dsa_table = NULL;
 static const int dummy_nid = 1;
diff --git a/crypto/engine/tb_eckey.c b/crypto/engine/tb_eckey.c
index 8c662e7ebb..397dad8855 100644
--- a/crypto/engine/tb_eckey.c
+++ b/crypto/engine/tb_eckey.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 static ENGINE_TABLE *dh_table = NULL;
 static const int dummy_nid = 1;
diff --git a/crypto/engine/tb_pkmeth.c b/crypto/engine/tb_pkmeth.c
index 4dab5d5933..beb4fd7371 100644
--- a/crypto/engine/tb_pkmeth.c
+++ b/crypto/engine/tb_pkmeth.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 #include <openssl/evp.h>
 
 static ENGINE_TABLE *pkey_meth_table = NULL;
diff --git a/crypto/engine/tb_rand.c b/crypto/engine/tb_rand.c
index 3b1b475163..d7c7ef485f 100644
--- a/crypto/engine/tb_rand.c
+++ b/crypto/engine/tb_rand.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 static ENGINE_TABLE *rand_table = NULL;
 static const int dummy_nid = 1;
diff --git a/crypto/engine/tb_rsa.c b/crypto/engine/tb_rsa.c
index 02c309a3bb..5b7d6717ae 100644
--- a/crypto/engine/tb_rsa.c
+++ b/crypto/engine/tb_rsa.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "eng_int.h"
+#include "eng_local.h"
 
 static ENGINE_TABLE *rsa_table = NULL;
 static const int dummy_nid = 1;
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 6ad995d679..eca0f6d33e 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -13,19 +13,19 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <string.h>
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include "internal/err.h"
-#include "internal/err_int.h"
+#include "crypto/err.h"
 #include <openssl/err.h>
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
 #include <openssl/bio.h>
 #include <openssl/opensslconf.h>
 #include "internal/thread_once.h"
-#include "internal/ctype.h"
-#include "internal/constant_time_locl.h"
+#include "crypto/ctype.h"
+#include "internal/constant_time.h"
 #include "e_os.h"
-#include "err_locl.h"
+#include "err_local.h"
 
 /* Forward declaration in case it's not published because of configuration */
 ERR_STATE *ERR_get_state(void);
diff --git a/crypto/err/err_all.c b/crypto/err/err_all.c
index 972421f402..5957730d18 100644
--- a/crypto/err/err_all.c
+++ b/crypto/err/err_all.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "internal/err_int.h"
+#include "crypto/err.h"
 #include <openssl/asn1err.h>
 #include <openssl/bnerr.h>
 #include <openssl/ecerr.h>
diff --git a/crypto/err/err_blocks.c b/crypto/err/err_blocks.c
index e50f580b33..20888e9576 100644
--- a/crypto/err/err_blocks.c
+++ b/crypto/err/err_blocks.c
@@ -12,7 +12,7 @@
 
 #include <string.h>
 #include <openssl/err.h>
-#include "err_locl.h"
+#include "err_local.h"
 
 void ERR_new(void)
 {
diff --git a/crypto/err/err_locl.h b/crypto/err/err_local.h
similarity index 100%
rename from crypto/err/err_locl.h
rename to crypto/err/err_local.h
diff --git a/crypto/err/err_prn.c b/crypto/err/err_prn.c
index 1e1531b91d..27e987e0e1 100644
--- a/crypto/err/err_prn.c
+++ b/crypto/err/err_prn.c
@@ -15,7 +15,7 @@
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
 #include <openssl/err.h>
-#include "err_locl.h"
+#include "err_local.h"
 
 void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
                          void *u)
diff --git a/crypto/err/openssl.ec b/crypto/err/openssl.ec
index 925ed65b96..179a3baa05 100644
--- a/crypto/err/openssl.ec
+++ b/crypto/err/openssl.ec
@@ -35,7 +35,7 @@ L CMP           include/openssl/cmp.h           crypto/cmp/cmp_err.c
 L CT            include/openssl/ct.h            crypto/ct/ct_err.c
 L ASYNC         include/openssl/async.h         crypto/async/async_err.c
 L KDF           include/openssl/kdf.h           crypto/kdf/kdf_err.c
-L SM2           crypto/include/internal/sm2.h   crypto/sm2/sm2_err.c
+L SM2           include/crypto/sm2.h            crypto/sm2/sm2_err.c
 L OSSL_STORE    include/openssl/store.h         crypto/store/store_err.c
 L ESS           include/openssl/ess.h           crypto/ess/ess_err.c
 L PROP          include/internal/property.h     crypto/property/property_err.c
@@ -43,10 +43,10 @@ L PROV          providers/common/include/internal/providercommon.h providers/com
 
 # additional header files to be scanned for function names
 L NONE          include/openssl/x509_vfy.h      NONE
-L NONE          crypto/ec/ec_lcl.h              NONE
-L NONE          crypto/cms/cms_lcl.h            NONE
-L NONE          crypto/ct/ct_locl.h             NONE
-L NONE          ssl/ssl_locl.h                  NONE
+L NONE          crypto/ec/ec_local.h              NONE
+L NONE          crypto/cms/cms_local.h            NONE
+L NONE          crypto/ct/ct_local.h             NONE
+L NONE          ssl/ssl_local.h                  NONE
 
 # SSL/TLS alerts
 R SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE          1010
diff --git a/crypto/ess/ess_asn1.c b/crypto/ess/ess_asn1.c
index 0ea08e8653..19589d97f3 100644
--- a/crypto/ess/ess_asn1.c
+++ b/crypto/ess/ess_asn1.c
@@ -11,7 +11,7 @@
 #include <openssl/asn1t.h>
 #include <openssl/ess.h>
 #include <openssl/x509v3.h>
-#include "internal/ess_int.h"
+#include "crypto/ess.h"
 
 /* ASN1 stuff for ESS Structure */
 
diff --git a/crypto/ess/ess_lib.c b/crypto/ess/ess_lib.c
index fa9cff18be..17c0ea56c6 100644
--- a/crypto/ess/ess_lib.c
+++ b/crypto/ess/ess_lib.c
@@ -11,7 +11,7 @@
 #include <openssl/x509v3.h>
 #include <openssl/err.h>
 #include <openssl/ess.h>
-#include "internal/ess_int.h"
+#include "crypto/ess.h"
 
 static ESS_CERT_ID *ESS_CERT_ID_new_init(X509 *cert, int issuer_needed);
 static ESS_CERT_ID_V2 *ESS_CERT_ID_V2_new_init(const EVP_MD *hash_alg,
diff --git a/crypto/evp/bio_md.c b/crypto/evp/bio_md.c
index 9dd3ac421b..8d502d0bf7 100644
--- a/crypto/evp/bio_md.c
+++ b/crypto/evp/bio_md.c
@@ -12,8 +12,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
-#include "evp_locl.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
 #include "internal/bio.h"
 
 /*
diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c
index 7f99f32548..f94882829b 100644
--- a/crypto/evp/bio_ok.c
+++ b/crypto/evp/bio_ok.c
@@ -76,7 +76,7 @@
 #include "internal/bio.h"
 #include <openssl/evp.h>
 #include <openssl/rand.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 static int ok_write(BIO *h, const char *buf, int num);
 static int ok_read(BIO *h, char *buf, int size);
diff --git a/crypto/evp/c_allc.c b/crypto/evp/c_allc.c
index a97eaa1685..df8e5a5bcb 100644
--- a/crypto/evp/c_allc.c
+++ b/crypto/evp/c_allc.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include <openssl/pkcs12.h>
 #include <openssl/objects.h>
 
diff --git a/crypto/evp/c_alld.c b/crypto/evp/c_alld.c
index a0b2500d11..f7d62bd2ec 100644
--- a/crypto/evp/c_alld.c
+++ b/crypto/evp/c_alld.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include <openssl/pkcs12.h>
 #include <openssl/objects.h>
 
diff --git a/crypto/evp/cmeth_lib.c b/crypto/evp/cmeth_lib.c
index ba61c52564..37cca7a256 100644
--- a/crypto/evp/cmeth_lib.c
+++ b/crypto/evp/cmeth_lib.c
@@ -10,9 +10,9 @@
 #include <string.h>
 
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len)
 {
diff --git a/crypto/evp/digest.c b/crypto/evp/digest.c
index 9c6aa42887..1ce529241f 100644
--- a/crypto/evp/digest.c
+++ b/crypto/evp/digest.c
@@ -14,9 +14,9 @@
 #include <openssl/params.h>
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 /* This call frees resources associated with the context */
 int EVP_MD_CTX_reset(EVP_MD_CTX *ctx)
diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c
index 39ed528060..49ed886e64 100644
--- a/crypto/evp/e_aes.c
+++ b/crypto/evp/e_aes.c
@@ -16,12 +16,12 @@
 #include <openssl/aes.h>
 #include <openssl/rand.h>
 #include <openssl/cmac.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/cryptlib.h"
-#include "internal/modes_int.h"
-#include "internal/siv_int.h"
-#include "internal/ciphermode_platform.h"
-#include "evp_locl.h"
+#include "crypto/modes.h"
+#include "crypto/siv.h"
+#include "crypto/ciphermode_platform.h"
+#include "evp_local.h"
 
 typedef struct {
     union {
diff --git a/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c
index 9e393f0b88..6b9362a1fe 100644
--- a/crypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/crypto/evp/e_aes_cbc_hmac_sha1.c
@@ -16,9 +16,9 @@
 #include <openssl/sha.h>
 #include <openssl/rand.h>
 #include "internal/cryptlib.h"
-#include "internal/modes_int.h"
-#include "internal/evp_int.h"
-#include "internal/constant_time_locl.h"
+#include "crypto/modes.h"
+#include "crypto/evp.h"
+#include "internal/constant_time.h"
 
 typedef struct {
     AES_KEY ks;
diff --git a/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/evp/e_aes_cbc_hmac_sha256.c
index e434ec009f..771ef1d6a2 100644
--- a/crypto/evp/e_aes_cbc_hmac_sha256.c
+++ b/crypto/evp/e_aes_cbc_hmac_sha256.c
@@ -16,9 +16,9 @@
 #include <openssl/sha.h>
 #include <openssl/rand.h>
 #include "internal/cryptlib.h"
-#include "internal/modes_int.h"
-#include "internal/constant_time_locl.h"
-#include "internal/evp_int.h"
+#include "crypto/modes.h"
+#include "internal/constant_time.h"
+#include "crypto/evp.h"
 
 typedef struct {
     AES_KEY ks;
diff --git a/crypto/evp/e_aria.c b/crypto/evp/e_aria.c
index 84b14826cb..a8c4fc32e2 100644
--- a/crypto/evp/e_aria.c
+++ b/crypto/evp/e_aria.c
@@ -14,10 +14,10 @@
 # include <openssl/modes.h>
 # include <openssl/rand.h>
 # include <openssl/rand_drbg.h>
-# include "internal/aria.h"
-# include "internal/evp_int.h"
-# include "internal/modes_int.h"
-# include "evp_locl.h"
+# include "crypto/aria.h"
+# include "crypto/evp.h"
+# include "crypto/modes.h"
+# include "evp_local.h"
 
 /* ARIA subkey Structure */
 typedef struct {
diff --git a/crypto/evp/e_bf.c b/crypto/evp/e_bf.c
index 71cc990b25..0ac49fe1fe 100644
--- a/crypto/evp/e_bf.c
+++ b/crypto/evp/e_bf.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #ifndef OPENSSL_NO_BF
 # include <openssl/evp.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/objects.h>
 # include <openssl/blowfish.h>
 
diff --git a/crypto/evp/e_camellia.c b/crypto/evp/e_camellia.c
index 5e66101422..50febca9bc 100644
--- a/crypto/evp/e_camellia.c
+++ b/crypto/evp/e_camellia.c
@@ -17,9 +17,9 @@ NON_EMPTY_TRANSLATION_UNIT
 # include <string.h>
 # include <assert.h>
 # include <openssl/camellia.h>
-# include "internal/evp_int.h"
-# include "internal/modes_int.h"
-# include "internal/ciphermode_platform.h"
+# include "crypto/evp.h"
+# include "crypto/modes.h"
+# include "crypto/ciphermode_platform.h"
 
 static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
                              const unsigned char *iv, int enc);
diff --git a/crypto/evp/e_cast.c b/crypto/evp/e_cast.c
index 8906bd4703..4b06717b72 100644
--- a/crypto/evp/e_cast.c
+++ b/crypto/evp/e_cast.c
@@ -13,7 +13,7 @@
 #ifndef OPENSSL_NO_CAST
 # include <openssl/evp.h>
 # include <openssl/objects.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/cast.h>
 
 static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
diff --git a/crypto/evp/e_chacha20_poly1305.c b/crypto/evp/e_chacha20_poly1305.c
index 570378b1af..b7340b147d 100644
--- a/crypto/evp/e_chacha20_poly1305.c
+++ b/crypto/evp/e_chacha20_poly1305.c
@@ -14,9 +14,9 @@
 
 # include <openssl/evp.h>
 # include <openssl/objects.h>
-# include "internal/evp_int.h"
-# include "evp_locl.h"
-# include "internal/chacha.h"
+# include "crypto/evp.h"
+# include "evp_local.h"
+# include "crypto/chacha.h"
 
 typedef struct {
     union {
@@ -146,7 +146,7 @@ const EVP_CIPHER *EVP_chacha20(void)
 }
 
 # ifndef OPENSSL_NO_POLY1305
-#  include "internal/poly1305.h"
+#  include "crypto/poly1305.h"
 
 typedef struct {
     EVP_CHACHA_KEY key;
diff --git a/crypto/evp/e_des.c b/crypto/evp/e_des.c
index 0d8e90cfa7..e5791f3447 100644
--- a/crypto/evp/e_des.c
+++ b/crypto/evp/e_des.c
@@ -12,7 +12,7 @@
 #ifndef OPENSSL_NO_DES
 # include <openssl/evp.h>
 # include <openssl/objects.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/des.h>
 # include <openssl/rand.h>
 
diff --git a/crypto/evp/e_des3.c b/crypto/evp/e_des3.c
index 52fde95fb0..8f9eab427e 100644
--- a/crypto/evp/e_des3.c
+++ b/crypto/evp/e_des3.c
@@ -12,10 +12,10 @@
 #ifndef OPENSSL_NO_DES
 # include <openssl/evp.h>
 # include <openssl/objects.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/des.h>
 # include <openssl/rand.h>
-# include "evp_locl.h"
+# include "evp_local.h"
 
 typedef struct {
     union {
diff --git a/crypto/evp/e_idea.c b/crypto/evp/e_idea.c
index 0f7f4dd525..8c3a554108 100644
--- a/crypto/evp/e_idea.c
+++ b/crypto/evp/e_idea.c
@@ -13,7 +13,7 @@
 #ifndef OPENSSL_NO_IDEA
 # include <openssl/evp.h>
 # include <openssl/objects.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/idea.h>
 
 /* Can't use IMPLEMENT_BLOCK_CIPHER because IDEA_ecb_encrypt is different */
diff --git a/crypto/evp/e_null.c b/crypto/evp/e_null.c
index 2f3fcc88f2..2c8d27e3be 100644
--- a/crypto/evp/e_null.c
+++ b/crypto/evp/e_null.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/objects.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
                          const unsigned char *iv, int enc);
diff --git a/crypto/evp/e_rc2.c b/crypto/evp/e_rc2.c
index 375714a6f4..d2201b000a 100644
--- a/crypto/evp/e_rc2.c
+++ b/crypto/evp/e_rc2.c
@@ -14,7 +14,7 @@
 
 # include <openssl/evp.h>
 # include <openssl/objects.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/rc2.h>
 
 static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
diff --git a/crypto/evp/e_rc4.c b/crypto/evp/e_rc4.c
index a1664b594e..092d6cf1db 100644
--- a/crypto/evp/e_rc4.c
+++ b/crypto/evp/e_rc4.c
@@ -16,7 +16,7 @@
 # include <openssl/objects.h>
 # include <openssl/rc4.h>
 
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 typedef struct {
     RC4_KEY ks;                 /* working key */
diff --git a/crypto/evp/e_rc4_hmac_md5.c b/crypto/evp/e_rc4_hmac_md5.c
index 4d61faff61..fc519d9042 100644
--- a/crypto/evp/e_rc4_hmac_md5.c
+++ b/crypto/evp/e_rc4_hmac_md5.c
@@ -19,7 +19,7 @@
 # include <openssl/objects.h>
 # include <openssl/rc4.h>
 # include <openssl/md5.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 typedef struct {
     RC4_KEY ks;
diff --git a/crypto/evp/e_rc5.c b/crypto/evp/e_rc5.c
index 95a626bd4f..4783cc31ca 100644
--- a/crypto/evp/e_rc5.c
+++ b/crypto/evp/e_rc5.c
@@ -13,9 +13,9 @@
 #ifndef OPENSSL_NO_RC5
 
 # include <openssl/evp.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/objects.h>
-# include "evp_locl.h"
+# include "evp_local.h"
 # include <openssl/rc5.h>
 
 static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
diff --git a/crypto/evp/e_seed.c b/crypto/evp/e_seed.c
index 0861ee8b2e..9a9938deaf 100644
--- a/crypto/evp/e_seed.c
+++ b/crypto/evp/e_seed.c
@@ -16,7 +16,7 @@ NON_EMPTY_TRANSLATION_UNIT
 # include <string.h>
 # include <assert.h>
 # include <openssl/seed.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
                          const unsigned char *iv, int enc);
diff --git a/crypto/evp/e_sm4.c b/crypto/evp/e_sm4.c
index 02292fa605..4653c10a14 100644
--- a/crypto/evp/e_sm4.c
+++ b/crypto/evp/e_sm4.c
@@ -13,8 +13,8 @@
 #ifndef OPENSSL_NO_SM4
 # include <openssl/evp.h>
 # include <openssl/modes.h>
-# include "internal/sm4.h"
-# include "internal/evp_int.h"
+# include "crypto/sm4.h"
+# include "crypto/evp.h"
 
 typedef struct {
     SM4_KEY ks;
diff --git a/crypto/evp/e_xcbc_d.c b/crypto/evp/e_xcbc_d.c
index 285001c373..d402606b6d 100644
--- a/crypto/evp/e_xcbc_d.c
+++ b/crypto/evp/e_xcbc_d.c
@@ -14,7 +14,7 @@
 
 # include <openssl/evp.h>
 # include <openssl/objects.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/des.h>
 
 static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c
index ab80267c1e..fb657d1499 100644
--- a/crypto/evp/encode.c
+++ b/crypto/evp/encode.c
@@ -11,8 +11,8 @@
 #include <limits.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
-#include "evp_locl.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
 
 static unsigned char conv_ascii2bin(unsigned char a,
                                     const unsigned char *table);
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index 2685436d36..a3fb5f7424 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -17,9 +17,9 @@
 #include <openssl/engine.h>
 #include <openssl/params.h>
 #include <openssl/core_names.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx)
 {
diff --git a/crypto/evp/evp_fetch.c b/crypto/evp/evp_fetch.c
index cd2bacea5d..e15b8e26be 100644
--- a/crypto/evp/evp_fetch.c
+++ b/crypto/evp/evp_fetch.c
@@ -8,7 +8,7 @@
  */
 
 #include <stddef.h>
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 #include <openssl/evp.h>
 #include <openssl/core.h>
 #include "internal/cryptlib.h"
@@ -17,8 +17,8 @@
 #include "internal/core.h"
 #include "internal/provider.h"
 #include "internal/namemap.h"
-#include "internal/evp_int.h"    /* evp_locl.h needs it */
-#include "evp_locl.h"
+#include "crypto/evp.h"    /* evp_local.h needs it */
+#include "evp_local.h"
 
 static void default_method_store_free(void *vstore)
 {
diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c
index 4ec880fd13..6a3ad8553b 100644
--- a/crypto/evp/evp_lib.c
+++ b/crypto/evp/evp_lib.c
@@ -14,9 +14,9 @@
 #include <openssl/params.h>
 #include <openssl/core_names.h>
 #include <openssl/dh.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 #if !defined(FIPS_MODE)
 int EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_local.h
similarity index 99%
rename from crypto/evp/evp_locl.h
rename to crypto/evp/evp_local.h
index 116c8e6ce0..ec0f823bd5 100644
--- a/crypto/evp/evp_locl.h
+++ b/crypto/evp/evp_local.h
@@ -163,7 +163,7 @@ DEFINE_STACK_OF(EVP_PBE_CTL)
 
 int is_partially_overlapping(const void *ptr1, const void *ptr2, int len);
 
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 #include <openssl/core.h>
 
 void *evp_generic_fetch(OPENSSL_CTX *ctx, int operation_id,
diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c
index 8162a5e436..5ccb8214a3 100644
--- a/crypto/evp/evp_pbe.c
+++ b/crypto/evp/evp_pbe.c
@@ -12,8 +12,8 @@
 #include <openssl/evp.h>
 #include <openssl/pkcs12.h>
 #include <openssl/x509.h>
-#include "internal/evp_int.h"
-#include "evp_locl.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
 
 /* Password based encryption (PBE) functions */
 
diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c
index bffe2b3830..a11b856c03 100644
--- a/crypto/evp/evp_pkey.c
+++ b/crypto/evp/evp_pkey.c
@@ -12,9 +12,9 @@
 #include "internal/cryptlib.h"
 #include <openssl/x509.h>
 #include <openssl/rand.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
-#include "internal/x509_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
+#include "crypto/x509.h"
 
 /* Extract a private key from a PKCS8 structure */
 
diff --git a/crypto/evp/evp_utils.c b/crypto/evp/evp_utils.c
index 3da208a69f..77622616b3 100644
--- a/crypto/evp/evp_utils.c
+++ b/crypto/evp/evp_utils.c
@@ -12,10 +12,10 @@
 #include <openssl/core.h>
 #include <openssl/evp.h>
 #include <openssl/err.h>
-#include <openssl/asn1.h>        /* evp_locl.h needs it */
-#include <openssl/safestack.h>   /* evp_locl.h needs it */
-#include "internal/evp_int.h"    /* evp_locl.h needs it */
-#include "evp_locl.h"
+#include <openssl/asn1.h>        /* evp_local.h needs it */
+#include <openssl/safestack.h>   /* evp_local.h needs it */
+#include "crypto/evp.h"    /* evp_local.h needs it */
+#include "evp_local.h"
 
 /*
  * EVP_CTRL_RET_UNSUPPORTED = -1 is the returned value from any ctrl function
diff --git a/crypto/evp/exchange.c b/crypto/evp/exchange.c
index 53a25a424e..4c02c8a6a0 100644
--- a/crypto/evp/exchange.c
+++ b/crypto/evp/exchange.c
@@ -11,10 +11,10 @@
 #include <openssl/evp.h>
 #include <openssl/err.h>
 #include "internal/refcount.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
 #include "internal/numbers.h"   /* includes SIZE_MAX */
-#include "evp_locl.h"
+#include "evp_local.h"
 
 static EVP_KEYEXCH *evp_keyexch_new(OSSL_PROVIDER *prov)
 {
diff --git a/crypto/evp/kdf_lib.c b/crypto/evp/kdf_lib.c
index 5c57cc360e..7163de397f 100644
--- a/crypto/evp/kdf_lib.c
+++ b/crypto/evp/kdf_lib.c
@@ -17,11 +17,11 @@
 #include <openssl/kdf.h>
 #include <openssl/core.h>
 #include <openssl/core_names.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 #include "internal/numbers.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 EVP_KDF_CTX *EVP_KDF_CTX_new(EVP_KDF *kdf)
 {
diff --git a/crypto/evp/kdf_meth.c b/crypto/evp/kdf_meth.c
index 7bcdcc7df3..3a2d028153 100644
--- a/crypto/evp/kdf_meth.c
+++ b/crypto/evp/kdf_meth.c
@@ -12,9 +12,9 @@
 #include <openssl/core.h>
 #include <openssl/core_numbers.h>
 #include <openssl/kdf.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 static int evp_kdf_up_ref(void *vkdf)
 {
diff --git a/crypto/evp/keymgmt_lib.c b/crypto/evp/keymgmt_lib.c
index 8ee28fbe60..0eb12ca317 100644
--- a/crypto/evp/keymgmt_lib.c
+++ b/crypto/evp/keymgmt_lib.c
@@ -9,10 +9,10 @@
 
 #include "internal/cryptlib.h"
 #include "internal/nelem.h"
-#include "internal/evp_int.h"
-#include "internal/asn1_int.h"
+#include "crypto/evp.h"
+#include "crypto/asn1.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 static OSSL_PARAM *paramdefs_to_params(const OSSL_PARAM *paramdefs)
 {
diff --git a/crypto/evp/keymgmt_meth.c b/crypto/evp/keymgmt_meth.c
index c170bd676b..a5df564605 100644
--- a/crypto/evp/keymgmt_meth.c
+++ b/crypto/evp/keymgmt_meth.c
@@ -13,8 +13,8 @@
 #include <openssl/err.h>
 #include "internal/provider.h"
 #include "internal/refcount.h"
-#include "internal/evp_int.h"
-#include "evp_locl.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
 
 
 static void *keymgmt_new(void)
diff --git a/crypto/evp/m_md2.c b/crypto/evp/m_md2.c
index d7738472c8..a8a0af96aa 100644
--- a/crypto/evp/m_md2.c
+++ b/crypto/evp/m_md2.c
@@ -18,7 +18,7 @@
 # include <openssl/md2.h>
 # include <openssl/rsa.h>
 
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_md4.c b/crypto/evp/m_md4.c
index 1dc3cdee64..9638213de7 100644
--- a/crypto/evp/m_md4.c
+++ b/crypto/evp/m_md4.c
@@ -17,7 +17,7 @@
 # include <openssl/x509.h>
 # include <openssl/md4.h>
 # include <openssl/rsa.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_md5.c b/crypto/evp/m_md5.c
index 539ab76448..d817982488 100644
--- a/crypto/evp/m_md5.c
+++ b/crypto/evp/m_md5.c
@@ -17,7 +17,7 @@
 # include <openssl/x509.h>
 # include <openssl/md5.h>
 # include <openssl/rsa.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_md5_sha1.c b/crypto/evp/m_md5_sha1.c
index af8ae31ec1..e9ed800145 100644
--- a/crypto/evp/m_md5_sha1.c
+++ b/crypto/evp/m_md5_sha1.c
@@ -12,7 +12,7 @@
 # include <string.h>
 # include <openssl/evp.h>
 # include <openssl/obj_mac.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include "internal/md5_sha1.h"
 
 static int init(EVP_MD_CTX *ctx)
diff --git a/crypto/evp/m_mdc2.c b/crypto/evp/m_mdc2.c
index 145d9550f2..fdc689e115 100644
--- a/crypto/evp/m_mdc2.c
+++ b/crypto/evp/m_mdc2.c
@@ -17,7 +17,7 @@
 # include <openssl/x509.h>
 # include <openssl/mdc2.h>
 # include <openssl/rsa.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_null.c b/crypto/evp/m_null.c
index 5dcb250fe8..51c93c0dc4 100644
--- a/crypto/evp/m_null.c
+++ b/crypto/evp/m_null.c
@@ -12,7 +12,7 @@
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_ripemd.c b/crypto/evp/m_ripemd.c
index d821a58493..4e05d18ba6 100644
--- a/crypto/evp/m_ripemd.c
+++ b/crypto/evp/m_ripemd.c
@@ -17,7 +17,7 @@
 # include <openssl/objects.h>
 # include <openssl/x509.h>
 # include <openssl/rsa.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_sha1.c b/crypto/evp/m_sha1.c
index 1258ea03bc..421d302582 100644
--- a/crypto/evp/m_sha1.c
+++ b/crypto/evp/m_sha1.c
@@ -14,8 +14,8 @@
 #include <openssl/objects.h>
 #include <openssl/sha.h>
 #include <openssl/rsa.h>
-#include "internal/evp_int.h"
-#include "internal/sha.h"
+#include "crypto/evp.h"
+#include "crypto/sha.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_sha3.c b/crypto/evp/m_sha3.c
index 1e71eed948..a4a556d98d 100644
--- a/crypto/evp/m_sha3.c
+++ b/crypto/evp/m_sha3.c
@@ -12,9 +12,9 @@
 
 #include <openssl/evp.h>
 #include <openssl/objects.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/sha3.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/m_sigver.c b/crypto/evp/m_sigver.c
index 987b35b7fe..2e179bee27 100644
--- a/crypto/evp/m_sigver.c
+++ b/crypto/evp/m_sigver.c
@@ -12,8 +12,8 @@
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
-#include "internal/evp_int.h"
-#include "evp_locl.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
 
 static int update(EVP_MD_CTX *ctx, const void *data, size_t datalen)
 {
diff --git a/crypto/evp/m_wp.c b/crypto/evp/m_wp.c
index 10c07ff551..ee69df5658 100644
--- a/crypto/evp/m_wp.c
+++ b/crypto/evp/m_wp.c
@@ -16,7 +16,7 @@
 # include <openssl/objects.h>
 # include <openssl/x509.h>
 # include <openssl/whrlpool.h>
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/evp/mac_lib.c b/crypto/evp/mac_lib.c
index cf704ba4fc..8b8c9a5067 100644
--- a/crypto/evp/mac_lib.c
+++ b/crypto/evp/mac_lib.c
@@ -13,11 +13,11 @@
 #include <openssl/err.h>
 #include <openssl/core.h>
 #include <openssl/core_names.h>
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 #include "internal/nelem.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 EVP_MAC_CTX *EVP_MAC_CTX_new(EVP_MAC *mac)
 {
diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c
index 8c47a6c6e8..c01f04ef76 100644
--- a/crypto/evp/mac_meth.c
+++ b/crypto/evp/mac_meth.c
@@ -2,9 +2,9 @@
 #include <openssl/err.h>
 #include <openssl/core.h>
 #include <openssl/core_numbers.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 static int evp_mac_up_ref(void *vmac)
 {
diff --git a/crypto/evp/names.c b/crypto/evp/names.c
index 7c2f4f061c..901899ad3b 100644
--- a/crypto/evp/names.c
+++ b/crypto/evp/names.c
@@ -11,9 +11,9 @@
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/kdf.h>
-#include "internal/objects.h"
+#include "crypto/objects.h"
 #include <openssl/x509.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 int EVP_add_cipher(const EVP_CIPHER *c)
 {
diff --git a/crypto/evp/p5_crpt2.c b/crypto/evp/p5_crpt2.c
index 96a72730f3..2a27f53047 100644
--- a/crypto/evp/p5_crpt2.c
+++ b/crypto/evp/p5_crpt2.c
@@ -16,8 +16,8 @@
 #include <openssl/hmac.h>
 #include <openssl/trace.h>
 #include <openssl/core_names.h>
-#include "internal/evp_int.h"
-#include "evp_locl.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
 
 int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
                       const unsigned char *salt, int saltlen, int iter,
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index 83cf12fff3..e2c6eaa17f 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -23,8 +23,8 @@
 #include <openssl/params.h>
 #include <openssl/core_names.h>
 
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
 
 static void EVP_PKEY_free_it(EVP_PKEY *x);
diff --git a/crypto/evp/p_sign.c b/crypto/evp/p_sign.c
index c1b0d3acda..44a69083b2 100644
--- a/crypto/evp/p_sign.c
+++ b/crypto/evp/p_sign.c
@@ -12,7 +12,7 @@
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,
                   unsigned int *siglen, EVP_PKEY *pkey)
diff --git a/crypto/evp/p_verify.c b/crypto/evp/p_verify.c
index 956b089572..fe4b7b568d 100644
--- a/crypto/evp/p_verify.c
+++ b/crypto/evp/p_verify.c
@@ -12,7 +12,7 @@
 #include <openssl/evp.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
                     unsigned int siglen, EVP_PKEY *pkey)
diff --git a/crypto/evp/pkey_kdf.c b/crypto/evp/pkey_kdf.c
index 98bf5c6660..d57ff6fd47 100644
--- a/crypto/evp/pkey_kdf.c
+++ b/crypto/evp/pkey_kdf.c
@@ -17,7 +17,7 @@
 #include <openssl/core_names.h>
 #include <openssl/params.h>
 #include "internal/numbers.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 #define MAX_PARAM   20
 
diff --git a/crypto/evp/pkey_mac.c b/crypto/evp/pkey_mac.c
index 9853e09cf1..005741dd15 100644
--- a/crypto/evp/pkey_mac.c
+++ b/crypto/evp/pkey_mac.c
@@ -13,8 +13,8 @@
 #include <openssl/engine.h>
 #include <openssl/params.h>
 #include <openssl/core_names.h>
-#include "internal/evp_int.h"
-#include "evp_locl.h"
+#include "crypto/evp.h"
+#include "evp_local.h"
 
 /* MAC PKEY context structure */
 
diff --git a/crypto/evp/pmeth_fn.c b/crypto/evp/pmeth_fn.c
index 34db48639a..e3af13ddf8 100644
--- a/crypto/evp/pmeth_fn.c
+++ b/crypto/evp/pmeth_fn.c
@@ -12,9 +12,9 @@
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include "internal/cryptlib.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 static EVP_SIGNATURE *evp_signature_new(OSSL_PROVIDER *prov)
 {
diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c
index c81f5a1a3f..2564bbd03e 100644
--- a/crypto/evp/pmeth_gn.c
+++ b/crypto/evp/pmeth_gn.c
@@ -12,9 +12,9 @@
 #include "internal/cryptlib.h"
 #include <openssl/objects.h>
 #include <openssl/evp.h>
-#include "internal/bn_int.h"
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/bn.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx)
 {
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c
index 8b386cf19f..7dbdb460e3 100644
--- a/crypto/evp/pmeth_lib.c
+++ b/crypto/evp/pmeth_lib.c
@@ -16,11 +16,11 @@
 #include <openssl/core_names.h>
 #include <openssl/dh.h>
 #include "internal/cryptlib.h"
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 #include "internal/numbers.h"
 #include "internal/provider.h"
-#include "evp_locl.h"
+#include "evp_local.h"
 
 typedef const EVP_PKEY_METHOD *(*pmeth_fn)(void);
 typedef int sk_cmp_fn_type(const char *const *a, const char *const *b);
diff --git a/crypto/ex_data.c b/crypto/ex_data.c
index cd8e695855..9f08606d2f 100644
--- a/crypto/ex_data.c
+++ b/crypto/ex_data.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include "internal/thread_once.h"
 
 int do_ex_data_init(OPENSSL_CTX *ctx)
diff --git a/crypto/hmac/hm_ameth.c b/crypto/hmac/hm_ameth.c
index f0a5bc9a01..9ecb786106 100644
--- a/crypto/hmac/hm_ameth.c
+++ b/crypto/hmac/hm_ameth.c
@@ -10,8 +10,8 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 /*
  * HMAC "ASN1" method. This is just here to indicate the maximum HMAC output
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index d392753c49..17cc58717b 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -13,7 +13,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/hmac.h>
 #include <openssl/opensslconf.h>
-#include "hmac_lcl.h"
+#include "hmac_local.h"
 
 int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
                  const EVP_MD *md, ENGINE *impl)
diff --git a/crypto/hmac/hmac_lcl.h b/crypto/hmac/hmac_local.h
similarity index 90%
rename from crypto/hmac/hmac_lcl.h
rename to crypto/hmac/hmac_local.h
index 4d8ef6f690..788721ef1f 100644
--- a/crypto/hmac/hmac_lcl.h
+++ b/crypto/hmac/hmac_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_HMAC_LCL_H
-# define HEADER_HMAC_LCL_H
+#ifndef OSSL_CRYPTO_HMAC_LOCAL_H
+# define OSSL_CRYPTO_HMAC_LOCAL_H
 
 /* The current largest case is for SHA3-224 */
 #define HMAC_MAX_MD_CBLOCK_SIZE     144
diff --git a/crypto/idea/i_cbc.c b/crypto/idea/i_cbc.c
index b6d236c4ab..a78841fcfc 100644
--- a/crypto/idea/i_cbc.c
+++ b/crypto/idea/i_cbc.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/idea.h>
-#include "idea_lcl.h"
+#include "idea_local.h"
 
 void IDEA_cbc_encrypt(const unsigned char *in, unsigned char *out,
                       long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
diff --git a/crypto/idea/i_cfb64.c b/crypto/idea/i_cfb64.c
index 3b867127a8..45c15b9474 100644
--- a/crypto/idea/i_cfb64.c
+++ b/crypto/idea/i_cfb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/idea.h>
-#include "idea_lcl.h"
+#include "idea_local.h"
 
 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/crypto/idea/i_ecb.c b/crypto/idea/i_ecb.c
index 4a721a28df..9fee121893 100644
--- a/crypto/idea/i_ecb.c
+++ b/crypto/idea/i_ecb.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/idea.h>
-#include "idea_lcl.h"
+#include "idea_local.h"
 #include <openssl/opensslv.h>
 
 const char *IDEA_options(void)
diff --git a/crypto/idea/i_ofb64.c b/crypto/idea/i_ofb64.c
index 6c5532158f..517ded7bd6 100644
--- a/crypto/idea/i_ofb64.c
+++ b/crypto/idea/i_ofb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/idea.h>
-#include "idea_lcl.h"
+#include "idea_local.h"
 
 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/crypto/idea/i_skey.c b/crypto/idea/i_skey.c
index a0197bf79c..0b0221bd81 100644
--- a/crypto/idea/i_skey.c
+++ b/crypto/idea/i_skey.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/idea.h>
-#include "idea_lcl.h"
+#include "idea_local.h"
 
 static IDEA_INT inverse(unsigned int xin);
 void IDEA_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks)
diff --git a/crypto/idea/idea_lcl.h b/crypto/idea/idea_local.h
similarity index 100%
rename from crypto/idea/idea_lcl.h
rename to crypto/idea/idea_local.h
diff --git a/crypto/include/internal/store.h b/crypto/include/internal/store.h
deleted file mode 100644
index b2e9dbffbe..0000000000
--- a/crypto/include/internal/store.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
- * Copyright 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
- */
-
-void ossl_store_cleanup_int(void);
diff --git a/crypto/info.c b/crypto/info.c
index 355827c451..613ddc7d8c 100644
--- a/crypto/info.c
+++ b/crypto/info.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/crypto.h>
-#include "internal/dso_conf.h"
+#include "crypto/dso_conf.h"
 #include "internal/thread_once.h"
 #include "internal/cryptlib.h"
 #include "e_os.h"
diff --git a/crypto/init.c b/crypto/init.c
index 32162c3874..4aa3fc83da 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -8,25 +8,25 @@
  */
 
 #include "e_os.h"
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include <openssl/err.h>
-#include "internal/rand_int.h"
+#include "crypto/rand.h"
 #include "internal/bio.h"
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/conf.h"
-#include "internal/async.h"
-#include "internal/engine.h"
+#include "crypto/async.h"
+#include "crypto/engine.h"
 #include "internal/comp.h"
 #include "internal/err.h"
-#include "internal/err_int.h"
-#include "internal/objects.h"
+#include "crypto/err.h"
+#include "crypto/objects.h"
 #include <stdlib.h>
 #include <assert.h>
 #include "internal/thread_once.h"
-#include "internal/dso_conf.h"
+#include "crypto/dso_conf.h"
 #include "internal/dso.h"
-#include "internal/store.h"
+#include "crypto/store.h"
 #include <openssl/cmp_util.h> /* for OSSL_CMP_log_close() */
 #include <openssl/trace.h>
 
diff --git a/crypto/initthread.c b/crypto/initthread.c
index 7de8a36945..930b94a817 100644
--- a/crypto/initthread.c
+++ b/crypto/initthread.c
@@ -9,7 +9,7 @@
 
 #include <openssl/crypto.h>
 #include <openssl/core_numbers.h>
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include "internal/providercommon.h"
 #include "internal/thread_once.h"
 
diff --git a/crypto/lhash/lh_stats.c b/crypto/lhash/lh_stats.c
index 1b32b5db5b..5e38c42580 100644
--- a/crypto/lhash/lh_stats.c
+++ b/crypto/lhash/lh_stats.c
@@ -18,7 +18,7 @@
 
 #include <openssl/bio.h>
 #include <openssl/lhash.h>
-#include "lhash_lcl.h"
+#include "lhash_local.h"
 
 # ifndef OPENSSL_NO_STDIO
 void OPENSSL_LH_stats(const OPENSSL_LHASH *lh, FILE *fp)
diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c
index f91a56a70a..76379a93f6 100644
--- a/crypto/lhash/lhash.c
+++ b/crypto/lhash/lhash.c
@@ -13,9 +13,9 @@
 #include <openssl/crypto.h>
 #include <openssl/lhash.h>
 #include <openssl/err.h>
-#include "internal/ctype.h"
-#include "internal/lhash.h"
-#include "lhash_lcl.h"
+#include "crypto/ctype.h"
+#include "crypto/lhash.h"
+#include "lhash_local.h"
 
 /*
  * A hashing implementation that appears to be based on the linear hashing
diff --git a/crypto/lhash/lhash_lcl.h b/crypto/lhash/lhash_local.h
similarity index 100%
rename from crypto/lhash/lhash_lcl.h
rename to crypto/lhash/lhash_local.h
diff --git a/crypto/md4/md4_dgst.c b/crypto/md4/md4_dgst.c
index 2ce66b6e93..cf95fbe622 100644
--- a/crypto/md4/md4_dgst.c
+++ b/crypto/md4/md4_dgst.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <openssl/opensslv.h>
-#include "md4_locl.h"
+#include "md4_local.h"
 
 /*
  * Implemented from RFC1186 The MD4 Message-Digest Algorithm
@@ -39,7 +39,7 @@ void md4_block_data_order(MD4_CTX *c, const void *data_, size_t num)
     const unsigned char *data = data_;
     register unsigned MD32_REG_T A, B, C, D, l;
 # ifndef MD32_XARRAY
-    /* See comment in crypto/sha/sha_locl.h for details. */
+    /* See comment in crypto/sha/sha_local.h for details. */
     unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
         XX8, XX9, XX10, XX11, XX12, XX13, XX14, XX15;
 #  define X(i)   XX##i
diff --git a/crypto/md4/md4_locl.h b/crypto/md4/md4_local.h
similarity index 98%
rename from crypto/md4/md4_locl.h
rename to crypto/md4/md4_local.h
index 74e53507a6..58c23e1ad6 100644
--- a/crypto/md4/md4_locl.h
+++ b/crypto/md4/md4_local.h
@@ -31,7 +31,7 @@ void md4_block_data_order(MD4_CTX *c, const void *p, size_t num);
         } while (0)
 #define HASH_BLOCK_DATA_ORDER   md4_block_data_order
 
-#include "internal/md32_common.h"
+#include "crypto/md32_common.h"
 
 /*-
 #define F(x,y,z)        (((x) & (y))  |  ((~(x)) & (z)))
diff --git a/crypto/md5/md5_dgst.c b/crypto/md5/md5_dgst.c
index 1c673e349e..b594652f0d 100644
--- a/crypto/md5/md5_dgst.c
+++ b/crypto/md5/md5_dgst.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "md5_locl.h"
+#include "md5_local.h"
 #include <openssl/opensslv.h>
 
 /*
@@ -39,7 +39,7 @@ void md5_block_data_order(MD5_CTX *c, const void *data_, size_t num)
     const unsigned char *data = data_;
     register unsigned MD32_REG_T A, B, C, D, l;
 # ifndef MD32_XARRAY
-    /* See comment in crypto/sha/sha_locl.h for details. */
+    /* See comment in crypto/sha/sha_local.h for details. */
     unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
         XX8, XX9, XX10, XX11, XX12, XX13, XX14, XX15;
 #  define X(i)   XX##i
diff --git a/crypto/md5/md5_locl.h b/crypto/md5/md5_local.h
similarity index 98%
rename from crypto/md5/md5_locl.h
rename to crypto/md5/md5_local.h
index 73ba4d6ccd..8571e4848e 100644
--- a/crypto/md5/md5_locl.h
+++ b/crypto/md5/md5_local.h
@@ -42,7 +42,7 @@ void md5_block_data_order(MD5_CTX *c, const void *p, size_t num);
         } while (0)
 #define HASH_BLOCK_DATA_ORDER   md5_block_data_order
 
-#include "internal/md32_common.h"
+#include "crypto/md32_common.h"
 
 /*-
 #define F(x,y,z)        (((x) & (y))  |  ((~(x)) & (z)))
diff --git a/crypto/mem.c b/crypto/mem.c
index 562d6b51e2..d3cac29b21 100644
--- a/crypto/mem.c
+++ b/crypto/mem.c
@@ -9,7 +9,7 @@
 
 #include "e_os.h"
 #include "internal/cryptlib.h"
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
diff --git a/crypto/mips_arch.h b/crypto/mips_arch.h
index df4ff7aeba..12a27615f1 100644
--- a/crypto/mips_arch.h
+++ b/crypto/mips_arch.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef __MIPS_ARCH_H__
-# define __MIPS_ARCH_H__
+#ifndef OSSL_CRYPTO_MIPS_ARCH_H
+# define OSSL_CRYPTO_MIPS_ARCH_H
 
 # if (defined(__mips_smartmips) || defined(_MIPS_ARCH_MIPS32R3) || \
       defined(_MIPS_ARCH_MIPS32R5) || defined(_MIPS_ARCH_MIPS32R6)) \
diff --git a/crypto/modes/cbc128.c b/crypto/modes/cbc128.c
index eb8e06c11d..eec44bd91a 100644
--- a/crypto/modes/cbc128.c
+++ b/crypto/modes/cbc128.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/crypto.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 #if !defined(STRICT_ALIGNMENT) && !defined(PEDANTIC)
 # define STRICT_ALIGNMENT 0
diff --git a/crypto/modes/ccm128.c b/crypto/modes/ccm128.c
index e97158a119..1ffd6df46f 100644
--- a/crypto/modes/ccm128.c
+++ b/crypto/modes/ccm128.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/crypto.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 /*
  * First you setup M and L parameters and pass the key schedule. This is
diff --git a/crypto/modes/cfb128.c b/crypto/modes/cfb128.c
index 39644a237e..e9ce4df3a5 100644
--- a/crypto/modes/cfb128.c
+++ b/crypto/modes/cfb128.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/crypto.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 /*
  * The input and output encrypted as though 128bit cfb mode is being used.
diff --git a/crypto/modes/ctr128.c b/crypto/modes/ctr128.c
index 1755b8500e..ff7499b34a 100644
--- a/crypto/modes/ctr128.c
+++ b/crypto/modes/ctr128.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/crypto.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 /*
  * NOTE: the IV/counter CTR mode is big-endian.  The code itself is
diff --git a/crypto/modes/cts128.c b/crypto/modes/cts128.c
index b4f2f37775..5600d9c54b 100644
--- a/crypto/modes/cts128.c
+++ b/crypto/modes/cts128.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/crypto.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 /*
  * Trouble with Ciphertext Stealing, CTS, mode is that there is no
diff --git a/crypto/modes/gcm128.c b/crypto/modes/gcm128.c
index f37653be67..d2f2da61b3 100644
--- a/crypto/modes/gcm128.c
+++ b/crypto/modes/gcm128.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 #if defined(BSWAP4) && defined(STRICT_ALIGNMENT)
 /* redefine, because alignment is ensured */
diff --git a/crypto/modes/ocb128.c b/crypto/modes/ocb128.c
index 9e7af6074f..7886700533 100644
--- a/crypto/modes/ocb128.c
+++ b/crypto/modes/ocb128.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/err.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 #ifndef OPENSSL_NO_OCB
 
diff --git a/crypto/modes/ofb128.c b/crypto/modes/ofb128.c
index b894cbb5c1..2eca09bc1b 100644
--- a/crypto/modes/ofb128.c
+++ b/crypto/modes/ofb128.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/crypto.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 /*
  * The input and output encrypted as though 128bit ofb mode is being used.
diff --git a/crypto/modes/siv128.c b/crypto/modes/siv128.c
index 1d91ee78ee..712141032d 100644
--- a/crypto/modes/siv128.c
+++ b/crypto/modes/siv128.c
@@ -13,8 +13,8 @@
 #include <openssl/evp.h>
 #include <openssl/core_names.h>
 #include <openssl/params.h>
-#include "internal/modes_int.h"
-#include "internal/siv_int.h"
+#include "crypto/modes.h"
+#include "crypto/siv.h"
 
 #ifndef OPENSSL_NO_SIV
 
diff --git a/crypto/modes/xts128.c b/crypto/modes/xts128.c
index 03b83aa0ed..9d9b65caa5 100644
--- a/crypto/modes/xts128.c
+++ b/crypto/modes/xts128.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include <openssl/crypto.h>
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 
 int CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,
                           const unsigned char iv[16],
diff --git a/crypto/objects/o_names.c b/crypto/objects/o_names.c
index 3ad905c939..52956ebcd5 100644
--- a/crypto/objects/o_names.c
+++ b/crypto/objects/o_names.c
@@ -17,8 +17,8 @@
 #include <openssl/safestack.h>
 #include <openssl/e_os2.h>
 #include "internal/thread_once.h"
-#include "internal/lhash.h"
-#include "obj_lcl.h"
+#include "crypto/lhash.h"
+#include "obj_local.h"
 #include "e_os.h"
 
 /*
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
index c4155a3dfc..0c4ec985cb 100644
--- a/crypto/objects/obj_dat.c
+++ b/crypto/objects/obj_dat.c
@@ -8,15 +8,15 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <limits.h>
 #include "internal/cryptlib.h"
 #include <openssl/lhash.h>
 #include <openssl/asn1.h>
-#include "internal/objects.h"
+#include "crypto/objects.h"
 #include <openssl/bn.h>
-#include "internal/asn1_int.h"
-#include "obj_lcl.h"
+#include "crypto/asn1.h"
+#include "obj_local.h"
 
 /* obj_dat.h is generated from objects.h by obj_dat.pl */
 #include "obj_dat.h"
diff --git a/crypto/objects/obj_lib.c b/crypto/objects/obj_lib.c
index 5dfe7c5b95..08266141e2 100644
--- a/crypto/objects/obj_lib.c
+++ b/crypto/objects/obj_lib.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 
 ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
 {
diff --git a/crypto/objects/obj_lcl.h b/crypto/objects/obj_local.h
similarity index 100%
rename from crypto/objects/obj_lcl.h
rename to crypto/objects/obj_local.h
diff --git a/crypto/ocsp/ocsp_asn.c b/crypto/ocsp/ocsp_asn.c
index 04752e9607..4b4342825c 100644
--- a/crypto/ocsp/ocsp_asn.c
+++ b/crypto/ocsp/ocsp_asn.c
@@ -10,7 +10,7 @@
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/ocsp.h>
-#include "ocsp_lcl.h"
+#include "ocsp_local.h"
 
 ASN1_SEQUENCE(OCSP_SIGNATURE) = {
         ASN1_EMBED(OCSP_SIGNATURE, signatureAlgorithm, X509_ALGOR),
diff --git a/crypto/ocsp/ocsp_cl.c b/crypto/ocsp/ocsp_cl.c
index 4ce7f0355d..8bd55038f2 100644
--- a/crypto/ocsp/ocsp_cl.c
+++ b/crypto/ocsp/ocsp_cl.c
@@ -16,7 +16,7 @@
 #include <openssl/pem.h>
 #include <openssl/x509v3.h>
 #include <openssl/ocsp.h>
-#include "ocsp_lcl.h"
+#include "ocsp_local.h"
 
 /*
  * Utility functions related to sending OCSP requests and extracting relevant
diff --git a/crypto/ocsp/ocsp_ext.c b/crypto/ocsp/ocsp_ext.c
index c5cf279170..bffcf09ddd 100644
--- a/crypto/ocsp/ocsp_ext.c
+++ b/crypto/ocsp/ocsp_ext.c
@@ -12,7 +12,7 @@
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/ocsp.h>
-#include "ocsp_lcl.h"
+#include "ocsp_local.h"
 #include <openssl/rand.h>
 #include <openssl/x509v3.h>
 
diff --git a/crypto/ocsp/ocsp_ht.c b/crypto/ocsp/ocsp_ht.c
index 17f792c2b1..c75bfdb403 100644
--- a/crypto/ocsp/ocsp_ht.c
+++ b/crypto/ocsp/ocsp_ht.c
@@ -10,7 +10,7 @@
 #include "e_os.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <string.h>
 #include <openssl/asn1.h>
 #include <openssl/ocsp.h>
diff --git a/crypto/ocsp/ocsp_lib.c b/crypto/ocsp/ocsp_lib.c
index e68513e101..90a92b9e60 100644
--- a/crypto/ocsp/ocsp_lib.c
+++ b/crypto/ocsp/ocsp_lib.c
@@ -14,7 +14,7 @@
 #include <openssl/pem.h>
 #include <openssl/x509v3.h>
 #include <openssl/ocsp.h>
-#include "ocsp_lcl.h"
+#include "ocsp_local.h"
 #include <openssl/asn1t.h>
 
 /* Convert a certificate and its issuer to an OCSP_CERTID */
diff --git a/crypto/ocsp/ocsp_lcl.h b/crypto/ocsp/ocsp_local.h
similarity index 100%
rename from crypto/ocsp/ocsp_lcl.h
rename to crypto/ocsp/ocsp_local.h
diff --git a/crypto/ocsp/ocsp_prn.c b/crypto/ocsp/ocsp_prn.c
index 73764acb97..6d527dfcc8 100644
--- a/crypto/ocsp/ocsp_prn.c
+++ b/crypto/ocsp/ocsp_prn.c
@@ -10,7 +10,7 @@
 #include <openssl/bio.h>
 #include <openssl/err.h>
 #include <openssl/ocsp.h>
-#include "ocsp_lcl.h"
+#include "ocsp_local.h"
 #include "internal/cryptlib.h"
 #include <openssl/pem.h>
 
diff --git a/crypto/ocsp/ocsp_srv.c b/crypto/ocsp/ocsp_srv.c
index 20a1b2c28e..7e0aca169b 100644
--- a/crypto/ocsp/ocsp_srv.c
+++ b/crypto/ocsp/ocsp_srv.c
@@ -14,7 +14,7 @@
 #include <openssl/pem.h>
 #include <openssl/x509v3.h>
 #include <openssl/ocsp.h>
-#include "ocsp_lcl.h"
+#include "ocsp_local.h"
 
 /*
  * Utility functions related to sending OCSP responses and extracting
diff --git a/crypto/ocsp/ocsp_vfy.c b/crypto/ocsp/ocsp_vfy.c
index 4e6c378ec4..a364c8a241 100644
--- a/crypto/ocsp/ocsp_vfy.c
+++ b/crypto/ocsp/ocsp_vfy.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/ocsp.h>
-#include "ocsp_lcl.h"
+#include "ocsp_local.h"
 #include <openssl/err.h>
 #include <string.h>
 
diff --git a/crypto/ocsp/v3_ocsp.c b/crypto/ocsp/v3_ocsp.c
index 2e4503ee4d..9648ba9412 100644
--- a/crypto/ocsp/v3_ocsp.c
+++ b/crypto/ocsp/v3_ocsp.c
@@ -12,7 +12,7 @@
 # include <openssl/conf.h>
 # include <openssl/asn1.h>
 # include <openssl/ocsp.h>
-# include "ocsp_lcl.h"
+# include "ocsp_local.h"
 # include <openssl/x509v3.h>
 # include "../x509/ext_dat.h"
 
diff --git a/crypto/pem/pem_lib.c b/crypto/pem/pem_lib.c
index b33ab16266..eb07c884e7 100644
--- a/crypto/pem/pem_lib.c
+++ b/crypto/pem/pem_lib.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <string.h>
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
@@ -18,7 +18,7 @@
 #include <openssl/x509.h>
 #include <openssl/pem.h>
 #include <openssl/pkcs12.h>
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 #include <openssl/des.h>
 #include <openssl/engine.h>
 
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c
index ffcec12771..54596e4093 100644
--- a/crypto/pem/pem_pkey.c
+++ b/crypto/pem/pem_pkey.c
@@ -17,8 +17,8 @@
 #include <openssl/pem.h>
 #include <openssl/engine.h>
 #include <openssl/dh.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 int pem_check_suffix(const char *pem_str, const char *suffix);
 
diff --git a/crypto/pkcs12/p12_add.c b/crypto/pkcs12/p12_add.c
index 1f915d13d9..f23bfed853 100644
--- a/crypto/pkcs12/p12_add.c
+++ b/crypto/pkcs12/p12_add.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 /* Pack an object into an OCTET STRING and turn into a safebag */
 
diff --git a/crypto/pkcs12/p12_asn.c b/crypto/pkcs12/p12_asn.c
index f27d1d4407..aabbd38eef 100644
--- a/crypto/pkcs12/p12_asn.c
+++ b/crypto/pkcs12/p12_asn.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 /* PKCS#12 ASN1 module */
 
diff --git a/crypto/pkcs12/p12_attr.c b/crypto/pkcs12/p12_attr.c
index 2ee65a9855..e2ca95bcfa 100644
--- a/crypto/pkcs12/p12_attr.c
+++ b/crypto/pkcs12/p12_attr.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 /* Add a local keyid to a safebag */
 
diff --git a/crypto/pkcs12/p12_crt.c b/crypto/pkcs12/p12_crt.c
index b6e52e23db..063a5bb010 100644
--- a/crypto/pkcs12/p12_crt.c
+++ b/crypto/pkcs12/p12_crt.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 static int pkcs12_add_bag(STACK_OF(PKCS12_SAFEBAG) **pbags,
                           PKCS12_SAFEBAG *bag);
diff --git a/crypto/pkcs12/p12_init.c b/crypto/pkcs12/p12_init.c
index 8b684c272e..00c8d4f5d4 100644
--- a/crypto/pkcs12/p12_init.c
+++ b/crypto/pkcs12/p12_init.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 /* Initialise a PKCS12 structure to take data */
 
diff --git a/crypto/pkcs12/p12_lcl.h b/crypto/pkcs12/p12_local.h
similarity index 100%
rename from crypto/pkcs12/p12_lcl.h
rename to crypto/pkcs12/p12_local.h
diff --git a/crypto/pkcs12/p12_mutl.c b/crypto/pkcs12/p12_mutl.c
index bcefa05712..6998d32dcb 100644
--- a/crypto/pkcs12/p12_mutl.c
+++ b/crypto/pkcs12/p12_mutl.c
@@ -13,7 +13,7 @@
 #include <openssl/hmac.h>
 #include <openssl/rand.h>
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 int PKCS12_mac_present(const PKCS12 *p12)
 {
diff --git a/crypto/pkcs12/p12_npas.c b/crypto/pkcs12/p12_npas.c
index 2bb69a267e..eece1dd8f7 100644
--- a/crypto/pkcs12/p12_npas.c
+++ b/crypto/pkcs12/p12_npas.c
@@ -13,7 +13,7 @@
 #include <openssl/pem.h>
 #include <openssl/err.h>
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 /* PKCS#12 password change routine */
 
diff --git a/crypto/pkcs12/p12_p8e.c b/crypto/pkcs12/p12_p8e.c
index 3b7a8436ed..b9b34c2495 100644
--- a/crypto/pkcs12/p12_p8e.c
+++ b/crypto/pkcs12/p12_p8e.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/pkcs12.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,
                         const char *pass, int passlen,
diff --git a/crypto/pkcs12/p12_sbag.c b/crypto/pkcs12/p12_sbag.c
index a3024ef1b9..2b4ca65399 100644
--- a/crypto/pkcs12/p12_sbag.c
+++ b/crypto/pkcs12/p12_sbag.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/pkcs12.h>
-#include "p12_lcl.h"
+#include "p12_local.h"
 
 #if !OPENSSL_API_1_1_0
 ASN1_TYPE *PKCS12_get_attr(const PKCS12_SAFEBAG *bag, int attr_nid)
diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c
index 181fb5a5a1..815ac8683a 100644
--- a/crypto/pkcs7/pk7_lib.c
+++ b/crypto/pkcs7/pk7_lib.c
@@ -11,8 +11,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/objects.h>
 #include <openssl/x509.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
 
 long PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg)
 {
diff --git a/crypto/poly1305/poly1305.c b/crypto/poly1305/poly1305.c
index b83a4fc1ca..97c0530500 100644
--- a/crypto/poly1305/poly1305.c
+++ b/crypto/poly1305/poly1305.c
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 
-#include "internal/poly1305.h"
+#include "crypto/poly1305.h"
 #include "poly1305_local.h"
 
 size_t Poly1305_ctx_size(void)
@@ -89,7 +89,7 @@ static void
 poly1305_blocks(void *ctx, const unsigned char *inp, size_t len, u32 padbit);
 
 /*
- * Type-agnostic "rip-off" from constant_time_locl.h
+ * Type-agnostic "rip-off" from constant_time.h
  */
 # define CONSTANT_TIME_CARRY(a,b) ( \
          (a ^ ((a ^ b) | ((a - b) ^ b))) >> (sizeof(a) * 8 - 1) \
diff --git a/crypto/poly1305/poly1305_ameth.c b/crypto/poly1305/poly1305_ameth.c
index 73903635ea..d69607c7bb 100644
--- a/crypto/poly1305/poly1305_ameth.c
+++ b/crypto/poly1305/poly1305_ameth.c
@@ -10,10 +10,10 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
-#include "internal/asn1_int.h"
-#include "internal/poly1305.h"
+#include "crypto/asn1.h"
+#include "crypto/poly1305.h"
 #include "poly1305_local.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 /*
  * POLY1305 "ASN1" method. This is just here to indicate the maximum
diff --git a/crypto/ppc_arch.h b/crypto/ppc_arch.h
index ce98f5b757..0241878ea7 100644
--- a/crypto/ppc_arch.h
+++ b/crypto/ppc_arch.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PPC_ARCH_H
-# define HEADER_PPC_ARCH_H
+#ifndef OSSL_CRYPTO_PPC_ARCH_H
+# define OSSL_CRYPTO_PPC_ARCH_H
 
 extern unsigned int OPENSSL_ppccap_P;
 
diff --git a/crypto/ppccap.c b/crypto/ppccap.c
index e540db1441..0b2cc78d08 100644
--- a/crypto/ppccap.c
+++ b/crypto/ppccap.c
@@ -29,8 +29,8 @@
 #include <openssl/crypto.h>
 #include <openssl/bn.h>
 #include <internal/cryptlib.h>
-#include <internal/chacha.h>
-#include "bn/bn_lcl.h"
+#include <crypto/chacha.h>
+#include "bn/bn_local.h"
 
 #include "ppc_arch.h"
 
diff --git a/crypto/property/defn_cache.c b/crypto/property/defn_cache.c
index aec05c1ae3..9bfbd13144 100644
--- a/crypto/property/defn_cache.c
+++ b/crypto/property/defn_cache.c
@@ -13,7 +13,7 @@
 #include <openssl/lhash.h>
 #include "internal/propertyerr.h"
 #include "internal/property.h"
-#include "property_lcl.h"
+#include "property_local.h"
 
 /*
  * Implement a property definition cache.
diff --git a/crypto/property/property.c b/crypto/property/property.c
index e94c5de87d..0111216057 100644
--- a/crypto/property/property.c
+++ b/crypto/property/property.c
@@ -13,13 +13,13 @@
 #include <stdarg.h>
 #include <openssl/crypto.h>
 #include "internal/property.h"
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <openssl/lhash.h>
 #include <openssl/rand.h>
 #include "internal/thread_once.h"
-#include "internal/lhash.h"
-#include "internal/sparse_array.h"
-#include "property_lcl.h"
+#include "crypto/lhash.h"
+#include "crypto/sparse_array.h"
+#include "property_local.h"
 
 /* The number of elements in the query cache before we initiate a flush */
 #define IMPL_CACHE_FLUSH_THRESHOLD  500
diff --git a/crypto/property/property_lcl.h b/crypto/property/property_local.h
similarity index 100%
rename from crypto/property/property_lcl.h
rename to crypto/property/property_local.h
diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c
index c17b0ddefc..a16bcd6dba 100644
--- a/crypto/property/property_parse.c
+++ b/crypto/property/property_parse.c
@@ -14,9 +14,9 @@
 #include <openssl/err.h>
 #include "internal/propertyerr.h"
 #include "internal/property.h"
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/nelem.h"
-#include "property_lcl.h"
+#include "property_local.h"
 #include "e_os.h"
 
 typedef enum {
diff --git a/crypto/property/property_string.c b/crypto/property/property_string.c
index dcf5dcc2a4..55d34688db 100644
--- a/crypto/property/property_string.c
+++ b/crypto/property/property_string.c
@@ -11,8 +11,8 @@
 #include <string.h>
 #include <openssl/crypto.h>
 #include <openssl/lhash.h>
-#include "internal/lhash.h"
-#include "property_lcl.h"
+#include "crypto/lhash.h"
+#include "property_local.h"
 
 /*
  * Property strings are a consolidation of all strings seen by the property
diff --git a/crypto/provider_core.c b/crypto/provider_core.c
index f8a002aa16..4f3123d672 100644
--- a/crypto/provider_core.c
+++ b/crypto/provider_core.c
@@ -12,7 +12,7 @@
 #include <openssl/core_names.h>
 #include <openssl/params.h>
 #include <openssl/opensslv.h>
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 #include "internal/nelem.h"
 #include "internal/thread_once.h"
 #include "internal/provider.h"
diff --git a/crypto/rand/drbg_ctr.c b/crypto/rand/drbg_ctr.c
index 28db4eed7f..30420ae579 100644
--- a/crypto/rand/drbg_ctr.c
+++ b/crypto/rand/drbg_ctr.c
@@ -13,7 +13,7 @@
 #include <openssl/err.h>
 #include <openssl/rand.h>
 #include "internal/thread_once.h"
-#include "rand_lcl.h"
+#include "rand_local.h"
 
 /*
  * Implementation of NIST SP 800-90A CTR DRBG.
diff --git a/crypto/rand/drbg_hash.c b/crypto/rand/drbg_hash.c
index 6bef917e0f..4a64992af2 100644
--- a/crypto/rand/drbg_hash.c
+++ b/crypto/rand/drbg_hash.c
@@ -15,7 +15,7 @@
 #include <openssl/rand.h>
 #include "internal/thread_once.h"
 #include "internal/providercommon.h"
-#include "rand_lcl.h"
+#include "rand_local.h"
 
 /* 440 bits from SP800-90Ar1 10.1 table 2 */
 #define HASH_PRNG_SMALL_SEEDLEN   (440/8)
diff --git a/crypto/rand/drbg_hmac.c b/crypto/rand/drbg_hmac.c
index 14c4570b6b..4d7676d21b 100644
--- a/crypto/rand/drbg_hmac.c
+++ b/crypto/rand/drbg_hmac.c
@@ -14,7 +14,7 @@
 #include <openssl/rand.h>
 #include "internal/thread_once.h"
 #include "internal/providercommon.h"
-#include "rand_lcl.h"
+#include "rand_local.h"
 
 /*
  * Called twice by SP800-90Ar1 10.1.2.2 HMAC_DRBG_Update_Process.
diff --git a/crypto/rand/drbg_lib.c b/crypto/rand/drbg_lib.c
index bce2f74e9a..90e37786e6 100644
--- a/crypto/rand/drbg_lib.c
+++ b/crypto/rand/drbg_lib.c
@@ -11,10 +11,10 @@
 #include <openssl/crypto.h>
 #include <openssl/err.h>
 #include <openssl/rand.h>
-#include "rand_lcl.h"
+#include "rand_local.h"
 #include "internal/thread_once.h"
-#include "internal/rand_int.h"
-#include "internal/cryptlib_int.h"
+#include "crypto/rand.h"
+#include "crypto/cryptlib.h"
 
 /*
  * Support framework for NIST SP 800-90A DRBG
diff --git a/crypto/rand/rand_crng_test.c b/crypto/rand/rand_crng_test.c
index 0ba0986b96..950cc629d7 100644
--- a/crypto/rand/rand_crng_test.c
+++ b/crypto/rand/rand_crng_test.c
@@ -14,10 +14,10 @@
 
 #include <string.h>
 #include <openssl/evp.h>
-#include "internal/rand_int.h"
+#include "crypto/rand.h"
 #include "internal/thread_once.h"
 #include "internal/cryptlib.h"
-#include "rand_lcl.h"
+#include "rand_local.h"
 
 typedef struct crng_test_global_st {
     unsigned char crngt_prev[EVP_MAX_MD_SIZE];
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c
index b70b60a650..3508cfb25c 100644
--- a/crypto/rand/rand_lib.c
+++ b/crypto/rand/rand_lib.c
@@ -11,10 +11,10 @@
 #include <time.h>
 #include "internal/cryptlib.h"
 #include <openssl/opensslconf.h>
-#include "internal/rand_int.h"
+#include "crypto/rand.h"
 #include <openssl/engine.h>
 #include "internal/thread_once.h"
-#include "rand_lcl.h"
+#include "rand_local.h"
 #include "e_os.h"
 
 #ifndef FIPS_MODE
diff --git a/crypto/rand/rand_lcl.h b/crypto/rand/rand_local.h
similarity index 99%
rename from crypto/rand/rand_lcl.h
rename to crypto/rand/rand_local.h
index 0c92d75666..7817df80d0 100644
--- a/crypto/rand/rand_lcl.h
+++ b/crypto/rand/rand_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RAND_LCL_H
-# define HEADER_RAND_LCL_H
+#ifndef OSSL_CRYPTO_RAND_LOCAL_H
+# define OSSL_CRYPTO_RAND_LOCAL_H
 
 # include <openssl/aes.h>
 # include <openssl/evp.h>
@@ -17,7 +17,7 @@
 # include <openssl/ec.h>
 # include <openssl/rand_drbg.h>
 # include "internal/tsan_assist.h"
-# include "internal/rand_int.h"
+# include "crypto/rand.h"
 
 # include "internal/numbers.h"
 
diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index 8641badbff..8ed40236fd 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -15,8 +15,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/rand.h>
 #include <openssl/crypto.h>
-#include "rand_lcl.h"
-#include "internal/rand_int.h"
+#include "rand_local.h"
+#include "crypto/rand.h"
 #include <stdio.h>
 #include "internal/dso.h"
 #ifdef __linux
diff --git a/crypto/rand/rand_vms.c b/crypto/rand/rand_vms.c
index 3f13529d0f..fa74e7449c 100644
--- a/crypto/rand/rand_vms.c
+++ b/crypto/rand/rand_vms.c
@@ -14,8 +14,8 @@
 # include <unistd.h>
 # include "internal/cryptlib.h"
 # include <openssl/rand.h>
-# include "internal/rand_int.h"
-# include "rand_lcl.h"
+# include "crypto/rand.h"
+# include "rand_local.h"
 # include <descrip.h>
 # include <dvidef.h>
 # include <jpidef.h>
diff --git a/crypto/rand/rand_vxworks.c b/crypto/rand/rand_vxworks.c
index 81774e097d..d67469898e 100644
--- a/crypto/rand/rand_vxworks.c
+++ b/crypto/rand/rand_vxworks.c
@@ -13,8 +13,8 @@
 NON_EMPTY_TRANSLATION_UNIT
 #else
 # include <openssl/rand.h>
-# include "rand_lcl.h"
-# include "internal/rand_int.h"
+# include "rand_local.h"
+# include "crypto/rand.h"
 # include "internal/cryptlib.h"
 # include <version.h>
 # include <taskLib.h>
diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c
index 38852dc7a0..5f67c87c3c 100644
--- a/crypto/rand/rand_win.c
+++ b/crypto/rand/rand_win.c
@@ -9,8 +9,8 @@
 
 #include "internal/cryptlib.h"
 #include <openssl/rand.h>
-#include "rand_lcl.h"
-#include "internal/rand_int.h"
+#include "rand_local.h"
+#include "crypto/rand.h"
 #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)
 
 # ifndef OPENSSL_RAND_SEED_OS
diff --git a/crypto/rc2/rc2_cbc.c b/crypto/rc2/rc2_cbc.c
index 75459364c7..58a4b3e615 100644
--- a/crypto/rc2/rc2_cbc.c
+++ b/crypto/rc2/rc2_cbc.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc2.h>
-#include "rc2_locl.h"
+#include "rc2_local.h"
 
 void RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
                      RC2_KEY *ks, unsigned char *iv, int encrypt)
diff --git a/crypto/rc2/rc2_ecb.c b/crypto/rc2/rc2_ecb.c
index 9a0d23e5ba..fec2c10174 100644
--- a/crypto/rc2/rc2_ecb.c
+++ b/crypto/rc2/rc2_ecb.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc2.h>
-#include "rc2_locl.h"
+#include "rc2_local.h"
 #include <openssl/opensslv.h>
 
 /*-
diff --git a/crypto/rc2/rc2_locl.h b/crypto/rc2/rc2_local.h
similarity index 100%
rename from crypto/rc2/rc2_locl.h
rename to crypto/rc2/rc2_local.h
diff --git a/crypto/rc2/rc2_skey.c b/crypto/rc2/rc2_skey.c
index a453366ba9..33068d4802 100644
--- a/crypto/rc2/rc2_skey.c
+++ b/crypto/rc2/rc2_skey.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc2.h>
-#include "rc2_locl.h"
+#include "rc2_local.h"
 
 static const unsigned char key_table[256] = {
     0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79,
diff --git a/crypto/rc2/rc2cfb64.c b/crypto/rc2/rc2cfb64.c
index d7521ef148..9b85368db1 100644
--- a/crypto/rc2/rc2cfb64.c
+++ b/crypto/rc2/rc2cfb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc2.h>
-#include "rc2_locl.h"
+#include "rc2_local.h"
 
 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/crypto/rc2/rc2ofb64.c b/crypto/rc2/rc2ofb64.c
index e1be066b70..4270009e51 100644
--- a/crypto/rc2/rc2ofb64.c
+++ b/crypto/rc2/rc2ofb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc2.h>
-#include "rc2_locl.h"
+#include "rc2_local.h"
 
 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/crypto/rc4/rc4_enc.c b/crypto/rc4/rc4_enc.c
index 263266040f..c4753d93e0 100644
--- a/crypto/rc4/rc4_enc.c
+++ b/crypto/rc4/rc4_enc.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc4.h>
-#include "rc4_locl.h"
+#include "rc4_local.h"
 
 /*-
  * RC4 as implemented from a posting from
diff --git a/crypto/rc4/rc4_locl.h b/crypto/rc4/rc4_local.h
similarity index 86%
rename from crypto/rc4/rc4_locl.h
rename to crypto/rc4/rc4_local.h
index 20afa1334e..f8cf9a89b3 100644
--- a/crypto/rc4/rc4_locl.h
+++ b/crypto/rc4/rc4_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RC4_LOCL_H
-# define HEADER_RC4_LOCL_H
+#ifndef OSSL_CRYPTO_RC4_LOCAL_H
+# define OSSL_CRYPTO_RC4_LOCAL_H
 
 # include <openssl/opensslconf.h>
 # include "internal/cryptlib.h"
diff --git a/crypto/rc4/rc4_skey.c b/crypto/rc4/rc4_skey.c
index e2325e918b..42c4a20860 100644
--- a/crypto/rc4/rc4_skey.c
+++ b/crypto/rc4/rc4_skey.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc4.h>
-#include "rc4_locl.h"
+#include "rc4_local.h"
 #include <openssl/opensslv.h>
 
 const char *RC4_options(void)
diff --git a/crypto/rc5/rc5_ecb.c b/crypto/rc5/rc5_ecb.c
index 61770b6f72..51c14fd54d 100644
--- a/crypto/rc5/rc5_ecb.c
+++ b/crypto/rc5/rc5_ecb.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc5.h>
-#include "rc5_locl.h"
+#include "rc5_local.h"
 #include <openssl/opensslv.h>
 
 void RC5_32_ecb_encrypt(const unsigned char *in, unsigned char *out,
diff --git a/crypto/rc5/rc5_enc.c b/crypto/rc5/rc5_enc.c
index e1b7197134..c91fa99ce8 100644
--- a/crypto/rc5/rc5_enc.c
+++ b/crypto/rc5/rc5_enc.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <openssl/rc5.h>
-#include "rc5_locl.h"
+#include "rc5_local.h"
 
 void RC5_32_cbc_encrypt(const unsigned char *in, unsigned char *out,
                         long length, RC5_32_KEY *ks, unsigned char *iv,
diff --git a/crypto/rc5/rc5_locl.h b/crypto/rc5/rc5_local.h
similarity index 100%
rename from crypto/rc5/rc5_locl.h
rename to crypto/rc5/rc5_local.h
diff --git a/crypto/rc5/rc5_skey.c b/crypto/rc5/rc5_skey.c
index 43dc9320da..22a5df1486 100644
--- a/crypto/rc5/rc5_skey.c
+++ b/crypto/rc5/rc5_skey.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc5.h>
-#include "rc5_locl.h"
+#include "rc5_local.h"
 
 int RC5_32_set_key(RC5_32_KEY *key, int len, const unsigned char *data,
                    int rounds)
diff --git a/crypto/rc5/rc5cfb64.c b/crypto/rc5/rc5cfb64.c
index ed0641b7ad..001e1240ab 100644
--- a/crypto/rc5/rc5cfb64.c
+++ b/crypto/rc5/rc5cfb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc5.h>
-#include "rc5_locl.h"
+#include "rc5_local.h"
 
 /*
  * The input and output encrypted as though 64bit cfb mode is being used.
diff --git a/crypto/rc5/rc5ofb64.c b/crypto/rc5/rc5ofb64.c
index 30cc0e4f21..c3ae5d8c05 100644
--- a/crypto/rc5/rc5ofb64.c
+++ b/crypto/rc5/rc5ofb64.c
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/rc5.h>
-#include "rc5_locl.h"
+#include "rc5_local.h"
 
 /*
  * The input and output encrypted as though 64bit ofb mode is being used.
diff --git a/crypto/ripemd/rmd_dgst.c b/crypto/ripemd/rmd_dgst.c
index b66da1c1ec..f4a69c8862 100644
--- a/crypto/ripemd/rmd_dgst.c
+++ b/crypto/ripemd/rmd_dgst.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "rmd_locl.h"
+#include "rmd_local.h"
 #include <openssl/opensslv.h>
 
 #ifdef RMD160_ASM
@@ -39,7 +39,7 @@ void ripemd160_block_data_order(RIPEMD160_CTX *ctx, const void *p, size_t num)
     register unsigned MD32_REG_T A, B, C, D, E;
     unsigned MD32_REG_T a, b, c, d, e, l;
 # ifndef MD32_XARRAY
-    /* See comment in crypto/sha/sha_locl.h for details. */
+    /* See comment in crypto/sha/sha_local.h for details. */
     unsigned MD32_REG_T XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7,
         XX8, XX9, XX10, XX11, XX12, XX13, XX14, XX15;
 #  define X(i)   XX##i
diff --git a/crypto/ripemd/rmd_locl.h b/crypto/ripemd/rmd_local.h
similarity index 96%
rename from crypto/ripemd/rmd_locl.h
rename to crypto/ripemd/rmd_local.h
index 361e21b940..325cb98cc3 100644
--- a/crypto/ripemd/rmd_locl.h
+++ b/crypto/ripemd/rmd_local.h
@@ -13,7 +13,7 @@
 #include <openssl/ripemd.h>
 
 /*
- * DO EXAMINE COMMENTS IN crypto/md5/md5_locl.h & crypto/md5/md5_dgst.c
+ * DO EXAMINE COMMENTS IN crypto/md5/md5_local.h & crypto/md5/md5_dgst.c
  * FOR EXPLANATIONS ON FOLLOWING "CODE."
  */
 #ifdef RMD160_ASM
@@ -42,7 +42,7 @@ void ripemd160_block_data_order(RIPEMD160_CTX *c, const void *p, size_t num);
         } while (0)
 #define HASH_BLOCK_DATA_ORDER   ripemd160_block_data_order
 
-#include "internal/md32_common.h"
+#include "crypto/md32_common.h"
 
 /*
  * Transformed F2 and F4 are courtesy of Wei Dai
diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c
index bf56039b46..69e7c5ea1a 100644
--- a/crypto/rsa/rsa_ameth.c
+++ b/crypto/rsa/rsa_ameth.c
@@ -13,9 +13,9 @@
 #include <openssl/x509.h>
 #include <openssl/bn.h>
 #include <openssl/cms.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
-#include "rsa_locl.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
+#include "rsa_local.h"
 
 #ifndef OPENSSL_NO_CMS
 static int rsa_cms_sign(CMS_SignerInfo *si);
diff --git a/crypto/rsa/rsa_asn1.c b/crypto/rsa/rsa_asn1.c
index ad9d8b357b..e6b81253fa 100644
--- a/crypto/rsa/rsa_asn1.c
+++ b/crypto/rsa/rsa_asn1.c
@@ -12,7 +12,7 @@
 #include <openssl/bn.h>
 #include <openssl/x509.h>
 #include <openssl/asn1t.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 /*
  * Override the default free and new methods,
diff --git a/crypto/rsa/rsa_chk.c b/crypto/rsa/rsa_chk.c
index 96a13b3330..6e2557f095 100644
--- a/crypto/rsa/rsa_chk.c
+++ b/crypto/rsa/rsa_chk.c
@@ -9,7 +9,7 @@
 
 #include <openssl/bn.h>
 #include <openssl/err.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 int RSA_check_key(const RSA *key)
 {
diff --git a/crypto/rsa/rsa_crpt.c b/crypto/rsa/rsa_crpt.c
index c35ad9f545..6a408e907b 100644
--- a/crypto/rsa/rsa_crpt.c
+++ b/crypto/rsa/rsa_crpt.c
@@ -10,9 +10,9 @@
 #include <stdio.h>
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
-#include "internal/bn_int.h"
+#include "crypto/bn.h"
 #include <openssl/rand.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 int RSA_bits(const RSA *r)
 {
diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c
index dfbb79f9c8..c87b709722 100644
--- a/crypto/rsa/rsa_gen.c
+++ b/crypto/rsa/rsa_gen.c
@@ -17,7 +17,7 @@
 #include <time.h>
 #include "internal/cryptlib.h"
 #include <openssl/bn.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 static int rsa_builtin_keygen(RSA *rsa, int bits, int primes, BIGNUM *e_value,
                               BN_GENCB *cb);
diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index c6e570089f..abdabfb45a 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -11,11 +11,11 @@
 #include <openssl/crypto.h>
 #include "internal/cryptlib.h"
 #include "internal/refcount.h"
-#include "internal/bn_int.h"
+#include "crypto/bn.h"
 #include <openssl/engine.h>
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
-#include "rsa_locl.h"
+#include "crypto/evp.h"
+#include "rsa_local.h"
 
 RSA *RSA_new(void)
 {
diff --git a/crypto/rsa/rsa_locl.h b/crypto/rsa/rsa_local.h
similarity index 98%
rename from crypto/rsa/rsa_locl.h
rename to crypto/rsa/rsa_local.h
index 5dcd6eab7b..204fde29fa 100644
--- a/crypto/rsa/rsa_locl.h
+++ b/crypto/rsa/rsa_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef RSA_LOCAL_HEADER_H
-#define RSA_LOCAL_HEADER_H
+#ifndef OSSL_CRYPTO_RSA_LOCAL_H
+#define OSSL_CRYPTO_RSA_LOCAL_H
 
 #include <openssl/rsa.h>
 #include "internal/refcount.h"
@@ -167,4 +167,4 @@ int rsa_fips186_4_gen_prob_primes(RSA *rsa, BIGNUM *p1, BIGNUM *p2,
                                   const BIGNUM *Xq2, int nbits,
                                   const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb);
 
-#endif /* RSA_LOCAL_HEADER_H */
+#endif /* OSSL_CRYPTO_RSA_LOCAL_H */
diff --git a/crypto/rsa/rsa_meth.c b/crypto/rsa/rsa_meth.c
index 0306519cd1..a2a0426ee4 100644
--- a/crypto/rsa/rsa_meth.c
+++ b/crypto/rsa/rsa_meth.c
@@ -8,7 +8,7 @@
  */
 
 #include <string.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 #include <openssl/err.h>
 
 RSA_METHOD *RSA_meth_new(const char *name, int flags)
diff --git a/crypto/rsa/rsa_mp.c b/crypto/rsa/rsa_mp.c
index d2e00f6e20..6a16ffd58e 100644
--- a/crypto/rsa/rsa_mp.c
+++ b/crypto/rsa/rsa_mp.c
@@ -10,7 +10,7 @@
 
 #include <openssl/bn.h>
 #include <openssl/err.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 void rsa_multip_info_free_ex(RSA_PRIME_INFO *pinfo)
 {
diff --git a/crypto/rsa/rsa_oaep.c b/crypto/rsa/rsa_oaep.c
index 0945d4f60d..1ae7ed287f 100644
--- a/crypto/rsa/rsa_oaep.c
+++ b/crypto/rsa/rsa_oaep.c
@@ -20,7 +20,7 @@
  * one-wayness.  For the RSA function, this is an equivalent notion.
  */
 
-#include "internal/constant_time_locl.h"
+#include "internal/constant_time.h"
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
@@ -28,7 +28,7 @@
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 #include <openssl/sha.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
                                const unsigned char *from, int flen,
diff --git a/crypto/rsa/rsa_ossl.c b/crypto/rsa/rsa_ossl.c
index 5d5efdbd69..39d17cf38c 100644
--- a/crypto/rsa/rsa_ossl.c
+++ b/crypto/rsa/rsa_ossl.c
@@ -8,9 +8,9 @@
  */
 
 #include "internal/cryptlib.h"
-#include "internal/bn_int.h"
-#include "rsa_locl.h"
-#include "internal/constant_time_locl.h"
+#include "crypto/bn.h"
+#include "rsa_local.h"
+#include "internal/constant_time.h"
 
 static int rsa_ossl_public_encrypt(int flen, const unsigned char *from,
                                   unsigned char *to, RSA *rsa, int padding);
diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c
index ff1ca02135..da984f522f 100644
--- a/crypto/rsa/rsa_pk1.c
+++ b/crypto/rsa/rsa_pk1.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/constant_time_locl.h"
+#include "internal/constant_time.h"
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c
index 993c2cea4b..390188d13a 100644
--- a/crypto/rsa/rsa_pmeth.c
+++ b/crypto/rsa/rsa_pmeth.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/constant_time_locl.h"
+#include "internal/constant_time.h"
 
 #include <stdio.h>
 #include "internal/cryptlib.h"
@@ -18,8 +18,8 @@
 #include <openssl/evp.h>
 #include <openssl/x509v3.h>
 #include <openssl/cms.h>
-#include "internal/evp_int.h"
-#include "rsa_locl.h"
+#include "crypto/evp.h"
+#include "rsa_local.h"
 
 /* RSA pkey context structure */
 
diff --git a/crypto/rsa/rsa_pss.c b/crypto/rsa/rsa_pss.c
index 51c03c73be..15014ef4b1 100644
--- a/crypto/rsa/rsa_pss.c
+++ b/crypto/rsa/rsa_pss.c
@@ -14,7 +14,7 @@
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 #include <openssl/sha.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 static const unsigned char zeroes[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 
diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c
index 73811e7bfc..0ed9acf431 100644
--- a/crypto/rsa/rsa_sign.c
+++ b/crypto/rsa/rsa_sign.c
@@ -13,8 +13,8 @@
 #include <openssl/rsa.h>
 #include <openssl/objects.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
-#include "rsa_locl.h"
+#include "crypto/x509.h"
+#include "rsa_local.h"
 
 /* Size of an SSL signature: MD5+SHA1 */
 #define SSL_SIG_LENGTH  36
diff --git a/crypto/rsa/rsa_sp800_56b_check.c b/crypto/rsa/rsa_sp800_56b_check.c
index 10e264e591..cf15212b87 100644
--- a/crypto/rsa/rsa_sp800_56b_check.c
+++ b/crypto/rsa/rsa_sp800_56b_check.c
@@ -10,8 +10,8 @@
 
 #include <openssl/err.h>
 #include <openssl/bn.h>
-#include "internal/bn_int.h"
-#include "rsa_locl.h"
+#include "crypto/bn.h"
+#include "rsa_local.h"
 
 /*
  * Part of the RSA keypair test.
diff --git a/crypto/rsa/rsa_sp800_56b_gen.c b/crypto/rsa/rsa_sp800_56b_gen.c
index 50c5bf14be..c22b10cfbd 100644
--- a/crypto/rsa/rsa_sp800_56b_gen.c
+++ b/crypto/rsa/rsa_sp800_56b_gen.c
@@ -10,8 +10,8 @@
 
 #include <openssl/err.h>
 #include <openssl/bn.h>
-#include "internal/bn_int.h"
-#include "rsa_locl.h"
+#include "crypto/bn.h"
+#include "rsa_local.h"
 
 #define RSA_FIPS1864_MIN_KEYGEN_KEYSIZE 2048
 #define RSA_FIPS1864_MIN_KEYGEN_STRENGTH 112
diff --git a/crypto/rsa/rsa_ssl.c b/crypto/rsa/rsa_ssl.c
index 16bfe00df3..d57031e5af 100644
--- a/crypto/rsa/rsa_ssl.c
+++ b/crypto/rsa/rsa_ssl.c
@@ -12,7 +12,7 @@
 #include <openssl/bn.h>
 #include <openssl/rsa.h>
 #include <openssl/rand.h>
-#include "internal/constant_time_locl.h"
+#include "internal/constant_time.h"
 
 int RSA_padding_add_SSLv23(unsigned char *to, int tlen,
                            const unsigned char *from, int flen)
diff --git a/crypto/rsa/rsa_x931g.c b/crypto/rsa/rsa_x931g.c
index 7a52083f15..3798d02b55 100644
--- a/crypto/rsa/rsa_x931g.c
+++ b/crypto/rsa/rsa_x931g.c
@@ -12,7 +12,7 @@
 #include <time.h>
 #include <openssl/err.h>
 #include <openssl/bn.h>
-#include "rsa_locl.h"
+#include "rsa_local.h"
 
 /* X9.31 RSA key derivation and generation */
 
diff --git a/crypto/s390x_arch.h b/crypto/s390x_arch.h
index 77f327d4de..0123de9477 100644
--- a/crypto/s390x_arch.h
+++ b/crypto/s390x_arch.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef S390X_ARCH_H
-# define S390X_ARCH_H
+#ifndef OSSL_CRYPTO_S390X_ARCH_H
+# define OSSL_CRYPTO_S390X_ARCH_H
 
 # ifndef __ASSEMBLER__
 
diff --git a/crypto/s390xcap.c b/crypto/s390xcap.c
index 64de9d0168..eb00a4a7bd 100644
--- a/crypto/s390xcap.c
+++ b/crypto/s390xcap.c
@@ -13,7 +13,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include "internal/cryptlib.h"
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "s390x_arch.h"
 
 #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
diff --git a/crypto/seed/seed.c b/crypto/seed/seed.c
index a73ec44d84..224fb1f8af 100644
--- a/crypto/seed/seed.c
+++ b/crypto/seed/seed.c
@@ -42,7 +42,7 @@
 # endif
 
 # include <openssl/seed.h>
-# include "seed_locl.h"
+# include "seed_local.h"
 
 # ifdef SS                      /* can get defined on Solaris by inclusion of
                                  * <stdlib.h> */
diff --git a/crypto/seed/seed_locl.h b/crypto/seed/seed_local.h
similarity index 97%
rename from crypto/seed/seed_locl.h
rename to crypto/seed/seed_local.h
index 9be89b21a6..ed3cebc6b1 100644
--- a/crypto/seed/seed_locl.h
+++ b/crypto/seed/seed_local.h
@@ -32,8 +32,8 @@
  * SUCH DAMAGE.
  *
  */
-#ifndef HEADER_SEED_LOCL_H
-# define HEADER_SEED_LOCL_H
+#ifndef OSSL_CRYPTO_SEED_LOCAL_H
+# define OSSL_CRYPTO_SEED_LOCAL_H
 
 # include "openssl/e_os2.h"
 # include <openssl/seed.h>
@@ -109,4 +109,4 @@ typedef unsigned int seed_word;
         (X1) ^= (T0);                            \
         (X2) ^= (T1)
 
-#endif                          /* HEADER_SEED_LOCL_H */
+#endif                          /* OSSL_CRYPTO_SEED_LOCAL_H */
diff --git a/crypto/sha/sha1dgst.c b/crypto/sha/sha1dgst.c
index 4881bcb17a..68c0a96718 100644
--- a/crypto/sha/sha1dgst.c
+++ b/crypto/sha/sha1dgst.c
@@ -16,8 +16,8 @@
 
 /* The implementation is in ../md32_common.h */
 
-#include "sha_locl.h"
-#include "internal/sha.h"
+#include "sha_local.h"
+#include "crypto/sha.h"
 
 int sha1_ctrl(SHA_CTX *sha1, int cmd, int mslen, void *ms)
 {
diff --git a/crypto/sha/sha256.c b/crypto/sha/sha256.c
index 328c0f17c3..99833924b0 100644
--- a/crypto/sha/sha256.c
+++ b/crypto/sha/sha256.c
@@ -128,7 +128,7 @@ static
 #endif
 void sha256_block_data_order(SHA256_CTX *ctx, const void *in, size_t num);
 
-#include "internal/md32_common.h"
+#include "crypto/md32_common.h"
 
 #ifndef SHA256_ASM
 static const SHA_LONG K256[64] = {
diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c
index 7b6d7496d0..03189a9d9c 100644
--- a/crypto/sha/sha512.c
+++ b/crypto/sha/sha512.c
@@ -50,7 +50,7 @@
 #include <openssl/opensslv.h>
 
 #include "internal/cryptlib.h"
-#include "internal/sha.h"
+#include "crypto/sha.h"
 
 #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || \
     defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) || \
diff --git a/crypto/sha/sha_locl.h b/crypto/sha/sha_local.h
similarity index 99%
rename from crypto/sha/sha_locl.h
rename to crypto/sha/sha_local.h
index d615e58491..f7c0ac707b 100644
--- a/crypto/sha/sha_locl.h
+++ b/crypto/sha/sha_local.h
@@ -42,7 +42,7 @@ static void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num);
 void sha1_block_data_order(SHA_CTX *c, const void *p, size_t num);
 #endif
 
-#include "internal/md32_common.h"
+#include "crypto/md32_common.h"
 
 #define INIT_DATA_h0 0x67452301UL
 #define INIT_DATA_h1 0xefcdab89UL
diff --git a/crypto/siphash/siphash.c b/crypto/siphash/siphash.c
index 9d91178455..03f9b4982d 100644
--- a/crypto/siphash/siphash.c
+++ b/crypto/siphash/siphash.c
@@ -27,7 +27,7 @@
 #include <string.h>
 #include <openssl/crypto.h>
 
-#include "internal/siphash.h"
+#include "crypto/siphash.h"
 #include "siphash_local.h"
 
 /* default: SipHash-2-4 */
diff --git a/crypto/siphash/siphash_ameth.c b/crypto/siphash/siphash_ameth.c
index ba7679db35..5aa4d88915 100644
--- a/crypto/siphash/siphash_ameth.c
+++ b/crypto/siphash/siphash_ameth.c
@@ -10,10 +10,10 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
-#include "internal/asn1_int.h"
-#include "internal/siphash.h"
+#include "crypto/asn1.h"
+#include "crypto/siphash.h"
 #include "siphash_local.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 /*
  * SIPHASH "ASN1" method. This is just here to indicate the maximum
diff --git a/crypto/sm2/sm2_crypt.c b/crypto/sm2/sm2_crypt.c
index d544210757..102f02651a 100644
--- a/crypto/sm2/sm2_crypt.c
+++ b/crypto/sm2/sm2_crypt.c
@@ -9,9 +9,9 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/sm2.h"
-#include "internal/sm2err.h"
-#include "internal/ec_int.h" /* ecdh_KDF_X9_63() */
+#include "crypto/sm2.h"
+#include "crypto/sm2err.h"
+#include "crypto/ec.h" /* ecdh_KDF_X9_63() */
 #include <openssl/err.h>
 #include <openssl/evp.h>
 #include <openssl/bn.h>
diff --git a/crypto/sm2/sm2_err.c b/crypto/sm2/sm2_err.c
index d8e1179056..93ee9f7d7a 100644
--- a/crypto/sm2/sm2_err.c
+++ b/crypto/sm2/sm2_err.c
@@ -9,7 +9,7 @@
  */
 
 #include <openssl/err.h>
-#include "internal/sm2err.h"
+#include "crypto/sm2err.h"
 
 #ifndef OPENSSL_NO_ERR
 
diff --git a/crypto/sm2/sm2_pmeth.c b/crypto/sm2/sm2_pmeth.c
index 7613e333ec..27bec2cb06 100644
--- a/crypto/sm2/sm2_pmeth.c
+++ b/crypto/sm2/sm2_pmeth.c
@@ -11,9 +11,9 @@
 #include <openssl/asn1t.h>
 #include <openssl/ec.h>
 #include <openssl/evp.h>
-#include "internal/evp_int.h"
-#include "internal/sm2.h"
-#include "internal/sm2err.h"
+#include "crypto/evp.h"
+#include "crypto/sm2.h"
+#include "crypto/sm2err.h"
 
 /* EC pkey context structure */
 
diff --git a/crypto/sm2/sm2_sign.c b/crypto/sm2/sm2_sign.c
index 38e556241c..318e981802 100644
--- a/crypto/sm2/sm2_sign.c
+++ b/crypto/sm2/sm2_sign.c
@@ -9,9 +9,9 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/sm2.h"
-#include "internal/sm2err.h"
-#include "internal/ec_int.h" /* ec_group_do_inverse_ord() */
+#include "crypto/sm2.h"
+#include "crypto/sm2err.h"
+#include "crypto/ec.h" /* ec_group_do_inverse_ord() */
 #include "internal/numbers.h"
 #include <openssl/err.h>
 #include <openssl/evp.h>
diff --git a/crypto/sm3/m_sm3.c b/crypto/sm3/m_sm3.c
index 38ddbfe372..4bccaaf1dc 100644
--- a/crypto/sm3/m_sm3.c
+++ b/crypto/sm3/m_sm3.c
@@ -13,7 +13,7 @@
 #ifndef OPENSSL_NO_SM3
 # include <openssl/evp.h>
 # include "internal/sm3.h"
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 
 static int init(EVP_MD_CTX *ctx)
 {
diff --git a/crypto/sm3/sm3.c b/crypto/sm3/sm3.c
index f5d6a86142..ef03150cab 100644
--- a/crypto/sm3/sm3.c
+++ b/crypto/sm3/sm3.c
@@ -10,7 +10,7 @@
  */
 
 #include <openssl/e_os2.h>
-#include "sm3_locl.h"
+#include "sm3_local.h"
 
 int sm3_init(SM3_CTX *c)
 {
diff --git a/crypto/sm3/sm3_locl.h b/crypto/sm3/sm3_local.h
similarity index 98%
rename from crypto/sm3/sm3_locl.h
rename to crypto/sm3/sm3_local.h
index a5b79623e9..07def19cf1 100644
--- a/crypto/sm3/sm3_locl.h
+++ b/crypto/sm3/sm3_local.h
@@ -37,7 +37,7 @@
 void sm3_block_data_order(SM3_CTX *c, const void *p, size_t num);
 void sm3_transform(SM3_CTX *c, const unsigned char *data);
 
-#include "internal/md32_common.h"
+#include "crypto/md32_common.h"
 
 #define P0(X) (X ^ ROTATE(X, 9) ^ ROTATE(X, 17))
 #define P1(X) (X ^ ROTATE(X, 15) ^ ROTATE(X, 23))
diff --git a/crypto/sm4/sm4.c b/crypto/sm4/sm4.c
index c0454d137a..a62993c272 100644
--- a/crypto/sm4/sm4.c
+++ b/crypto/sm4/sm4.c
@@ -10,7 +10,7 @@
  */
 
 #include <openssl/e_os2.h>
-#include "internal/sm4.h"
+#include "crypto/sm4.h"
 
 static const uint8_t SM4_S[256] = {
     0xD6, 0x90, 0xE9, 0xFE, 0xCC, 0xE1, 0x3D, 0xB7, 0x16, 0xB6, 0x14, 0xC2,
diff --git a/crypto/sparc_arch.h b/crypto/sparc_arch.h
index 4207afea5e..f57f0e145b 100644
--- a/crypto/sparc_arch.h
+++ b/crypto/sparc_arch.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef __SPARC_ARCH_H__
-# define __SPARC_ARCH_H__
+#ifndef OSSL_CRYPTO_SPARC_ARCH_H
+# define OSSL_CRYPTO_SPARC_ARCH_H
 
 # define SPARCV9_TICK_PRIVILEGED (1<<0)
 # define SPARCV9_PREFER_FPU      (1<<1)
@@ -115,4 +115,4 @@
         mov     tmp, %o7;
 # endif
 
-#endif                          /* __SPARC_ARCH_H__ */
+#endif                          /* OSSL_CRYPTO_SPARC_ARCH_H */
diff --git a/crypto/sparse_array.c b/crypto/sparse_array.c
index a74db5d218..9d444739f5 100644
--- a/crypto/sparse_array.c
+++ b/crypto/sparse_array.c
@@ -10,7 +10,7 @@
 
 #include <openssl/crypto.h>
 #include <openssl/bn.h>
-#include "internal/sparse_array.h"
+#include "crypto/sparse_array.h"
 
 /*
  * How many bits are used to index each level in the tree structure?
diff --git a/crypto/srp/srp_lib.c b/crypto/srp/srp_lib.c
index 8cba189ef3..99511954d7 100644
--- a/crypto/srp/srp_lib.c
+++ b/crypto/srp/srp_lib.c
@@ -16,7 +16,7 @@
 # include <openssl/sha.h>
 # include <openssl/srp.h>
 # include <openssl/evp.h>
-# include "internal/bn_srp.h"
+# include "crypto/bn_srp.h"
 
 /* calculate = SHA1(PAD(x) || PAD(y)) */
 
diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c
index 79e76c9aa9..c4dd5153f2 100644
--- a/crypto/srp/srp_vfy.c
+++ b/crypto/srp/srp_vfy.c
@@ -13,7 +13,7 @@
 
 #ifndef OPENSSL_NO_SRP
 # include "internal/cryptlib.h"
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include <openssl/sha.h>
 # include <openssl/srp.h>
 # include <openssl/evp.h>
diff --git a/crypto/store/loader_file.c b/crypto/store/loader_file.c
index 206af12af6..078c7c2573 100644
--- a/crypto/store/loader_file.c
+++ b/crypto/store/loader_file.c
@@ -24,12 +24,12 @@
 #include <openssl/store.h>
 #include <openssl/ui.h>
 #include <openssl/x509.h>        /* For the PKCS8 stuff o.O */
-#include "internal/asn1_int.h"
-#include "internal/ctype.h"
+#include "crypto/asn1.h"
+#include "crypto/ctype.h"
 #include "internal/o_dir.h"
 #include "internal/cryptlib.h"
-#include "internal/store_int.h"
-#include "store_locl.h"
+#include "crypto/store.h"
+#include "store_local.h"
 
 #ifdef _WIN32
 # define stat    _stat
diff --git a/crypto/store/store_init.c b/crypto/store/store_init.c
index db050c07cc..e1b953fbf8 100644
--- a/crypto/store/store_init.c
+++ b/crypto/store/store_init.c
@@ -8,8 +8,8 @@
  */
 
 #include <openssl/err.h>
-#include "internal/store.h"
-#include "store_locl.h"
+#include "crypto/store.h"
+#include "store_local.h"
 
 static CRYPTO_ONCE store_init = CRYPTO_ONCE_STATIC_INIT;
 DEFINE_RUN_ONCE_STATIC(do_store_init)
diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c
index 8c55c431c1..92b957c7cd 100644
--- a/crypto/store/store_lib.c
+++ b/crypto/store/store_lib.c
@@ -18,8 +18,8 @@
 #include <openssl/err.h>
 #include <openssl/store.h>
 #include "internal/thread_once.h"
-#include "internal/store_int.h"
-#include "store_locl.h"
+#include "crypto/store.h"
+#include "store_local.h"
 
 struct ossl_store_ctx_st {
     const OSSL_STORE_LOADER *loader;
diff --git a/crypto/store/store_locl.h b/crypto/store/store_local.h
similarity index 100%
rename from crypto/store/store_locl.h
rename to crypto/store/store_local.h
diff --git a/crypto/store/store_register.c b/crypto/store/store_register.c
index 3022e368c6..399ec8c625 100644
--- a/crypto/store/store_register.c
+++ b/crypto/store/store_register.c
@@ -8,12 +8,12 @@
  */
 
 #include <string.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <assert.h>
 
 #include <openssl/err.h>
 #include <openssl/lhash.h>
-#include "store_locl.h"
+#include "store_local.h"
 
 static CRYPTO_RWLOCK *registry_lock;
 static CRYPTO_ONCE registry_init = CRYPTO_ONCE_STATIC_INIT;
diff --git a/crypto/trace.c b/crypto/trace.c
index cc99fff37c..7ff6af8837 100755
--- a/crypto/trace.c
+++ b/crypto/trace.c
@@ -16,7 +16,7 @@
 #include <openssl/trace.h>
 #include "internal/bio.h"
 #include "internal/nelem.h"
-#include "internal/cryptlib_int.h"
+#include "crypto/cryptlib.h"
 
 #include "e_os.h"                /* strcasecmp for Windows */
 
diff --git a/crypto/ts/ts_asn1.c b/crypto/ts/ts_asn1.c
index 52ac2aaad2..49f92b22ff 100644
--- a/crypto/ts/ts_asn1.c
+++ b/crypto/ts/ts_asn1.c
@@ -10,7 +10,7 @@
 #include <openssl/ts.h>
 #include <openssl/err.h>
 #include <openssl/asn1t.h>
-#include "ts_lcl.h"
+#include "ts_local.h"
 
 ASN1_SEQUENCE(TS_MSG_IMPRINT) = {
         ASN1_SIMPLE(TS_MSG_IMPRINT, hash_algo, X509_ALGOR),
diff --git a/crypto/ts/ts_lib.c b/crypto/ts/ts_lib.c
index 5c1e15abfc..5a99c9df17 100644
--- a/crypto/ts/ts_lib.c
+++ b/crypto/ts/ts_lib.c
@@ -14,7 +14,7 @@
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 #include <openssl/ts.h>
-#include "ts_lcl.h"
+#include "ts_local.h"
 
 int TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num)
 {
diff --git a/crypto/ts/ts_lcl.h b/crypto/ts/ts_local.h
similarity index 100%
rename from crypto/ts/ts_lcl.h
rename to crypto/ts/ts_local.h
diff --git a/crypto/ts/ts_req_print.c b/crypto/ts/ts_req_print.c
index d1c4e6a40c..968816ae28 100644
--- a/crypto/ts/ts_req_print.c
+++ b/crypto/ts/ts_req_print.c
@@ -13,7 +13,7 @@
 #include <openssl/bn.h>
 #include <openssl/x509v3.h>
 #include <openssl/ts.h>
-#include "ts_lcl.h"
+#include "ts_local.h"
 
 int TS_REQ_print_bio(BIO *bio, TS_REQ *a)
 {
diff --git a/crypto/ts/ts_req_utils.c b/crypto/ts/ts_req_utils.c
index 6e90a59891..8b95097935 100644
--- a/crypto/ts/ts_req_utils.c
+++ b/crypto/ts/ts_req_utils.c
@@ -12,7 +12,7 @@
 #include <openssl/objects.h>
 #include <openssl/x509v3.h>
 #include <openssl/ts.h>
-#include "ts_lcl.h"
+#include "ts_local.h"
 
 int TS_REQ_set_version(TS_REQ *a, long version)
 {
diff --git a/crypto/ts/ts_rsp_print.c b/crypto/ts/ts_rsp_print.c
index 9827c20635..8593e2d9e3 100644
--- a/crypto/ts/ts_rsp_print.c
+++ b/crypto/ts/ts_rsp_print.c
@@ -13,7 +13,7 @@
 #include <openssl/bn.h>
 #include <openssl/x509v3.h>
 #include <openssl/ts.h>
-#include "ts_lcl.h"
+#include "ts_local.h"
 
 struct status_map_st {
     int bit;
diff --git a/crypto/ts/ts_rsp_sign.c b/crypto/ts/ts_rsp_sign.c
index 7791fc73c8..9faa42fe3a 100644
--- a/crypto/ts/ts_rsp_sign.c
+++ b/crypto/ts/ts_rsp_sign.c
@@ -14,8 +14,8 @@
 #include <openssl/ts.h>
 #include <openssl/pkcs7.h>
 #include <openssl/crypto.h>
-#include "ts_lcl.h"
-#include "internal/ess_int.h"
+#include "ts_local.h"
+#include "crypto/ess.h"
 
 static ASN1_INTEGER *def_serial_cb(struct TS_resp_ctx *, void *);
 static int def_time_cb(struct TS_resp_ctx *, void *, long *sec, long *usec);
diff --git a/crypto/ts/ts_rsp_utils.c b/crypto/ts/ts_rsp_utils.c
index 8e4bed2d77..6017e8d16d 100644
--- a/crypto/ts/ts_rsp_utils.c
+++ b/crypto/ts/ts_rsp_utils.c
@@ -12,7 +12,7 @@
 #include <openssl/objects.h>
 #include <openssl/ts.h>
 #include <openssl/pkcs7.h>
-#include "ts_lcl.h"
+#include "ts_local.h"
 
 int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *status_info)
 {
diff --git a/crypto/ts/ts_rsp_verify.c b/crypto/ts/ts_rsp_verify.c
index e658354eb3..7d2161f2d0 100644
--- a/crypto/ts/ts_rsp_verify.c
+++ b/crypto/ts/ts_rsp_verify.c
@@ -12,8 +12,8 @@
 #include <openssl/objects.h>
 #include <openssl/ts.h>
 #include <openssl/pkcs7.h>
-#include "ts_lcl.h"
-#include "internal/ess_int.h"
+#include "ts_local.h"
+#include "crypto/ess.h"
 
 static int ts_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted,
                           X509 *signer, STACK_OF(X509) **chain);
diff --git a/crypto/ts/ts_verify_ctx.c b/crypto/ts/ts_verify_ctx.c
index 9ff91da2b5..e2a4ee477b 100644
--- a/crypto/ts/ts_verify_ctx.c
+++ b/crypto/ts/ts_verify_ctx.c
@@ -10,7 +10,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/objects.h>
 #include <openssl/ts.h>
-#include "ts_lcl.h"
+#include "ts_local.h"
 
 TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
 {
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index d0393511a0..ab51a24a53 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -13,7 +13,7 @@
 #include <openssl/buffer.h>
 #include <openssl/ui.h>
 #include <openssl/err.h>
-#include "ui_locl.h"
+#include "ui_local.h"
 
 UI *UI_new(void)
 {
diff --git a/crypto/ui/ui_locl.h b/crypto/ui/ui_local.h
similarity index 98%
rename from crypto/ui/ui_locl.h
rename to crypto/ui/ui_local.h
index 6506cba52f..36b3e6194b 100644
--- a/crypto/ui/ui_locl.h
+++ b/crypto/ui/ui_local.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_UI_LOCL_H
-# define HEADER_UI_LOCL_H
+#ifndef OSSL_CRYPTO_UI_LOCAL_H
+# define OSSL_CRYPTO_UI_LOCAL_H
 
 # include <openssl/ui.h>
 # include <openssl/crypto.h>
diff --git a/crypto/ui/ui_null.c b/crypto/ui/ui_null.c
index 8e500ccc6c..f002448d2c 100644
--- a/crypto/ui/ui_null.c
+++ b/crypto/ui/ui_null.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "ui_locl.h"
+#include "ui_local.h"
 
 static const UI_METHOD ui_null = {
     "OpenSSL NULL UI",
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 52c675a172..cf873431f7 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -49,7 +49,7 @@
 #  endif
 # endif
 
-# include "ui_locl.h"
+# include "ui_local.h"
 # include "internal/cryptlib.h"
 
 # ifdef OPENSSL_SYS_VMS          /* prototypes for sys$whatever */
diff --git a/crypto/ui/ui_util.c b/crypto/ui/ui_util.c
index c49fb72634..b28c13324a 100644
--- a/crypto/ui/ui_util.c
+++ b/crypto/ui/ui_util.c
@@ -9,7 +9,7 @@
 
 #include <string.h>
 #include "internal/thread_once.h"
-#include "ui_locl.h"
+#include "ui_local.h"
 
 #ifndef BUFSIZ
 #define BUFSIZ 256
diff --git a/crypto/whrlpool/wp_block.c b/crypto/whrlpool/wp_block.c
index c2c0b72681..c24f6733b0 100644
--- a/crypto/whrlpool/wp_block.c
+++ b/crypto/whrlpool/wp_block.c
@@ -37,7 +37,7 @@
  */
 
 #include "internal/cryptlib.h"
-#include "wp_locl.h"
+#include "wp_local.h"
 #include <string.h>
 
 typedef unsigned char u8;
diff --git a/crypto/whrlpool/wp_dgst.c b/crypto/whrlpool/wp_dgst.c
index 4969630483..3a4a80931d 100644
--- a/crypto/whrlpool/wp_dgst.c
+++ b/crypto/whrlpool/wp_dgst.c
@@ -53,7 +53,7 @@
  */
 
 #include <openssl/crypto.h>
-#include "wp_locl.h"
+#include "wp_local.h"
 #include <string.h>
 
 int WHIRLPOOL_Init(WHIRLPOOL_CTX *c)
diff --git a/crypto/whrlpool/wp_locl.h b/crypto/whrlpool/wp_local.h
similarity index 100%
rename from crypto/whrlpool/wp_locl.h
rename to crypto/whrlpool/wp_local.h
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c
index e53b9b44a6..d38080fb0c 100644
--- a/crypto/x509/by_dir.c
+++ b/crypto/x509/by_dir.c
@@ -19,8 +19,8 @@
 #endif
 
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
-#include "x509_lcl.h"
+#include "crypto/x509.h"
+#include "x509_local.h"
 
 struct lookup_dir_hashes_st {
     unsigned long hash;
diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c
index 35d716b921..93a1af87c6 100644
--- a/crypto/x509/by_file.c
+++ b/crypto/x509/by_file.c
@@ -15,7 +15,7 @@
 #include <openssl/buffer.h>
 #include <openssl/x509.h>
 #include <openssl/pem.h>
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
                         long argl, char **ret);
diff --git a/crypto/x509/pcy_cache.c b/crypto/x509/pcy_cache.c
index 21a89e62c0..e65931e456 100644
--- a/crypto/x509/pcy_cache.c
+++ b/crypto/x509/pcy_cache.c
@@ -10,9 +10,9 @@
 #include "internal/cryptlib.h"
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
-#include "pcy_int.h"
+#include "pcy_local.h"
 
 static int policy_data_cmp(const X509_POLICY_DATA *const *a,
                            const X509_POLICY_DATA *const *b);
diff --git a/crypto/x509/pcy_data.c b/crypto/x509/pcy_data.c
index c1d56bdcde..cc3fc201f9 100644
--- a/crypto/x509/pcy_data.c
+++ b/crypto/x509/pcy_data.c
@@ -11,7 +11,7 @@
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
-#include "pcy_int.h"
+#include "pcy_local.h"
 
 /* Policy Node routines */
 
diff --git a/crypto/x509/pcy_lib.c b/crypto/x509/pcy_lib.c
index deee8f6c0c..b392f13b1e 100644
--- a/crypto/x509/pcy_lib.c
+++ b/crypto/x509/pcy_lib.c
@@ -11,7 +11,7 @@
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
-#include "pcy_int.h"
+#include "pcy_local.h"
 
 /* accessor functions */
 
diff --git a/crypto/x509/pcy_int.h b/crypto/x509/pcy_local.h
similarity index 100%
rename from crypto/x509/pcy_int.h
rename to crypto/x509/pcy_local.h
diff --git a/crypto/x509/pcy_map.c b/crypto/x509/pcy_map.c
index 243d6e2b7c..258792be6f 100644
--- a/crypto/x509/pcy_map.c
+++ b/crypto/x509/pcy_map.c
@@ -10,9 +10,9 @@
 #include "internal/cryptlib.h"
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
-#include "pcy_int.h"
+#include "pcy_local.h"
 
 /*
  * Set policy mapping entries in cache. Note: this modifies the passed
diff --git a/crypto/x509/pcy_node.c b/crypto/x509/pcy_node.c
index 005d1de7e3..fc06a31c51 100644
--- a/crypto/x509/pcy_node.c
+++ b/crypto/x509/pcy_node.c
@@ -12,7 +12,7 @@
 #include <openssl/x509v3.h>
 #include <openssl/err.h>
 
-#include "pcy_int.h"
+#include "pcy_local.h"
 
 static int node_cmp(const X509_POLICY_NODE *const *a,
                     const X509_POLICY_NODE *const *b)
diff --git a/crypto/x509/pcy_tree.c b/crypto/x509/pcy_tree.c
index 5d4c6bd839..8ab0914373 100644
--- a/crypto/x509/pcy_tree.c
+++ b/crypto/x509/pcy_tree.c
@@ -12,7 +12,7 @@
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
 
-#include "pcy_int.h"
+#include "pcy_local.h"
 
 static void expected_print(BIO *channel,
                            X509_POLICY_LEVEL *lev, X509_POLICY_NODE *node,
diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c
index 3367228829..4969bb34bf 100644
--- a/crypto/x509/t_x509.c
+++ b/crypto/x509/t_x509.c
@@ -14,7 +14,7 @@
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 
 #ifndef OPENSSL_NO_STDIO
 int X509_print_fp(FILE *fp, X509 *x)
diff --git a/crypto/x509/v3_addr.c b/crypto/x509/v3_addr.c
index 9e6bffed28..a33dd9990d 100644
--- a/crypto/x509/v3_addr.c
+++ b/crypto/x509/v3_addr.c
@@ -20,7 +20,7 @@
 #include <openssl/asn1t.h>
 #include <openssl/buffer.h>
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include "ext_dat.h"
 
 #ifndef OPENSSL_NO_RFC3779
diff --git a/crypto/x509/v3_admis.c b/crypto/x509/v3_admis.c
index d6e4bc4166..104b58f259 100644
--- a/crypto/x509/v3_admis.c
+++ b/crypto/x509/v3_admis.c
@@ -9,7 +9,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/conf.h>
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 
diff --git a/crypto/x509/v3_admis.h b/crypto/x509/v3_admis.h
index 9d1535c3ae..1e82c0f4a3 100644
--- a/crypto/x509/v3_admis.h
+++ b/crypto/x509/v3_admis.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_V3_ADMISSION_H
-# define HEADER_V3_ADMISSION_H
+#ifndef OSSL_CRYPTO_X509_V3_ADMIS_H
+# define OSSL_CRYPTO_X509_V3_ADMIS_H
 
 struct NamingAuthority_st {
     ASN1_OBJECT* namingAuthorityId;
diff --git a/crypto/x509/v3_asid.c b/crypto/x509/v3_asid.c
index 2287675005..dfd48f7331 100644
--- a/crypto/x509/v3_asid.c
+++ b/crypto/x509/v3_asid.c
@@ -20,7 +20,7 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/bn.h>
 #include "ext_dat.h"
 
diff --git a/crypto/x509/v3_conf.c b/crypto/x509/v3_conf.c
index b7b74c4f25..47b1cfc90b 100644
--- a/crypto/x509/v3_conf.c
+++ b/crypto/x509/v3_conf.c
@@ -10,11 +10,11 @@
 /* extension creation utilities */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/conf.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/x509v3.h>
 
 static int v3_check_critical(const char **value);
diff --git a/crypto/x509/v3_cpols.c b/crypto/x509/v3_cpols.c
index 595de62361..f9a239b6f2 100644
--- a/crypto/x509/v3_cpols.c
+++ b/crypto/x509/v3_cpols.c
@@ -14,7 +14,7 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
 
-#include "pcy_int.h"
+#include "pcy_local.h"
 #include "ext_dat.h"
 
 /* Certificate policies extension support: this one is a bit complex... */
diff --git a/crypto/x509/v3_crld.c b/crypto/x509/v3_crld.c
index 766bf0e5c8..c3517b817c 100644
--- a/crypto/x509/v3_crld.c
+++ b/crypto/x509/v3_crld.c
@@ -14,7 +14,7 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509v3.h>
 
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include "ext_dat.h"
 
 static void *v2i_crld(const X509V3_EXT_METHOD *method,
diff --git a/crypto/x509/v3_ncons.c b/crypto/x509/v3_ncons.c
index 9a8ca16685..3be0c05fce 100644
--- a/crypto/x509/v3_ncons.c
+++ b/crypto/x509/v3_ncons.c
@@ -10,13 +10,13 @@
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
 #include <stdio.h>
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 #include <openssl/asn1t.h>
 #include <openssl/conf.h>
 #include <openssl/x509v3.h>
 #include <openssl/bn.h>
 
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include "ext_dat.h"
 
 static void *v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method,
diff --git a/crypto/x509/v3_purp.c b/crypto/x509/v3_purp.c
index 40f976bdda..3248e286ae 100644
--- a/crypto/x509/v3_purp.c
+++ b/crypto/x509/v3_purp.c
@@ -12,7 +12,7 @@
 #include "internal/numbers.h"
 #include <openssl/x509v3.h>
 #include <openssl/x509_vfy.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include "internal/tsan_assist.h"
 
 static void x509v3_cache_extensions(X509 *x);
diff --git a/crypto/x509/v3_skey.c b/crypto/x509/v3_skey.c
index f8a780d916..c69975f6af 100644
--- a/crypto/x509/v3_skey.c
+++ b/crypto/x509/v3_skey.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include "ext_dat.h"
 
 static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method,
diff --git a/crypto/x509/v3_utl.c b/crypto/x509/v3_utl.c
index 24f50a13b7..1516d988f0 100644
--- a/crypto/x509/v3_utl.c
+++ b/crypto/x509/v3_utl.c
@@ -12,11 +12,11 @@
 #include "e_os.h"
 #include "internal/cryptlib.h"
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include <openssl/conf.h>
 #include <openssl/crypto.h>
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/bn.h>
 #include "ext_dat.h"
 
diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c
index 317a45a4fa..c8b2d0f8a8 100644
--- a/crypto/x509/x509_att.c
+++ b/crypto/x509/x509_att.c
@@ -15,7 +15,7 @@
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)
 {
diff --git a/crypto/x509/x509_cmp.c b/crypto/x509/x509_cmp.c
index d7bbbc1947..f208cd6a04 100644
--- a/crypto/x509/x509_cmp.c
+++ b/crypto/x509/x509_cmp.c
@@ -13,7 +13,7 @@
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b)
 {
diff --git a/crypto/x509/x509_ext.c b/crypto/x509/x509_ext.c
index e13be607df..a7b85857bd 100644
--- a/crypto/x509/x509_ext.c
+++ b/crypto/x509/x509_ext.c
@@ -13,7 +13,7 @@
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/x509v3.h>
 
 int X509_CRL_get_ext_count(const X509_CRL *x)
diff --git a/crypto/x509/x509_lcl.h b/crypto/x509/x509_local.h
similarity index 100%
rename from crypto/x509/x509_lcl.h
rename to crypto/x509/x509_local.h
diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c
index c81a00e0a7..016b4b304f 100644
--- a/crypto/x509/x509_lu.c
+++ b/crypto/x509/x509_lu.c
@@ -11,9 +11,9 @@
 #include "internal/cryptlib.h"
 #include "internal/refcount.h"
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/x509v3.h>
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method)
 {
diff --git a/crypto/x509/x509_meth.c b/crypto/x509/x509_meth.c
index 631cc8f03d..05e7f7e29e 100644
--- a/crypto/x509/x509_meth.c
+++ b/crypto/x509/x509_meth.c
@@ -14,8 +14,8 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
-#include <openssl/ossl_typ.h>
-#include "x509_lcl.h"
+#include <openssl/types.h>
+#include "x509_local.h"
 
 X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name)
 {
diff --git a/crypto/x509/x509_obj.c b/crypto/x509/x509_obj.c
index cb16de1f71..9d8f48d2ee 100644
--- a/crypto/x509/x509_obj.c
+++ b/crypto/x509/x509_obj.c
@@ -12,7 +12,7 @@
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/buffer.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 /*
  * Limit to ensure we don't overflow: much greater than
diff --git a/crypto/x509/x509_r2x.c b/crypto/x509/x509_r2x.c
index c45043a72e..d7dd3754f5 100644
--- a/crypto/x509/x509_r2x.c
+++ b/crypto/x509/x509_r2x.c
@@ -13,7 +13,7 @@
 #include <openssl/evp.h>
 #include <openssl/asn1.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
 
diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c
index b0176bc90b..9382f37a8a 100644
--- a/crypto/x509/x509_req.c
+++ b/crypto/x509/x509_req.c
@@ -14,7 +14,7 @@
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/objects.h>
 #include <openssl/buffer.h>
 #include <openssl/pem.h>
diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c
index 3dfe66440a..e325a57b29 100644
--- a/crypto/x509/x509_set.c
+++ b/crypto/x509/x509_set.c
@@ -15,9 +15,9 @@
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "internal/asn1_int.h"
-#include "internal/x509_int.h"
-#include "x509_lcl.h"
+#include "crypto/asn1.h"
+#include "crypto/x509.h"
+#include "x509_local.h"
 
 int X509_set_version(X509 *x, long version)
 {
diff --git a/crypto/x509/x509_trs.c b/crypto/x509/x509_trs.c
index 2347e55938..b6a45acbcd 100644
--- a/crypto/x509/x509_trs.c
+++ b/crypto/x509/x509_trs.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 static int tr_cmp(const X509_TRUST *const *a, const X509_TRUST *const *b);
 static void trtable_free(X509_TRUST *p);
diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c
index 68da09b806..715c3594d4 100644
--- a/crypto/x509/x509_v3.c
+++ b/crypto/x509/x509_v3.c
@@ -15,7 +15,7 @@
 #include <openssl/evp.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x)
 {
diff --git a/crypto/x509/x509_vfy.c b/crypto/x509/x509_vfy.c
index f337cd14cb..126df99142 100644
--- a/crypto/x509/x509_vfy.c
+++ b/crypto/x509/x509_vfy.c
@@ -12,7 +12,7 @@
 #include <errno.h>
 #include <limits.h>
 
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/crypto.h>
 #include <openssl/buffer.h>
@@ -22,8 +22,8 @@
 #include <openssl/x509v3.h>
 #include <openssl/objects.h>
 #include "internal/dane.h"
-#include "internal/x509_int.h"
-#include "x509_lcl.h"
+#include "crypto/x509.h"
+#include "x509_local.h"
 
 /* CRL score values */
 
diff --git a/crypto/x509/x509_vpm.c b/crypto/x509/x509_vpm.c
index 5fe0754e96..81a0ec997e 100644
--- a/crypto/x509/x509_vpm.c
+++ b/crypto/x509/x509_vpm.c
@@ -14,9 +14,9 @@
 #include <openssl/buffer.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 /* X509_VERIFY_PARAM functions */
 
diff --git a/crypto/x509/x509cset.c b/crypto/x509/x509cset.c
index ae447aa98f..f1992ddcf0 100644
--- a/crypto/x509/x509cset.c
+++ b/crypto/x509/x509cset.c
@@ -14,7 +14,7 @@
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 int X509_CRL_set_version(X509_CRL *x, long version)
 {
diff --git a/crypto/x509/x509name.c b/crypto/x509/x509name.c
index bf01450a1c..443ab42bdd 100644
--- a/crypto/x509/x509name.c
+++ b/crypto/x509/x509name.c
@@ -14,7 +14,7 @@
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len)
 {
diff --git a/crypto/x509/x509rset.c b/crypto/x509/x509rset.c
index 592466316d..3256ec2304 100644
--- a/crypto/x509/x509rset.c
+++ b/crypto/x509/x509rset.c
@@ -13,7 +13,7 @@
 #include <openssl/objects.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 int X509_REQ_set_version(X509_REQ *x, long version)
 {
diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c
index 392f47e8dc..43b29d3bc6 100644
--- a/crypto/x509/x_all.c
+++ b/crypto/x509/x_all.c
@@ -13,7 +13,7 @@
 #include <openssl/asn1.h>
 #include <openssl/evp.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/ocsp.h>
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
@@ -21,8 +21,8 @@
 
 #ifndef OPENSSL_NO_SM2
 
-# include "internal/asn1_int.h"
-# include "internal/evp_int.h"
+# include "crypto/asn1.h"
+# include "crypto/evp.h"
 
 static int common_verify_sm2(void *data, EVP_PKEY *pkey,
                              int mdnid, int pknid, int req)
diff --git a/crypto/x509/x_attrib.c b/crypto/x509/x_attrib.c
index e39429f275..b30234112f 100644
--- a/crypto/x509/x_attrib.c
+++ b/crypto/x509/x_attrib.c
@@ -12,7 +12,7 @@
 #include <openssl/objects.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 /*-
  * X509_ATTRIBUTE: this has the following form:
diff --git a/crypto/x509/x_crl.c b/crypto/x509/x_crl.c
index 3984f0147f..fdc059123f 100644
--- a/crypto/x509/x_crl.c
+++ b/crypto/x509/x_crl.c
@@ -11,9 +11,9 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 #include <openssl/x509v3.h>
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 static int X509_REVOKED_cmp(const X509_REVOKED *const *a,
                             const X509_REVOKED *const *b);
diff --git a/crypto/x509/x_exten.c b/crypto/x509/x_exten.c
index 6ed363d3b0..4e63b50caa 100644
--- a/crypto/x509/x_exten.c
+++ b/crypto/x509/x_exten.c
@@ -11,7 +11,7 @@
 #include <openssl/x509.h>
 #include <openssl/asn1.h>
 #include <openssl/asn1t.h>
-#include "x509_lcl.h"
+#include "x509_local.h"
 
 ASN1_SEQUENCE(X509_EXTENSION) = {
         ASN1_SIMPLE(X509_EXTENSION, object, ASN1_OBJECT),
diff --git a/crypto/x509/x_name.c b/crypto/x509/x_name.c
index 8fd6566b01..33faacf5dd 100644
--- a/crypto/x509/x_name.c
+++ b/crypto/x509/x_name.c
@@ -8,13 +8,13 @@
  */
 
 #include <stdio.h>
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
-#include "internal/asn1_int.h"
-#include "x509_lcl.h"
+#include "crypto/x509.h"
+#include "crypto/asn1.h"
+#include "x509_local.h"
 
 /*
  * Maximum length of X509_NAME: much larger than anything we should
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c
index d81f53844f..6e8540835f 100644
--- a/crypto/x509/x_pubkey.c
+++ b/crypto/x509/x_pubkey.c
@@ -11,9 +11,9 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/asn1_int.h"
-#include "internal/evp_int.h"
-#include "internal/x509_int.h"
+#include "crypto/asn1.h"
+#include "crypto/evp.h"
+#include "crypto/x509.h"
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
 
diff --git a/crypto/x509/x_req.c b/crypto/x509/x_req.c
index 5bda794a82..e9cc9ba41c 100644
--- a/crypto/x509/x_req.c
+++ b/crypto/x509/x_req.c
@@ -11,7 +11,7 @@
 #include "internal/cryptlib.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 /*-
  * X509_REQ_INFO is handled in an unusual way to get round
diff --git a/crypto/x509/x_x509.c b/crypto/x509/x_x509.c
index d91c2d24da..7b41ce0777 100644
--- a/crypto/x509/x_x509.c
+++ b/crypto/x509/x_x509.c
@@ -13,7 +13,7 @@
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 ASN1_SEQUENCE_enc(X509_CINF, enc, 0) = {
         ASN1_EXP_OPT(X509_CINF, version, ASN1_INTEGER, 0),
diff --git a/crypto/x509/x_x509a.c b/crypto/x509/x_x509a.c
index a29d3dfce8..18d09e300e 100644
--- a/crypto/x509/x_x509a.c
+++ b/crypto/x509/x_x509a.c
@@ -12,7 +12,7 @@
 #include <openssl/evp.h>
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
 
 /*
  * X509_CERT_AUX routines. These are used to encode additional user
diff --git a/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod b/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod
index 60695266a7..8617c97581 100644
--- a/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod
+++ b/doc/internal/man3/DEFINE_SPARSE_ARRAY_OF.pod
@@ -11,7 +11,7 @@ ossl_sa_TYPE_doall_arg, ossl_sa_TYPE_get, ossl_sa_TYPE_set
 
 =for comment generic
 
- #include "internal/sparse_array.h"
+ #include "crypto/sparse_array.h"
 
  typedef struct sparse_array_st OPENSSL_SA;
 
diff --git a/doc/internal/man3/evp_generic_fetch.pod b/doc/internal/man3/evp_generic_fetch.pod
index 738c501560..4c12158317 100644
--- a/doc/internal/man3/evp_generic_fetch.pod
+++ b/doc/internal/man3/evp_generic_fetch.pod
@@ -8,7 +8,7 @@ evp_generic_fetch, evp_generic_fetch_by_number
 =head1 SYNOPSIS
 
  /* Only for EVP source */
- #include "evp_locl.h"
+ #include "evp_local.h"
 
  void *evp_generic_fetch(OPENSSL_CTX *libctx, int operation_id,
                          const char *name, const char *properties,
diff --git a/doc/internal/man3/evp_keymgmt_export_to_provider.pod b/doc/internal/man3/evp_keymgmt_export_to_provider.pod
index 72b766fb93..2cb40940b4 100644
--- a/doc/internal/man3/evp_keymgmt_export_to_provider.pod
+++ b/doc/internal/man3/evp_keymgmt_export_to_provider.pod
@@ -8,7 +8,7 @@ evp_keymgmt_clear_pkey_cache
 
 =head1 SYNOPSIS
 
- #include "internal/evp_int.h"
+ #include "crypto/evp.h"
 
  void *evp_keymgmt_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
  void evp_keymgmt_clear_pkey_cache(EVP_PKEY *pk);
diff --git a/doc/internal/man3/evp_keymgmt_freekey.pod b/doc/internal/man3/evp_keymgmt_freekey.pod
index 597c34b6d4..8be73aee81 100644
--- a/doc/internal/man3/evp_keymgmt_freekey.pod
+++ b/doc/internal/man3/evp_keymgmt_freekey.pod
@@ -14,7 +14,7 @@ evp_keymgmt_importkey_types, evp_keymgmt_exportkey_types
 
 =head1 SYNOPSIS
 
- #include "internal/evp_int.h"
+ #include "crypto/evp.h"
 
  void *evp_keymgmt_importdomparams(const EVP_KEYMGMT *keymgmt,
                                 const OSSL_PARAM params[]);
diff --git a/doc/internal/man3/openssl_ctx_get_data.pod b/doc/internal/man3/openssl_ctx_get_data.pod
index 11eb1484d7..6fd7c6336e 100644
--- a/doc/internal/man3/openssl_ctx_get_data.pod
+++ b/doc/internal/man3/openssl_ctx_get_data.pod
@@ -7,7 +7,7 @@ openssl_ctx_get_data, openssl_ctx_run_once, openssl_ctx_onfree
 
 =head1 SYNOPSIS
 
- #include <openssl/ossl_typ.h>
+ #include <openssl/types.h>
  #include "internal/cryptlib.h"
 
  typedef struct openssl_ctx_method {
diff --git a/doc/internal/man3/ossl_cmp_asn1_octet_string_set1.pod b/doc/internal/man3/ossl_cmp_asn1_octet_string_set1.pod
index 5a9f99f116..83a6d94929 100644
--- a/doc/internal/man3/ossl_cmp_asn1_octet_string_set1.pod
+++ b/doc/internal/man3/ossl_cmp_asn1_octet_string_set1.pod
@@ -13,7 +13,7 @@ ossl_cmp_build_cert_chain
 
 =head1 SYNOPSIS
 
- #include "cmp_int.h"
+ #include "cmp_local.h"
 
  const char *ossl_cmp_log_parse_metadata(const char *buf,
                                          OSSL_CMP_severity *level, char **func,
diff --git a/doc/internal/man3/ossl_init_thread_deregister.pod b/doc/internal/man3/ossl_init_thread_deregister.pod
index ccfb419731..923b525477 100644
--- a/doc/internal/man3/ossl_init_thread_deregister.pod
+++ b/doc/internal/man3/ossl_init_thread_deregister.pod
@@ -9,7 +9,7 @@ ossl_init_thread_deregister
 
 =head1 SYNOPSIS
 
- #include "internal/cryptlib_int.h"
+ #include "crypto/cryptlib.h"
  #include <openssl/core.h>
 
  typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
diff --git a/doc/internal/man3/rand_bytes_ex.pod b/doc/internal/man3/rand_bytes_ex.pod
index cf54e02a31..e1bb0f04df 100644
--- a/doc/internal/man3/rand_bytes_ex.pod
+++ b/doc/internal/man3/rand_bytes_ex.pod
@@ -7,7 +7,7 @@ rand_bytes_ex, rand_priv_bytes_ex
 
 =head1 SYNOPSIS
 
- #include "internal/rand_int.h"
+ #include "crypto/rand.h"
 
  int rand_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
  int rand_priv_bytes_ex(OPENSSL_CTX *ctx, unsigned char *buf, int num);
diff --git a/e_os.h b/e_os.h
index 6cd7476296..6ae3b2cca1 100644
--- a/e_os.h
+++ b/e_os.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_E_OS_H
-# define HEADER_E_OS_H
+#ifndef OSSL_E_OS_H
+# define OSSL_E_OS_H
 
 # include <limits.h>
 # include <openssl/opensslconf.h>
diff --git a/engines/e_afalg.h b/engines/e_afalg.h
index 42b48301ac..b8e4911d21 100644
--- a/engines/e_afalg.h
+++ b/engines/e_afalg.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_AFALG_H
-# define HEADER_AFALG_H
+#ifndef OSSL_ENGINES_E_AFALG_H
+# define OSSL_ENGINES_E_AFALG_H
 
 # if defined(__GNUC__) && __GNUC__ >= 4 && \
      (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L)
diff --git a/engines/e_afalg_err.h b/engines/e_afalg_err.h
index 27cdcd3ebf..371723535b 100644
--- a/engines/e_afalg_err.h
+++ b/engines/e_afalg_err.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_AFALGERR_H
-# define HEADER_AFALGERR_H
+#ifndef OSSL_ENGINES_E_AFALG_ERR_H
+# define OSSL_ENGINES_E_AFALG_ERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/engines/e_capi_err.h b/engines/e_capi_err.h
index a9389ecf96..048b6d171a 100644
--- a/engines/e_capi_err.h
+++ b/engines/e_capi_err.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CAPIERR_H
-# define HEADER_CAPIERR_H
+#ifndef OSSL_ENGINES_E_CAPI_ERR_H
+# define OSSL_ENGINES_E_CAPI_ERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/engines/e_dasync_err.h b/engines/e_dasync_err.h
index 907ba88c16..a9db187f1d 100644
--- a/engines/e_dasync_err.h
+++ b/engines/e_dasync_err.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DASYNCERR_H
-# define HEADER_DASYNCERR_H
+#ifndef OSSL_ENGINES_E_DASYNC_ERR_H
+# define OSSL_ENGINES_E_DASYNC_ERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/engines/e_ossltest_err.h b/engines/e_ossltest_err.h
index b575a80ada..70a0bc667f 100644
--- a/engines/e_ossltest_err.h
+++ b/engines/e_ossltest_err.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OSSLTESTERR_H
-# define HEADER_OSSLTESTERR_H
+#ifndef OSSL_ENGINES_E_OSSLTEST_ERR_H
+# define OSSL_ENGINES_E_OSSLTEST_ERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/crypto/include/internal/__DECC_INCLUDE_EPILOGUE.H b/include/crypto/__DECC_INCLUDE_EPILOGUE.H
similarity index 100%
rename from crypto/include/internal/__DECC_INCLUDE_EPILOGUE.H
rename to include/crypto/__DECC_INCLUDE_EPILOGUE.H
diff --git a/crypto/include/internal/__DECC_INCLUDE_PROLOGUE.H b/include/crypto/__DECC_INCLUDE_PROLOGUE.H
similarity index 100%
rename from crypto/include/internal/__DECC_INCLUDE_PROLOGUE.H
rename to include/crypto/__DECC_INCLUDE_PROLOGUE.H
diff --git a/crypto/include/internal/aria.h b/include/crypto/aria.h
similarity index 96%
rename from crypto/include/internal/aria.h
rename to include/crypto/aria.h
index 4bfbd5a74a..3bbb30ef3e 100644
--- a/crypto/include/internal/aria.h
+++ b/include/crypto/aria.h
@@ -10,8 +10,8 @@
 
  /* Copyright (c) 2017 National Security Research Institute.  All rights reserved. */
 
-#ifndef HEADER_ARIA_H
-# define HEADER_ARIA_H
+#ifndef OSSL_CRYPTO_ARIA_H
+# define OSSL_CRYPTO_ARIA_H
 
 # include <openssl/opensslconf.h>
 
diff --git a/crypto/include/internal/asn1_int.h b/include/crypto/asn1.h
similarity index 100%
rename from crypto/include/internal/asn1_int.h
rename to include/crypto/asn1.h
diff --git a/crypto/include/internal/asn1_dsa.h b/include/crypto/asn1_dsa.h
similarity index 92%
rename from crypto/include/internal/asn1_dsa.h
rename to include/crypto/asn1_dsa.h
index d2570516a1..caf0349968 100644
--- a/crypto/include/internal/asn1_dsa.h
+++ b/include/crypto/asn1_dsa.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ASN1_DSA_H
-# define HEADER_ASN1_DSA_H
+#ifndef OSSL_CRYPTO_ASN1_DSA_H
+# define OSSL_CRYPTO_ASN1_DSA_H
 
 #include "internal/packet.h"
 
diff --git a/crypto/include/internal/async.h b/include/crypto/async.h
similarity index 100%
rename from crypto/include/internal/async.h
rename to include/crypto/async.h
diff --git a/crypto/include/internal/bn_int.h b/include/crypto/bn.h
similarity index 98%
rename from crypto/include/internal/bn_int.h
rename to include/crypto/bn.h
index cb8b17662a..91c6cd5dcc 100644
--- a/crypto/include/internal/bn_int.h
+++ b/include/crypto/bn.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BN_INT_H
-# define HEADER_BN_INT_H
+#ifndef OSSL_CRYPTO_BN_H
+# define OSSL_CRYPTO_BN_H
 
 # include <openssl/bn.h>
 # include <limits.h>
diff --git a/crypto/include/internal/bn_conf.h.in b/include/crypto/bn_conf.h.in
similarity index 93%
rename from crypto/include/internal/bn_conf.h.in
rename to include/crypto/bn_conf.h.in
index 9061d20d82..c8fdf36cae 100644
--- a/crypto/include/internal/bn_conf.h.in
+++ b/include/crypto/bn_conf.h.in
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BN_CONF_H
-# define HEADER_BN_CONF_H
+#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
diff --git a/crypto/include/internal/bn_dh.h b/include/crypto/bn_dh.h
similarity index 100%
rename from crypto/include/internal/bn_dh.h
rename to include/crypto/bn_dh.h
diff --git a/crypto/include/internal/bn_srp.h b/include/crypto/bn_srp.h
similarity index 100%
rename from crypto/include/internal/bn_srp.h
rename to include/crypto/bn_srp.h
diff --git a/crypto/include/internal/chacha.h b/include/crypto/chacha.h
similarity index 96%
rename from crypto/include/internal/chacha.h
rename to include/crypto/chacha.h
index e095522c50..77cfd3b281 100644
--- a/crypto/include/internal/chacha.h
+++ b/include/crypto/chacha.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CHACHA_H
-#define HEADER_CHACHA_H
+#ifndef OSSL_CRYPTO_CHACHA_H
+#define OSSL_CRYPTO_CHACHA_H
 
 #include <stddef.h>
 
diff --git a/crypto/include/internal/ciphermode_platform.h b/include/crypto/ciphermode_platform.h
similarity index 99%
rename from crypto/include/internal/ciphermode_platform.h
rename to include/crypto/ciphermode_platform.h
index b16062fa93..b1868e1a6d 100644
--- a/crypto/include/internal/ciphermode_platform.h
+++ b/include/crypto/ciphermode_platform.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_INTERNAL_CIPHERMODE_PLATFORM_H
-# define HEADER_INTERNAL_CIPHERMODE_PLATFORM_H
+#ifndef OSSL_CRYPTO_CIPHERMODE_PLATFORM_H
+# define OSSL_CRYPTO_CIPHERMODE_PLATFORM_H
 
 # include "openssl/aes.h"
 
@@ -445,4 +445,4 @@ void HWAES_ocb_decrypt(const unsigned char *in, unsigned char *out,
 
 # endif /* HWAES_CAPABLE */
 
-#endif /* HEADER_INTERNAL_CIPHERMODE_PLATFORM_H */
+#endif /* OSSL_CRYPTO_CIPHERMODE_PLATFORM_H */
diff --git a/crypto/include/internal/cms_int.h b/include/crypto/cms.h
similarity index 100%
rename from crypto/include/internal/cms_int.h
rename to include/crypto/cms.h
diff --git a/crypto/include/internal/cryptlib_int.h b/include/crypto/cryptlib.h
similarity index 100%
rename from crypto/include/internal/cryptlib_int.h
rename to include/crypto/cryptlib.h
diff --git a/crypto/include/internal/ctype.h b/include/crypto/ctype.h
similarity index 98%
rename from crypto/include/internal/ctype.h
rename to include/crypto/ctype.h
index d0660cf9c4..f3ab678e14 100644
--- a/crypto/include/internal/ctype.h
+++ b/include/crypto/ctype.h
@@ -18,8 +18,8 @@
  * throughout the rest of the source code.  Refer to issue #4154 for
  * details.
  */
-#ifndef INTERNAL_CTYPE_H
-# define INTERNAL_CTYPE_H
+#ifndef OSSL_CRYPTO_CTYPE_H
+# define OSSL_CRYPTO_CTYPE_H
 
 # define CTYPE_MASK_lower       0x1
 # define CTYPE_MASK_upper       0x2
diff --git a/crypto/include/internal/dso_conf.h.in b/include/crypto/dso_conf.h.in
similarity index 95%
rename from crypto/include/internal/dso_conf.h.in
rename to include/crypto/dso_conf.h.in
index 9a373b2032..fd0e16b3f9 100644
--- a/crypto/include/internal/dso_conf.h.in
+++ b/include/crypto/dso_conf.h.in
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DSO_CONF_H
-# define HEADER_DSO_CONF_H
+#ifndef OSSL_CRYPTO_DSO_CONF_H
+# define OSSL_CRYPTO_DSO_CONF_H
 {-  # The DSO code currently always implements all functions so that no
     # applications will have to worry about that from a compilation point
     # of view. However, the "method"s may return zero unless that platform
diff --git a/crypto/include/internal/ec_int.h b/include/crypto/ec.h
similarity index 96%
rename from crypto/include/internal/ec_int.h
rename to include/crypto/ec.h
index 9d8882df2e..4a0a967629 100644
--- a/crypto/include/internal/ec_int.h
+++ b/include/crypto/ec.h
@@ -9,8 +9,8 @@
 
 /* Internal EC functions for other submodules: not for application use */
 
-#ifndef HEADER_OSSL_EC_INTERNAL_H
-# define HEADER_OSSL_EC_INTERNAL_H
+#ifndef OSSL_CRYPTO_EC_H
+# define OSSL_CRYPTO_EC_H
 # include <openssl/opensslconf.h>
 
 # ifndef OPENSSL_NO_EC
diff --git a/crypto/include/internal/engine.h b/include/crypto/engine.h
similarity index 100%
rename from crypto/include/internal/engine.h
rename to include/crypto/engine.h
diff --git a/crypto/include/internal/err_int.h b/include/crypto/err.h
similarity index 89%
rename from crypto/include/internal/err_int.h
rename to include/crypto/err.h
index 68c6d62e30..527f19667d 100644
--- a/crypto/include/internal/err_int.h
+++ b/include/crypto/err.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef INTERNAL_ERR_INT_H
-# define INTERNAL_ERR_INT_H
+#ifndef OSSL_CRYPTO_ERR_H
+# define OSSL_CRYPTO_ERR_H
 
 int err_load_crypto_strings_int(void);
 void err_cleanup(void);
diff --git a/crypto/include/internal/ess_int.h b/include/crypto/ess.h
similarity index 100%
rename from crypto/include/internal/ess_int.h
rename to include/crypto/ess.h
diff --git a/crypto/include/internal/evp_int.h b/include/crypto/evp.h
similarity index 100%
rename from crypto/include/internal/evp_int.h
rename to include/crypto/evp.h
diff --git a/crypto/include/internal/lhash.h b/include/crypto/lhash.h
similarity index 87%
rename from crypto/include/internal/lhash.h
rename to include/crypto/lhash.h
index de0c8b0408..9629936262 100644
--- a/crypto/include/internal/lhash.h
+++ b/include/crypto/lhash.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef INTERNAL_LHASH_H
-# define INTERNAL_LHASH_H
+#ifndef OSSL_CRYPTO_LHASH_H
+# define OSSL_CRYPTO_LHASH_H
 
 unsigned long openssl_lh_strcasehash(const char *);
 
diff --git a/crypto/include/internal/md32_common.h b/include/crypto/md32_common.h
similarity index 100%
rename from crypto/include/internal/md32_common.h
rename to include/crypto/md32_common.h
diff --git a/crypto/include/internal/modes_int.h b/include/crypto/modes.h
similarity index 100%
rename from crypto/include/internal/modes_int.h
rename to include/crypto/modes.h
diff --git a/crypto/include/internal/objects.h b/include/crypto/objects.h
similarity index 100%
rename from crypto/include/internal/objects.h
rename to include/crypto/objects.h
diff --git a/crypto/include/internal/poly1305.h b/include/crypto/poly1305.h
similarity index 100%
rename from crypto/include/internal/poly1305.h
rename to include/crypto/poly1305.h
diff --git a/crypto/include/internal/rand_int.h b/include/crypto/rand.h
similarity index 98%
rename from crypto/include/internal/rand_int.h
rename to include/crypto/rand.h
index bc427e3cf4..e808c30820 100644
--- a/crypto/include/internal/rand_int.h
+++ b/include/crypto/rand.h
@@ -15,8 +15,8 @@
  * or in the file LICENSE in the source distribution.
  */
 
-#ifndef HEADER_RAND_INT_H
-# define HEADER_RAND_INT_H
+#ifndef OSSL_CRYPTO_RAND_H
+# define OSSL_CRYPTO_RAND_H
 
 # include <openssl/rand.h>
 
diff --git a/crypto/include/internal/sha.h b/include/crypto/sha.h
similarity index 90%
rename from crypto/include/internal/sha.h
rename to include/crypto/sha.h
index 3863261563..57a3d20d0e 100644
--- a/crypto/include/internal/sha.h
+++ b/include/crypto/sha.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_INTERNAL_SHA_H
-# define HEADER_INTERNAL_SHA_H
+#ifndef OSSL_CRYPTO_SHA_H
+# define OSSL_CRYPTO_SHA_H
 
 # include <openssl/opensslconf.h>
 
diff --git a/crypto/include/internal/siphash.h b/include/crypto/siphash.h
similarity index 100%
rename from crypto/include/internal/siphash.h
rename to include/crypto/siphash.h
diff --git a/crypto/include/internal/siv_int.h b/include/crypto/siv.h
similarity index 100%
rename from crypto/include/internal/siv_int.h
rename to include/crypto/siv.h
diff --git a/crypto/include/internal/sm2.h b/include/crypto/sm2.h
similarity index 97%
rename from crypto/include/internal/sm2.h
rename to include/crypto/sm2.h
index dad70e6547..4a65ce4332 100644
--- a/crypto/include/internal/sm2.h
+++ b/include/crypto/sm2.h
@@ -9,8 +9,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SM2_H
-# define HEADER_SM2_H
+#ifndef OSSL_CRYPTO_SM2_H
+# define OSSL_CRYPTO_SM2_H
 # include <openssl/opensslconf.h>
 
 # ifndef OPENSSL_NO_SM2
diff --git a/crypto/include/internal/sm2err.h b/include/crypto/sm2err.h
similarity index 97%
rename from crypto/include/internal/sm2err.h
rename to include/crypto/sm2err.h
index 923bb6c4b8..3b86c38c3c 100644
--- a/crypto/include/internal/sm2err.h
+++ b/include/crypto/sm2err.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SM2ERR_H
-# define HEADER_SM2ERR_H
+#ifndef OSSL_CRYPTO_SM2ERR_H
+# define OSSL_CRYPTO_SM2ERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/crypto/include/internal/sm4.h b/include/crypto/sm4.h
similarity index 94%
rename from crypto/include/internal/sm4.h
rename to include/crypto/sm4.h
index f2e1728773..fb5253d857 100644
--- a/crypto/include/internal/sm4.h
+++ b/include/crypto/sm4.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SM4_H
-# define HEADER_SM4_H
+#ifndef OSSL_CRYPTO_SM4_H
+# define OSSL_CRYPTO_SM4_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/e_os2.h>
diff --git a/crypto/include/internal/sparse_array.h b/include/crypto/sparse_array.h
similarity index 97%
rename from crypto/include/internal/sparse_array.h
rename to include/crypto/sparse_array.h
index 037ccfeee9..a8031cd3f1 100644
--- a/crypto/include/internal/sparse_array.h
+++ b/include/crypto/sparse_array.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SPARSE_ARRAY_H
-# define HEADER_SPARSE_ARRAY_H
+#ifndef OSSL_CRYPTO_SPARSE_ARRAY_H
+# define OSSL_CRYPTO_SPARSE_ARRAY_H
 
 # include <openssl/e_os2.h>
 
diff --git a/crypto/include/internal/store_int.h b/include/crypto/store.h
similarity index 82%
rename from crypto/include/internal/store_int.h
rename to include/crypto/store.h
index 67f2526261..8f4757d9c2 100644
--- a/crypto/include/internal/store_int.h
+++ b/include/crypto/store.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2019 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
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_STORE_INT_H
-# define HEADER_STORE_INT_H
+#ifndef OSSL_CRYPTO_STORE_H
+# define OSSL_CRYPTO_STORE_H
 
 # include <openssl/bio.h>
 # include <openssl/store.h>
@@ -23,4 +23,6 @@ OSSL_STORE_CTX *ossl_store_attach_pem_bio(BIO *bp, const UI_METHOD *ui_method,
                                           void *ui_data);
 int ossl_store_detach_pem_bio(OSSL_STORE_CTX *ctx);
 
+void ossl_store_cleanup_int(void);
+
 #endif
diff --git a/crypto/include/internal/x509_int.h b/include/crypto/x509.h
similarity index 100%
rename from crypto/include/internal/x509_int.h
rename to include/crypto/x509.h
diff --git a/include/internal/bio.h b/include/internal/bio.h
index 8f368e36b3..2fb0d5cb76 100644
--- a/include/internal/bio.h
+++ b/include/internal/bio.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_INTERNAL_BIO_H
-# define HEADER_INTERNAL_BIO_H
+#ifndef OSSL_INTERNAL_BIO_H
+# define OSSL_INTERNAL_BIO_H
 
 #include <openssl/bio.h>
 
diff --git a/include/internal/conf.h b/include/internal/conf.h
index 389cdfd75b..1e7ab2cedf 100644
--- a/include/internal/conf.h
+++ b/include/internal/conf.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_INTERNAL_CONF_H
-# define HEADER_INTERNAL_CONF_H
+#ifndef OSSL_INTERNAL_CONF_H
+# define OSSL_INTERNAL_CONF_H
 
 #include <openssl/conf.h>
 
diff --git a/include/internal/constant_time_locl.h b/include/internal/constant_time.h
similarity index 98%
rename from include/internal/constant_time_locl.h
rename to include/internal/constant_time.h
index f7b264ee70..d98dae9545 100644
--- a/include/internal/constant_time_locl.h
+++ b/include/internal/constant_time.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CONSTANT_TIME_LOCL_H
-# define HEADER_CONSTANT_TIME_LOCL_H
+#ifndef OSSL_INTERNAL_CONSTANT_TIME_H
+# define OSSL_INTERNAL_CONSTANT_TIME_H
 
 # include <stdlib.h>
 # include <string.h>
@@ -384,4 +384,4 @@ static ossl_inline void constant_time_lookup(void *out,
  */
 void err_clear_last_constant_time(int clear);
 
-#endif                          /* HEADER_CONSTANT_TIME_LOCL_H */
+#endif                          /* OSSL_INTERNAL_CONSTANT_TIME_H */
diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h
index cfac74a328..f17816425d 100644
--- a/include/internal/cryptlib.h
+++ b/include/internal/cryptlib.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CRYPTLIB_H
-# define HEADER_CRYPTLIB_H
+#ifndef OSSL_INTERNAL_CRYPTLIB_H
+# define OSSL_INTERNAL_CRYPTLIB_H
 
 # include <stdlib.h>
 # include <string.h>
diff --git a/include/internal/dane.h b/include/internal/dane.h
index 9a6432dad0..d9bae2b9f7 100644
--- a/include/internal/dane.h
+++ b/include/internal/dane.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_INTERNAL_DANE_H
-#define HEADER_INTERNAL_DANE_H
+#ifndef OSSL_INTERNAL_DANE_H
+#define OSSL_INTERNAL_DANE_H
 
 #include <openssl/safestack.h>
 
@@ -100,4 +100,4 @@ struct ssl_dane_st {
 #define DANETLS_HAS_DANE_TA(dane) ((dane)&&((dane)->umask & DANETLS_DANE_TA_MASK))
 #define DANETLS_HAS_DANE_EE(dane) ((dane)&&((dane)->umask & DANETLS_DANE_EE_MASK))
 
-#endif /* HEADER_INTERNAL_DANE_H */
+#endif /* OSSL_INTERNAL_DANE_H */
diff --git a/include/internal/dso.h b/include/internal/dso.h
index 63881beffb..76cb3c6e0a 100644
--- a/include/internal/dso.h
+++ b/include/internal/dso.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DSO_H
-# define HEADER_DSO_H
+#ifndef OSSL_INTERNAL_DSO_H
+# define OSSL_INTERNAL_DSO_H
 
 # include <openssl/crypto.h>
 # include "internal/dsoerr.h"
diff --git a/include/internal/dsoerr.h b/include/internal/dsoerr.h
index da51e5f6fd..9ddb9cff4d 100644
--- a/include/internal/dsoerr.h
+++ b/include/internal/dsoerr.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DSOERR_H
-# define HEADER_DSOERR_H
+#ifndef OSSL_INTERNAL_DSOERR_H
+# define OSSL_INTERNAL_DSOERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/internal/err.h b/include/internal/err.h
index 15511c7bec..8cb72ae370 100644
--- a/include/internal/err.h
+++ b/include/internal/err.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef INTERNAL_ERR_H
-# define INTERNAL_ERR_H
+#ifndef OSSL_INTERNAL_ERR_H
+# define OSSL_INTERNAL_ERR_H
 
 void err_free_strings_int(void);
 
diff --git a/include/internal/md5_sha1.h b/include/internal/md5_sha1.h
index 0f1f7350fb..3e80fdcf97 100644
--- a/include/internal/md5_sha1.h
+++ b/include/internal/md5_sha1.h
@@ -8,8 +8,8 @@
  */
 
 /* TODO(3.0) Move this header into provider when dependencies are removed */
-#ifndef HEADER_MD5_SHA1_H
-# define HEADER_MD5_SHA1_H
+#ifndef OSSL_INTERNAL_MD5_SHA1_H
+# define OSSL_INTERNAL_MD5_SHA1_H
 
 # include <openssl/opensslconf.h>
 
@@ -34,4 +34,4 @@ int md5_sha1_ctrl(MD5_SHA1_CTX *mctx, int cmd, int mslen, void *ms);
 
 # endif /* OPENSSL_NO_MD5 */
 
-#endif /* HEADER_MD5_SHA1_H */
+#endif /* OSSL_INTERNAL_MD5_SHA1_H */
diff --git a/include/internal/nelem.h b/include/internal/nelem.h
index e599242508..0c32483fc5 100644
--- a/include/internal/nelem.h
+++ b/include/internal/nelem.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_NELEM_H
-# define HEADER_NELEM_H
+#ifndef OSSL_INTERNAL_NELEM_H
+# define OSSL_INTERNAL_NELEM_H
 
 # define OSSL_NELEM(x)    (sizeof(x)/sizeof((x)[0]))
 #endif
diff --git a/include/internal/numbers.h b/include/internal/numbers.h
index f3c6bbc970..db65559c6b 100644
--- a/include/internal/numbers.h
+++ b/include/internal/numbers.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_NUMBERS_H
-# define HEADER_NUMBERS_H
+#ifndef OSSL_INTERNAL_NUMBERS_H
+# define OSSL_INTERNAL_NUMBERS_H
 
 # include <limits.h>
 
diff --git a/include/internal/o_dir.h b/include/internal/o_dir.h
index 72cdb5530c..220cf173e6 100644
--- a/include/internal/o_dir.h
+++ b/include/internal/o_dir.h
@@ -36,8 +36,8 @@
  * SUCH DAMAGE.
  */
 
-#ifndef O_DIR_H
-# define O_DIR_H
+#ifndef OSSL_INTERNAL_O_DIR_H
+# define OSSL_INTERNAL_O_DIR_H
 
 typedef struct OPENSSL_dir_context_st OPENSSL_DIR_CTX;
 
diff --git a/include/internal/packet.h b/include/internal/packet.h
index 69a6bd1308..c03d917da7 100644
--- a/include/internal/packet.h
+++ b/include/internal/packet.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PACKET_LOCL_H
-# define HEADER_PACKET_LOCL_H
+#ifndef OSSL_INTERNAL_PACKET_H
+# define OSSL_INTERNAL_PACKET_H
 
 # include <string.h>
 # include <openssl/bn.h>
@@ -881,4 +881,4 @@ int WPACKET_is_null_buf(WPACKET *pkt);
 /* Release resources in a WPACKET if a failure has occurred. */
 void WPACKET_cleanup(WPACKET *pkt);
 
-#endif                          /* HEADER_PACKET_LOCL_H */
+#endif                          /* OSSL_INTERNAL_PACKET_H */
diff --git a/include/internal/param_build.h b/include/internal/param_build.h
index bb96ba98e0..a5297b843d 100644
--- a/include/internal/param_build.h
+++ b/include/internal/param_build.h
@@ -9,7 +9,7 @@
  */
 
 #include <openssl/params.h>
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 
 #define OSSL_PARAM_BLD_MAX 10
 
diff --git a/include/internal/property.h b/include/internal/property.h
index 842c7dea17..a3a4a62be6 100644
--- a/include/internal/property.h
+++ b/include/internal/property.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PROPERTY_H
-# define HEADER_PROPERTY_H
+#ifndef OSSL_INTERNAL_PROPERTY_H
+# define OSSL_INTERNAL_PROPERTY_H
 
 #include "internal/cryptlib.h"
 
diff --git a/include/internal/propertyerr.h b/include/internal/propertyerr.h
index a5d5125770..ebbd8619b2 100644
--- a/include/internal/propertyerr.h
+++ b/include/internal/propertyerr.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PROPERR_H
-# define HEADER_PROPERR_H
+#ifndef OSSL_INTERNAL_PROPERTYERR_H
+# define OSSL_INTERNAL_PROPERTYERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/internal/refcount.h b/include/internal/refcount.h
index 1619b28932..4feecf971c 100644
--- a/include/internal/refcount.h
+++ b/include/internal/refcount.h
@@ -6,8 +6,8 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
-#ifndef HEADER_INTERNAL_REFCOUNT_H
-# define HEADER_INTERNAL_REFCOUNT_H
+#ifndef OSSL_INTERNAL_REFCOUNT_H
+# define OSSL_INTERNAL_REFCOUNT_H
 
 /* Used to checking reference counts, most while doing perl5 stuff :-) */
 # if defined(OPENSSL_NO_STDIO)
diff --git a/include/internal/sha3.h b/include/internal/sha3.h
index b07d50c6c2..81ba41ac0d 100644
--- a/include/internal/sha3.h
+++ b/include/internal/sha3.h
@@ -8,8 +8,8 @@
  */
 
 /* TODO(3.0) Move this header into provider when dependencies are removed */
-#ifndef HEADER_INTERNAL_SHA3_H
-# define HEADER_INTERNAL_SHA3_H
+#ifndef OSSL_INTERNAL_SHA3_H
+# define OSSL_INTERNAL_SHA3_H
 
 # include <openssl/e_os2.h>
 # include <stddef.h>
@@ -49,4 +49,4 @@ int sha3_final(unsigned char *md, KECCAK1600_CTX *ctx);
 size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
                    size_t r);
 
-#endif /* HEADER_INTERNAL_SHA3_H */
+#endif /* OSSL_INTERNAL_SHA3_H */
diff --git a/include/internal/sm3.h b/include/internal/sm3.h
index 2aef712e6a..51bb265fff 100644
--- a/include/internal/sm3.h
+++ b/include/internal/sm3.h
@@ -9,8 +9,8 @@
  */
 
 /* TODO(3.0) Move this header into provider when dependencies are removed */
-#ifndef HEADER_SM3_H
-# define HEADER_SM3_H
+#ifndef OSSL_INTERNAL_SM3_H
+# define OSSL_INTERNAL_SM3_H
 
 # include <openssl/opensslconf.h>
 
@@ -35,4 +35,4 @@ int sm3_init(SM3_CTX *c);
 int sm3_update(SM3_CTX *c, const void *data, size_t len);
 int sm3_final(unsigned char *md, SM3_CTX *c);
 
-#endif /* HEADER_SM3_H */
+#endif /* OSSL_INTERNAL_SM3_H */
diff --git a/include/internal/sockets.h b/include/internal/sockets.h
index 8e84f0b0f7..e444766dec 100644
--- a/include/internal/sockets.h
+++ b/include/internal/sockets.h
@@ -8,8 +8,8 @@
  */
 
 
-#ifndef HEADER_INTERNAL_SOCKETS
-# define HEADER_INTERNAL_SOCKETS
+#ifndef OSSL_INTERNAL_SOCKETS_H
+# define OSSL_INTERNAL_SOCKETS_H
 
 # if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
 #  define NO_SYS_PARAM_H
diff --git a/include/internal/sslconf.h b/include/internal/sslconf.h
index 94e6724e61..9e635da98a 100644
--- a/include/internal/sslconf.h
+++ b/include/internal/sslconf.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSLCONF_H
-# define HEADER_SSLCONF_H
+#ifndef OSSL_INTERNAL_SSLCONF_H
+# define OSSL_INTERNAL_SSLCONF_H
 
 typedef struct ssl_conf_cmd_st SSL_CONF_CMD;
 
diff --git a/include/openssl/aes.h b/include/openssl/aes.h
index 060aa0f67c..4e93d3dc93 100644
--- a/include/openssl/aes.h
+++ b/include/openssl/aes.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_AES_H
-# define HEADER_AES_H
+#ifndef OPENSSL_AES_H
+# define OPENSSL_AES_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_AES_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h
index 3268db1744..32d39c14a6 100644
--- a/include/openssl/asn1.h
+++ b/include/openssl/asn1.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ASN1_H
-# define HEADER_ASN1_H
+#ifndef OPENSSL_ASN1_H
+# define OPENSSL_ASN1_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ASN1_H
+# endif
 
 # include <time.h>
 # include <openssl/e_os2.h>
@@ -18,7 +24,7 @@
 # include <openssl/asn1err.h>
 # include <openssl/symhacks.h>
 
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # if !OPENSSL_API_1_1_0
 #  include <openssl/bn.h>
 # endif
diff --git a/include/openssl/asn1err.h b/include/openssl/asn1err.h
index d2d271b995..9166f17142 100644
--- a/include/openssl/asn1err.h
+++ b/include/openssl/asn1err.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ASN1ERR_H
-# define HEADER_ASN1ERR_H
+#ifndef OPENSSL_ASN1ERR_H
+# define OPENSSL_ASN1ERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ASN1ERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/asn1t.h b/include/openssl/asn1t.h
index 568b347ce2..00ccdf5156 100644
--- a/include/openssl/asn1t.h
+++ b/include/openssl/asn1t.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ASN1T_H
-# define HEADER_ASN1T_H
+#ifndef OPENSSL_ASN1T_H
+# define OPENSSL_ASN1T_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ASN1T_H
+# endif
 
 # include <stddef.h>
 # include <openssl/e_os2.h>
diff --git a/include/openssl/async.h b/include/openssl/async.h
index 910c144c6b..e372e43c47 100644
--- a/include/openssl/async.h
+++ b/include/openssl/async.h
@@ -9,8 +9,14 @@
 
 #include <stdlib.h>
 
-#ifndef HEADER_ASYNC_H
-# define HEADER_ASYNC_H
+#ifndef OPENSSL_ASYNC_H
+# define OPENSSL_ASYNC_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ASYNC_H
+# endif
 
 #if defined(_WIN32)
 # if defined(BASETYPES) || defined(_WINDEF_H)
diff --git a/include/openssl/asyncerr.h b/include/openssl/asyncerr.h
index 9612190400..8e8c66fc52 100644
--- a/include/openssl/asyncerr.h
+++ b/include/openssl/asyncerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ASYNCERR_H
-# define HEADER_ASYNCERR_H
+#ifndef OPENSSL_ASYNCERR_H
+# define OPENSSL_ASYNCERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ASYNCERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index 3e4fbd35b0..9fb8095014 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BIO_H
-# define HEADER_BIO_H
+#ifndef OPENSSL_BIO_H
+# define OPENSSL_BIO_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_BIO_H
+# endif
 
 # include <openssl/e_os2.h>
 
diff --git a/include/openssl/bioerr.h b/include/openssl/bioerr.h
index 79a6c9e676..2f4dd3394b 100644
--- a/include/openssl/bioerr.h
+++ b/include/openssl/bioerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BIOERR_H
-# define HEADER_BIOERR_H
+#ifndef OPENSSL_BIOERR_H
+# define OPENSSL_BIOERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_BIOERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/blowfish.h b/include/openssl/blowfish.h
index 2a6bda4edf..6532915200 100644
--- a/include/openssl/blowfish.h
+++ b/include/openssl/blowfish.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BLOWFISH_H
-# define HEADER_BLOWFISH_H
+#ifndef OPENSSL_BLOWFISH_H
+# define OPENSSL_BLOWFISH_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_BLOWFISH_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/bn.h b/include/openssl/bn.h
index ca92c0e408..12fbcdaccd 100644
--- a/include/openssl/bn.h
+++ b/include/openssl/bn.h
@@ -8,15 +8,21 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BN_H
-# define HEADER_BN_H
+#ifndef OPENSSL_BN_H
+# define OPENSSL_BN_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_BN_H
+# endif
 
 # include <openssl/e_os2.h>
 # ifndef OPENSSL_NO_STDIO
 #  include <stdio.h>
 # endif
 # include <openssl/opensslconf.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/crypto.h>
 # include <openssl/bnerr.h>
 
diff --git a/include/openssl/bnerr.h b/include/openssl/bnerr.h
index fa5398cf8c..a4b666f9cc 100644
--- a/include/openssl/bnerr.h
+++ b/include/openssl/bnerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BNERR_H
-# define HEADER_BNERR_H
+#ifndef OPENSSL_BNERR_H
+# define OPENSSL_BNERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_BNERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/buffer.h b/include/openssl/buffer.h
index 1413726383..c3cf216147 100644
--- a/include/openssl/buffer.h
+++ b/include/openssl/buffer.h
@@ -7,11 +7,17 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BUFFER_H
-# define HEADER_BUFFER_H
+#ifndef OPENSSL_BUFFER_H
+# define OPENSSL_BUFFER_H
+# pragma once
 
-# include <openssl/ossl_typ.h>
-# ifndef HEADER_CRYPTO_H
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_BUFFER_H
+# endif
+
+# include <openssl/types.h>
+# ifndef OPENSSL_CRYPTO_H
 #  include <openssl/crypto.h>
 # endif
 # include <openssl/buffererr.h>
diff --git a/include/openssl/buffererr.h b/include/openssl/buffererr.h
index 64081234b9..fbe0d99843 100644
--- a/include/openssl/buffererr.h
+++ b/include/openssl/buffererr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_BUFERR_H
-# define HEADER_BUFERR_H
+#ifndef OPENSSL_BUFFERERR_H
+# define OPENSSL_BUFFERERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_BUFERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/camellia.h b/include/openssl/camellia.h
index 42c557a739..23605cf393 100644
--- a/include/openssl/camellia.h
+++ b/include/openssl/camellia.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CAMELLIA_H
-# define HEADER_CAMELLIA_H
+#ifndef OPENSSL_CAMELLIA_H
+# define OPENSSL_CAMELLIA_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CAMELLIA_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/cast.h b/include/openssl/cast.h
index 5656ecd2c7..a1aad6bda3 100644
--- a/include/openssl/cast.h
+++ b/include/openssl/cast.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CAST_H
-# define HEADER_CAST_H
+#ifndef OPENSSL_CAST_H
+# define OPENSSL_CAST_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CAST_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/cmac.h b/include/openssl/cmac.h
index 029b3e2f36..426536fa35 100644
--- a/include/openssl/cmac.h
+++ b/include/openssl/cmac.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CMAC_H
-# define HEADER_CMAC_H
+#ifndef OPENSSL_CMAC_H
+# define OPENSSL_CMAC_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CMAC_H
+# endif
 
 # ifndef OPENSSL_NO_CMAC
 
diff --git a/include/openssl/cmp.h b/include/openssl/cmp.h
index 1a628dbd62..fe138bd060 100644
--- a/include/openssl/cmp.h
+++ b/include/openssl/cmp.h
@@ -9,8 +9,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_HEADER_CMP_H
-# define OSSL_HEADER_CMP_H
+#ifndef OPENSSL_CMP_H
+# define OPENSSL_CMP_H
 
 # include <openssl/opensslconf.h>
 # ifndef OPENSSL_NO_CMP
@@ -20,7 +20,7 @@
 #  include <openssl/cmp_util.h>
 
 /* explicit #includes not strictly needed since implied by the above: */
-#  include <openssl/ossl_typ.h>
+#  include <openssl/types.h>
 #  include <openssl/safestack.h>
 #  include <openssl/x509.h>
 #  include <openssl/x509v3.h>
@@ -341,4 +341,4 @@ int OSSL_CMP_CTX_set1_senderNonce(OSSL_CMP_CTX *ctx,
 }
 #   endif
 # endif /* !defined OPENSSL_NO_CMP */
-#endif /* !defined OSSL_HEADER_CMP_H */
+#endif /* !defined OPENSSL_CMP_H */
diff --git a/include/openssl/cmp_util.h b/include/openssl/cmp_util.h
index 5e06a3aaae..fa5cee5e0c 100644
--- a/include/openssl/cmp_util.h
+++ b/include/openssl/cmp_util.h
@@ -9,8 +9,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_HEADER_CMP_UTIL_H
-# define OSSL_HEADER_CMP_UTIL_H
+#ifndef OPENSSL_CMP_UTIL_H
+# define OPENSSL_CMP_UTIL_H
 
 # include <openssl/opensslconf.h>
 # ifndef OPENSSL_NO_CMP
@@ -76,4 +76,4 @@ void OSSL_CMP_print_errors_cb(OSSL_cmp_log_cb_t log_fn);
 }
 #   endif
 # endif /* !defined OPENSSL_NO_CMP */
-#endif /* !defined OSSL_HEADER_CMP_UTIL_H */
+#endif /* !defined OPENSSL_CMP_UTIL_H */
diff --git a/include/openssl/cmperr.h b/include/openssl/cmperr.h
index 18c56efbef..0c1ce259b6 100644
--- a/include/openssl/cmperr.h
+++ b/include/openssl/cmperr.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CMPERR_H
-# define HEADER_CMPERR_H
+#ifndef OPENSSL_CMPERR_H
+# define OPENSSL_CMPERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/cms.h b/include/openssl/cms.h
index 608b6d7cac..cf4ad37f3a 100644
--- a/include/openssl/cms.h
+++ b/include/openssl/cms.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CMS_H
-# define HEADER_CMS_H
+#ifndef OPENSSL_CMS_H
+# define OPENSSL_CMS_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CMS_H
+# endif
 
 # include <openssl/opensslconf.h>
 
@@ -84,7 +90,7 @@ ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
 int CMS_is_detached(CMS_ContentInfo *cms);
 int CMS_set_detached(CMS_ContentInfo *cms, int detached);
 
-# ifdef HEADER_PEM_H
+# ifdef OPENSSL_PEM_H
 DECLARE_PEM_rw_const(CMS, CMS_ContentInfo)
 # endif
 int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
diff --git a/include/openssl/cmserr.h b/include/openssl/cmserr.h
index fe2619557d..407bdfd5fd 100644
--- a/include/openssl/cmserr.h
+++ b/include/openssl/cmserr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CMSERR_H
-# define HEADER_CMSERR_H
+#ifndef OPENSSL_CMSERR_H
+# define OPENSSL_CMSERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CMSERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/comp.h b/include/openssl/comp.h
index 69655977e7..47f782b57a 100644
--- a/include/openssl/comp.h
+++ b/include/openssl/comp.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_COMP_H
-# define HEADER_COMP_H
+#ifndef OPENSSL_COMP_H
+# define OPENSSL_COMP_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_COMP_H
+# endif
 
 # include <openssl/opensslconf.h>
 
@@ -39,7 +45,7 @@ COMP_METHOD *COMP_zlib(void);
 #define COMP_zlib_cleanup() while(0) continue
 #endif
 
-# ifdef HEADER_BIO_H
+# ifdef OPENSSL_BIO_H
 #  ifdef ZLIB
 const BIO_METHOD *BIO_f_zlib(void);
 #  endif
diff --git a/include/openssl/comperr.h b/include/openssl/comperr.h
index 45e14488ba..89faccb115 100644
--- a/include/openssl/comperr.h
+++ b/include/openssl/comperr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_COMPERR_H
-# define HEADER_COMPERR_H
+#ifndef OPENSSL_COMPERR_H
+# define OPENSSL_COMPERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_COMPERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/conf.h b/include/openssl/conf.h
index 49d637b7ce..b2f93dda8e 100644
--- a/include/openssl/conf.h
+++ b/include/openssl/conf.h
@@ -7,14 +7,20 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef  HEADER_CONF_H
-# define HEADER_CONF_H
+#ifndef  OPENSSL_CONF_H
+# define OPENSSL_CONF_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CONF_H
+# endif
 
 # include <openssl/bio.h>
 # include <openssl/lhash.h>
 # include <openssl/safestack.h>
 # include <openssl/e_os2.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/conferr.h>
 
 #ifdef  __cplusplus
diff --git a/include/openssl/conf_api.h b/include/openssl/conf_api.h
index 3120915438..43076932e1 100644
--- a/include/openssl/conf_api.h
+++ b/include/openssl/conf_api.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef  HEADER_CONF_API_H
-# define HEADER_CONF_API_H
+#ifndef  OPENSSL_CONF_API_H
+# define OPENSSL_CONF_API_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CONF_API_H
+# endif
 
 # include <openssl/lhash.h>
 # include <openssl/conf.h>
diff --git a/include/openssl/conferr.h b/include/openssl/conferr.h
index 69110cbd07..4bf5b9e28f 100644
--- a/include/openssl/conferr.h
+++ b/include/openssl/conferr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CONFERR_H
-# define HEADER_CONFERR_H
+#ifndef OPENSSL_CONFERR_H
+# define OPENSSL_CONFERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CONFERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/core.h b/include/openssl/core.h
index 43e9d0a6bc..2377169a33 100644
--- a/include/openssl/core.h
+++ b/include/openssl/core.h
@@ -7,11 +7,11 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_CORE_H
-# define OSSL_CORE_H
+#ifndef OPENSSL_CORE_H
+# define OPENSSL_CORE_H
 
 # include <stddef.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 
 # ifdef __cplusplus
 extern "C" {
diff --git a/include/openssl/core_names.h b/include/openssl/core_names.h
index 8ca7577867..6656a7fb43 100644
--- a/include/openssl/core_names.h
+++ b/include/openssl/core_names.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_CORE_NAMES_H
-# define OSSL_CORE_NAMES_H
+#ifndef OPENSSL_CORE_NAMES_H
+# define OPENSSL_CORE_NAMES_H
 
 # ifdef __cplusplus
 extern "C" {
diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h
index d3189a3c18..cec38069f2 100644
--- a/include/openssl/core_numbers.h
+++ b/include/openssl/core_numbers.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_CORE_NUMBERS_H
-# define OSSL_CORE_NUMBERS_H
+#ifndef OPENSSL_CORE_NUMBERS_H
+# define OPENSSL_CORE_NUMBERS_H
 
 # include <stdarg.h>
 # include <openssl/core.h>
diff --git a/include/openssl/crmf.h b/include/openssl/crmf.h
index 1e34e56996..160ad326b0 100644
--- a/include/openssl/crmf.h
+++ b/include/openssl/crmf.h
@@ -11,8 +11,8 @@
  * CRMF (RFC 4211) implementation by M. Peylo, M. Viljanen, and D. von Oheimb.
  */
 
-#ifndef OSSL_HEADER_CRMF_H
-# define OSSL_HEADER_CRMF_H
+#ifndef OPENSSL_CRMF_H
+# define OPENSSL_CRMF_H
 
 # include <openssl/opensslconf.h>
 
@@ -23,7 +23,7 @@
 #  include <openssl/x509v3.h> /* for GENERAL_NAME etc. */
 
 /* explicit #includes not strictly needed since implied by the above: */
-#  include <openssl/ossl_typ.h>
+#  include <openssl/types.h>
 #  include <openssl/x509.h>
 
 #  ifdef  __cplusplus
@@ -136,4 +136,4 @@ X509 *OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(OSSL_CRMF_ENCRYPTEDVALUE *ecert,
 }
 #  endif
 # endif /* !defined OPENSSL_NO_CRMF */
-#endif /* !defined OSSL_HEADER_CRMF_H */
+#endif /* !defined OPENSSL_CRMF_H */
diff --git a/include/openssl/crmferr.h b/include/openssl/crmferr.h
index 59c5243454..715b78c2e6 100644
--- a/include/openssl/crmferr.h
+++ b/include/openssl/crmferr.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CRMFERR_H
-# define HEADER_CRMFERR_H
+#ifndef OPENSSL_CRMFERR_H
+# define OPENSSL_CRMFERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h
index 60aca02849..9fb2fa3925 100644
--- a/include/openssl/crypto.h
+++ b/include/openssl/crypto.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CRYPTO_H
-# define HEADER_CRYPTO_H
+#ifndef OPENSSL_CRYPTO_H
+# define OPENSSL_CRYPTO_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CRYPTO_H
+# endif
 
 # include <stdlib.h>
 # include <time.h>
@@ -22,7 +28,7 @@
 
 # include <openssl/safestack.h>
 # include <openssl/opensslv.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/opensslconf.h>
 # include <openssl/cryptoerr.h>
 
diff --git a/include/openssl/cryptoerr.h b/include/openssl/cryptoerr.h
index 15071e2741..99872af161 100644
--- a/include/openssl/cryptoerr.h
+++ b/include/openssl/cryptoerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CRYPTOERR_H
-# define HEADER_CRYPTOERR_H
+#ifndef OPENSSL_CRYPTOERR_H
+# define OPENSSL_CRYPTOERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CRYPTOERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/ct.h b/include/openssl/ct.h
index 76f566304e..17271d6777 100644
--- a/include/openssl/ct.h
+++ b/include/openssl/ct.h
@@ -7,13 +7,19 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CT_H
-# define HEADER_CT_H
+#ifndef OPENSSL_CT_H
+# define OPENSSL_CT_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CT_H
+# endif
 
 # include <openssl/opensslconf.h>
 
 # ifndef OPENSSL_NO_CT
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/safestack.h>
 # include <openssl/x509.h>
 # include <openssl/cterr.h>
diff --git a/include/openssl/cterr.h b/include/openssl/cterr.h
index 3989996968..c5c646cc9b 100644
--- a/include/openssl/cterr.h
+++ b/include/openssl/cterr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CTERR_H
-# define HEADER_CTERR_H
+#ifndef OPENSSL_CTERR_H
+# define OPENSSL_CTERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_CTERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/des.h b/include/openssl/des.h
index 84b65e0096..0a874f4bcc 100644
--- a/include/openssl/des.h
+++ b/include/openssl/des.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DES_H
-# define HEADER_DES_H
+#ifndef OPENSSL_DES_H
+# define OPENSSL_DES_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_DES_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/dh.h b/include/openssl/dh.h
index 4e117a0d03..84f4f07d2c 100644
--- a/include/openssl/dh.h
+++ b/include/openssl/dh.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DH_H
-# define HEADER_DH_H
+#ifndef OPENSSL_DH_H
+# define OPENSSL_DH_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_DH_H
+# endif
 
 # include <openssl/opensslconf.h>
 
@@ -16,7 +22,7 @@
 # include <openssl/e_os2.h>
 # include <openssl/bio.h>
 # include <openssl/asn1.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # if !OPENSSL_API_1_1_0
 #  include <openssl/bn.h>
 # endif
diff --git a/include/openssl/dherr.h b/include/openssl/dherr.h
index 13bd0361e0..a926dab999 100644
--- a/include/openssl/dherr.h
+++ b/include/openssl/dherr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DHERR_H
-# define HEADER_DHERR_H
+#ifndef OPENSSL_DHERR_H
+# define OPENSSL_DHERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_DHERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h
index 38ae977fc6..f14be2812d 100644
--- a/include/openssl/dsa.h
+++ b/include/openssl/dsa.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DSA_H
-# define HEADER_DSA_H
+#ifndef OPENSSL_DSA_H
+# define OPENSSL_DSA_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_DSA_H
+# endif
 
 # include <openssl/opensslconf.h>
 
@@ -20,7 +26,7 @@ extern "C" {
 # include <openssl/asn1.h>
 # include <openssl/bio.h>
 # include <openssl/crypto.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/bn.h>
 # if !OPENSSL_API_1_1_0
 #  include <openssl/dh.h>
diff --git a/include/openssl/dsaerr.h b/include/openssl/dsaerr.h
index 76ef96acf7..9e0d5cfe2a 100644
--- a/include/openssl/dsaerr.h
+++ b/include/openssl/dsaerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DSAERR_H
-# define HEADER_DSAERR_H
+#ifndef OPENSSL_DSAERR_H
+# define OPENSSL_DSAERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_DSAERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/dtls1.h b/include/openssl/dtls1.h
index ef01d8b9db..d535c05c49 100644
--- a/include/openssl/dtls1.h
+++ b/include/openssl/dtls1.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DTLS1_H
-# define HEADER_DTLS1_H
+#ifndef OPENSSL_DTLS1_H
+# define OPENSSL_DTLS1_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_DTLS1_H
+# endif
 
 #ifdef  __cplusplus
 extern "C" {
diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h
index b1a99f3c48..69a50911dd 100644
--- a/include/openssl/e_os2.h
+++ b/include/openssl/e_os2.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_E_OS2_H
-# define HEADER_E_OS2_H
+#ifndef OPENSSL_E_OS2_H
+# define OPENSSL_E_OS2_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_E_OS2_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/ebcdic.h b/include/openssl/ebcdic.h
index 9994928e30..a75a71d4d9 100644
--- a/include/openssl/ebcdic.h
+++ b/include/openssl/ebcdic.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_EBCDIC_H
-# define HEADER_EBCDIC_H
+#ifndef OPENSSL_EBCDIC_H
+# define OPENSSL_EBCDIC_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_EBCDIC_H
+# endif
 
 # include <stdlib.h>
 
diff --git a/include/openssl/ec.h b/include/openssl/ec.h
index 4e1af5ea33..11999b41fc 100644
--- a/include/openssl/ec.h
+++ b/include/openssl/ec.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_EC_H
-# define HEADER_EC_H
+#ifndef OPENSSL_EC_H
+# define OPENSSL_EC_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_EC_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/ecerr.h b/include/openssl/ecerr.h
index 50e23bb1e8..07ef524f7a 100644
--- a/include/openssl/ecerr.h
+++ b/include/openssl/ecerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ECERR_H
-# define HEADER_ECERR_H
+#ifndef OPENSSL_ECERR_H
+# define OPENSSL_ECERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ECERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/engine.h b/include/openssl/engine.h
index 92d49e343a..816eb4e2e6 100644
--- a/include/openssl/engine.h
+++ b/include/openssl/engine.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ENGINE_H
-# define HEADER_ENGINE_H
+#ifndef OPENSSL_ENGINE_H
+# define OPENSSL_ENGINE_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ENGINE_H
+# endif
 
 # include <openssl/opensslconf.h>
 
@@ -24,7 +30,7 @@
 #  include <openssl/ui.h>
 #  include <openssl/err.h>
 # endif
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/symhacks.h>
 # include <openssl/x509.h>
 # include <openssl/engineerr.h>
diff --git a/include/openssl/engineerr.h b/include/openssl/engineerr.h
index 14188bebf3..27b2df6d76 100644
--- a/include/openssl/engineerr.h
+++ b/include/openssl/engineerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ENGINEERR_H
-# define HEADER_ENGINEERR_H
+#ifndef OPENSSL_ENGINEERR_H
+# define OPENSSL_ENGINEERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ENGINEERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/err.h b/include/openssl/err.h
index 5c647831b5..fc7ead8b68 100644
--- a/include/openssl/err.h
+++ b/include/openssl/err.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ERR_H
-# define HEADER_ERR_H
+#ifndef OPENSSL_ERR_H
+# define OPENSSL_ERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ERR_H
+# endif
 
 # include <openssl/e_os2.h>
 
@@ -17,7 +23,7 @@
 #  include <stdlib.h>
 # endif
 
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/bio.h>
 # include <openssl/lhash.h>
 
diff --git a/include/openssl/ess.h b/include/openssl/ess.h
index f13b5395a8..c20bf8201d 100644
--- a/include/openssl/ess.h
+++ b/include/openssl/ess.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ESS_H
-# define HEADER_ESS_H
+#ifndef OPENSSL_ESS_H
+# define OPENSSL_ESS_H
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/esserr.h b/include/openssl/esserr.h
index 0fb676b78e..ee3041aa0b 100644
--- a/include/openssl/esserr.h
+++ b/include/openssl/esserr.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ESSERR_H
-# define HEADER_ESSERR_H
+#ifndef OPENSSL_ESSERR_H
+# define OPENSSL_ESSERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index b65328df6d..564106ceff 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -7,13 +7,19 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ENVELOPE_H
-# define HEADER_ENVELOPE_H
+#ifndef OPENSSL_EVP_H
+# define OPENSSL_EVP_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_ENVELOPE_H
+# endif
 
 # include <stdarg.h>
 
 # include <openssl/opensslconf.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/core.h>
 # include <openssl/symhacks.h>
 # include <openssl/bio.h>
diff --git a/include/openssl/evperr.h b/include/openssl/evperr.h
index 64ed5a3b95..fefbfb593e 100644
--- a/include/openssl/evperr.h
+++ b/include/openssl/evperr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_EVPERR_H
-# define HEADER_EVPERR_H
+#ifndef OPENSSL_EVPERR_H
+# define OPENSSL_EVPERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_EVPERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/fips_names.h b/include/openssl/fips_names.h
index 28226f5f88..aeb9670d15 100644
--- a/include/openssl/fips_names.h
+++ b/include/openssl/fips_names.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_FIPS_NAMES_H
-# define OSSL_FIPS_NAMES_H
+#ifndef OPENSSL_FIPS_NAMES_H
+# define OPENSSL_FIPS_NAMES_H
 
 # ifdef __cplusplus
 extern "C" {
@@ -43,4 +43,4 @@ extern "C" {
 }
 # endif
 
-#endif /* OSSL_FIPS_NAMES_H */
+#endif /* OPENSSL_FIPS_NAMES_H */
diff --git a/include/openssl/hmac.h b/include/openssl/hmac.h
index 7bf4e2305c..8214853e07 100644
--- a/include/openssl/hmac.h
+++ b/include/openssl/hmac.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_HMAC_H
-# define HEADER_HMAC_H
+#ifndef OPENSSL_HMAC_H
+# define OPENSSL_HMAC_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_HMAC_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/idea.h b/include/openssl/idea.h
index fb42443b3c..667865281d 100644
--- a/include/openssl/idea.h
+++ b/include/openssl/idea.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_IDEA_H
-# define HEADER_IDEA_H
+#ifndef OPENSSL_IDEA_H
+# define OPENSSL_IDEA_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_IDEA_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/kdf.h b/include/openssl/kdf.h
index a9ea768d1d..864a5533ac 100644
--- a/include/openssl/kdf.h
+++ b/include/openssl/kdf.h
@@ -7,12 +7,18 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_KDF_H
-# define HEADER_KDF_H
+#ifndef OPENSSL_KDF_H
+# define OPENSSL_KDF_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_KDF_H
+# endif
 
 # include <stdarg.h>
 # include <stddef.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/core.h>
 
 # ifdef __cplusplus
diff --git a/include/openssl/lhash.h b/include/openssl/lhash.h
index 6144fddca5..7cf2800dcd 100644
--- a/include/openssl/lhash.h
+++ b/include/openssl/lhash.h
@@ -11,8 +11,14 @@
  * Header for dynamic hash table routines Author - Eric Young
  */
 
-#ifndef HEADER_LHASH_H
-# define HEADER_LHASH_H
+#ifndef OPENSSL_LHASH_H
+# define OPENSSL_LHASH_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_LHASH_H
+# endif
 
 # include <openssl/e_os2.h>
 # include <openssl/bio.h>
diff --git a/include/openssl/md2.h b/include/openssl/md2.h
index e2f4c8eef4..005a7bd4fc 100644
--- a/include/openssl/md2.h
+++ b/include/openssl/md2.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_MD2_H
-# define HEADER_MD2_H
+#ifndef OPENSSL_MD2_H
+# define OPENSSL_MD2_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_MD2_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/md4.h b/include/openssl/md4.h
index 104aeee701..a66db24263 100644
--- a/include/openssl/md4.h
+++ b/include/openssl/md4.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_MD4_H
-# define HEADER_MD4_H
+#ifndef OPENSSL_MD4_H
+# define OPENSSL_MD4_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_MD4_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/md5.h b/include/openssl/md5.h
index d5ade5f12b..78133a3474 100644
--- a/include/openssl/md5.h
+++ b/include/openssl/md5.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_MD5_H
-# define HEADER_MD5_H
+#ifndef OPENSSL_MD5_H
+# define OPENSSL_MD5_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_MD5_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/mdc2.h b/include/openssl/mdc2.h
index 576695cf7b..c1dc1cf62d 100644
--- a/include/openssl/mdc2.h
+++ b/include/openssl/mdc2.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_MDC2_H
-# define HEADER_MDC2_H
+#ifndef OPENSSL_MDC2_H
+# define OPENSSL_MDC2_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_MDC2_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/modes.h b/include/openssl/modes.h
index 212c846fd8..78cc98cd7e 100644
--- a/include/openssl/modes.h
+++ b/include/openssl/modes.h
@@ -7,11 +7,17 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_MODES_H
-# define HEADER_MODES_H
+#ifndef OPENSSL_MODES_H
+# define OPENSSL_MODES_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_MODES_H
+# endif
 
 # include <stddef.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 
 # ifdef  __cplusplus
 extern "C" {
diff --git a/include/openssl/objects.h b/include/openssl/objects.h
index 9416df23df..45fa7e683b 100644
--- a/include/openssl/objects.h
+++ b/include/openssl/objects.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OBJECTS_H
-# define HEADER_OBJECTS_H
+#ifndef OPENSSL_OBJECTS_H
+# define OPENSSL_OBJECTS_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_OBJECTS_H
+# endif
 
 # include <openssl/obj_mac.h>
 # include <openssl/bio.h>
diff --git a/include/openssl/objectserr.h b/include/openssl/objectserr.h
index fac142b1e7..9aa4acbbc0 100644
--- a/include/openssl/objectserr.h
+++ b/include/openssl/objectserr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OBJERR_H
-# define HEADER_OBJERR_H
+#ifndef OPENSSL_OBJECTSERR_H
+# define OPENSSL_OBJECTSERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_OBJERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/ocsp.h b/include/openssl/ocsp.h
index 3a37f613ed..1cc2cc6bcd 100644
--- a/include/openssl/ocsp.h
+++ b/include/openssl/ocsp.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OCSP_H
-# define HEADER_OCSP_H
+#ifndef OPENSSL_OCSP_H
+# define OPENSSL_OCSP_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_OCSP_H
+# endif
 
 #include <openssl/opensslconf.h>
 
@@ -46,7 +52,7 @@
 
 # ifndef OPENSSL_NO_OCSP
 
-#  include <openssl/ossl_typ.h>
+#  include <openssl/types.h>
 #  include <openssl/x509.h>
 #  include <openssl/x509v3.h>
 #  include <openssl/safestack.h>
diff --git a/include/openssl/ocsperr.h b/include/openssl/ocsperr.h
index 220befd4a8..fa68f6ef00 100644
--- a/include/openssl/ocsperr.h
+++ b/include/openssl/ocsperr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OCSPERR_H
-# define HEADER_OCSPERR_H
+#ifndef OPENSSL_OCSPERR_H
+# define OPENSSL_OCSPERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_OCSPERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/opensslconf.h.in b/include/openssl/opensslconf.h.in
index f31588a0aa..c3448338a2 100644
--- a/include/openssl/opensslconf.h.in
+++ b/include/openssl/opensslconf.h.in
@@ -9,8 +9,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OPENSSLCONF_H
-# define HEADER_OPENSSLCONF_H
+#ifndef OPENSSL_OPENSSLCONF_H
+# define OPENSSL_OPENSSLCONF_H
 
 # ifdef  __cplusplus
 extern "C" {
@@ -61,9 +61,13 @@ extern "C" {
 
 # define RC4_INT {- $config{rc4_int} -}
 
-#include <openssl/macros.h>
-
 # ifdef  __cplusplus
 }
 # endif
-#endif                          /* HEADER_OPENSSLCONF_H */
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_FILE_H /* deprecated in version 3.0 */
+# endif
+
+#endif                          /* OPENSSL_OPENSSLCONF_H */
diff --git a/include/openssl/opensslv.h b/include/openssl/opensslv.h
index 6a62b495b2..cb3eb32d0b 100644
--- a/include/openssl/opensslv.h
+++ b/include/openssl/opensslv.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OPENSSLV_H
-# define HEADER_OPENSSLV_H
+#ifndef OPENSSL_OPENSSLV_H
+# define OPENSSL_OPENSSLV_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_OPENSSLV_H
+# endif
 
 # ifdef  __cplusplus
 extern "C" {
@@ -136,4 +142,4 @@ const char *OPENSSL_version_build_metadata(void);
 # ifdef  __cplusplus
 }
 # endif
-#endif                          /* HEADER_OPENSSLV_H */
+#endif                          /* OPENSSL_OPENSSLV_H */
diff --git a/include/openssl/ossl_typ.h b/include/openssl/ossl_typ.h
index 70d9144ba1..82a58988ff 100644
--- a/include/openssl/ossl_typ.h
+++ b/include/openssl/ossl_typ.h
@@ -1,5 +1,5 @@
 /*
- * Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019 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
@@ -7,212 +7,10 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OPENSSL_TYPES_H
-# define HEADER_OPENSSL_TYPES_H
-
-#include <limits.h>
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-# include <openssl/e_os2.h>
-
-typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */
-
-# ifdef NO_ASN1_TYPEDEFS
-#  define ASN1_INTEGER            ASN1_STRING
-#  define ASN1_ENUMERATED         ASN1_STRING
-#  define ASN1_BIT_STRING         ASN1_STRING
-#  define ASN1_OCTET_STRING       ASN1_STRING
-#  define ASN1_PRINTABLESTRING    ASN1_STRING
-#  define ASN1_T61STRING          ASN1_STRING
-#  define ASN1_IA5STRING          ASN1_STRING
-#  define ASN1_UTCTIME            ASN1_STRING
-#  define ASN1_GENERALIZEDTIME    ASN1_STRING
-#  define ASN1_TIME               ASN1_STRING
-#  define ASN1_GENERALSTRING      ASN1_STRING
-#  define ASN1_UNIVERSALSTRING    ASN1_STRING
-#  define ASN1_BMPSTRING          ASN1_STRING
-#  define ASN1_VISIBLESTRING      ASN1_STRING
-#  define ASN1_UTF8STRING         ASN1_STRING
-#  define ASN1_BOOLEAN            int
-#  define ASN1_NULL               int
-# else
-typedef struct asn1_string_st ASN1_INTEGER;
-typedef struct asn1_string_st ASN1_ENUMERATED;
-typedef struct asn1_string_st ASN1_BIT_STRING;
-typedef struct asn1_string_st ASN1_OCTET_STRING;
-typedef struct asn1_string_st ASN1_PRINTABLESTRING;
-typedef struct asn1_string_st ASN1_T61STRING;
-typedef struct asn1_string_st ASN1_IA5STRING;
-typedef struct asn1_string_st ASN1_GENERALSTRING;
-typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
-typedef struct asn1_string_st ASN1_BMPSTRING;
-typedef struct asn1_string_st ASN1_UTCTIME;
-typedef struct asn1_string_st ASN1_TIME;
-typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
-typedef struct asn1_string_st ASN1_VISIBLESTRING;
-typedef struct asn1_string_st ASN1_UTF8STRING;
-typedef struct asn1_string_st ASN1_STRING;
-typedef int ASN1_BOOLEAN;
-typedef int ASN1_NULL;
-# endif
-
-typedef struct asn1_object_st ASN1_OBJECT;
-
-typedef struct ASN1_ITEM_st ASN1_ITEM;
-typedef struct asn1_pctx_st ASN1_PCTX;
-typedef struct asn1_sctx_st ASN1_SCTX;
-
-# ifdef _WIN32
-#  undef X509_NAME
-#  undef X509_EXTENSIONS
-#  undef PKCS7_ISSUER_AND_SERIAL
-#  undef PKCS7_SIGNER_INFO
-#  undef OCSP_REQUEST
-#  undef OCSP_RESPONSE
-# endif
-
-# ifdef BIGNUM
-#  undef BIGNUM
-# endif
-struct dane_st;
-typedef struct bio_st BIO;
-typedef struct bignum_st BIGNUM;
-typedef struct bignum_ctx BN_CTX;
-typedef struct bn_blinding_st BN_BLINDING;
-typedef struct bn_mont_ctx_st BN_MONT_CTX;
-typedef struct bn_recp_ctx_st BN_RECP_CTX;
-typedef struct bn_gencb_st BN_GENCB;
-
-typedef struct buf_mem_st BUF_MEM;
-
-typedef struct err_state_st ERR_STATE;
-
-typedef struct evp_cipher_st EVP_CIPHER;
-typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
-typedef struct evp_md_st EVP_MD;
-typedef struct evp_md_ctx_st EVP_MD_CTX;
-typedef struct evp_mac_st EVP_MAC;
-typedef struct evp_mac_ctx_st EVP_MAC_CTX;
-typedef struct evp_pkey_st EVP_PKEY;
-
-typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
-
-typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
-typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
-
-typedef struct evp_keymgmt_st EVP_KEYMGMT;
-
-typedef struct evp_kdf_st EVP_KDF;
-typedef struct evp_kdf_ctx_st EVP_KDF_CTX;
-
-typedef struct evp_keyexch_st EVP_KEYEXCH;
-
-typedef struct evp_signature_st EVP_SIGNATURE;
-
-typedef struct evp_Encode_Ctx_st EVP_ENCODE_CTX;
-
-typedef struct hmac_ctx_st HMAC_CTX;
-
-typedef struct dh_st DH;
-typedef struct dh_method DH_METHOD;
-
-typedef struct dsa_st DSA;
-typedef struct dsa_method DSA_METHOD;
-
-typedef struct rsa_st RSA;
-typedef struct rsa_meth_st RSA_METHOD;
-
-typedef struct ec_key_st EC_KEY;
-typedef struct ec_key_method_st EC_KEY_METHOD;
-
-typedef struct rand_meth_st RAND_METHOD;
-typedef struct rand_drbg_st RAND_DRBG;
-
-typedef struct ssl_dane_st SSL_DANE;
-typedef struct x509_st X509;
-typedef struct X509_algor_st X509_ALGOR;
-typedef struct X509_crl_st X509_CRL;
-typedef struct x509_crl_method_st X509_CRL_METHOD;
-typedef struct x509_revoked_st X509_REVOKED;
-typedef struct X509_name_st X509_NAME;
-typedef struct X509_pubkey_st X509_PUBKEY;
-typedef struct x509_store_st X509_STORE;
-typedef struct x509_store_ctx_st X509_STORE_CTX;
-
-typedef struct x509_object_st X509_OBJECT;
-typedef struct x509_lookup_st X509_LOOKUP;
-typedef struct x509_lookup_method_st X509_LOOKUP_METHOD;
-typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
-
-typedef struct x509_sig_info_st X509_SIG_INFO;
-
-typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
-
-typedef struct v3_ext_ctx X509V3_CTX;
-typedef struct conf_st CONF;
-typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS;
-
-typedef struct ui_st UI;
-typedef struct ui_method_st UI_METHOD;
-
-typedef struct engine_st ENGINE;
-typedef struct ssl_st SSL;
-typedef struct ssl_ctx_st SSL_CTX;
-
-typedef struct comp_ctx_st COMP_CTX;
-typedef struct comp_method_st COMP_METHOD;
-
-typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
-typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
-typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
-typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
-
-typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
-typedef struct DIST_POINT_st DIST_POINT;
-typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
-typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
-
-typedef struct crypto_ex_data_st CRYPTO_EX_DATA;
-
-typedef struct ocsp_req_ctx_st OCSP_REQ_CTX;
-typedef struct ocsp_response_st OCSP_RESPONSE;
-typedef struct ocsp_responder_id_st OCSP_RESPID;
-
-typedef struct sct_st SCT;
-typedef struct sct_ctx_st SCT_CTX;
-typedef struct ctlog_st CTLOG;
-typedef struct ctlog_store_st CTLOG_STORE;
-typedef struct ct_policy_eval_ctx_st CT_POLICY_EVAL_CTX;
-
-typedef struct ossl_store_info_st OSSL_STORE_INFO;
-typedef struct ossl_store_search_st OSSL_STORE_SEARCH;
-
-typedef struct openssl_ctx_st OPENSSL_CTX;
-
-typedef struct ossl_dispatch_st OSSL_DISPATCH;
-typedef struct ossl_item_st OSSL_ITEM;
-typedef struct ossl_algorithm_st OSSL_ALGORITHM;
-typedef struct ossl_param_st OSSL_PARAM;
-
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L && \
-    defined(INTMAX_MAX) && defined(UINTMAX_MAX)
-typedef intmax_t ossl_intmax_t;
-typedef uintmax_t ossl_uintmax_t;
-#else
 /*
- * Not long long, because the C-library can only be expected to provide
- * strtoll(), strtoull() at the same time as intmax_t and strtoimax(),
- * strtoumax().  Since we use these for parsing arguments, we need the
- * conversion functions, not just the sizes.
+ * The original <openssl/ossl_typ.h> was renamed to <openssl/types.h>
+ *
+ * This header file only exists for compatibility reasons with older
+ * applications which #include <openssl/ossl_typ.h>.
  */
-typedef long ossl_intmax_t;
-typedef unsigned long ossl_uintmax_t;
-#endif
-
-#ifdef  __cplusplus
-}
-#endif
-#endif                          /* def HEADER_OPENSSL_TYPES_H */
+# include <openssl/types.h>
diff --git a/include/openssl/params.h b/include/openssl/params.h
index 8293ee2cf0..aec3bc18b8 100644
--- a/include/openssl/params.h
+++ b/include/openssl/params.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PARAMS_H
-# define HEADER_PARAMS_H
+#ifndef OPENSSL_PARAMS_H
+# define OPENSSL_PARAMS_H
 
 # include <openssl/core.h>
 # include <openssl/bn.h>
diff --git a/include/openssl/pem.h b/include/openssl/pem.h
index 8f6e6a2ce5..915b5df4ab 100644
--- a/include/openssl/pem.h
+++ b/include/openssl/pem.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PEM_H
-# define HEADER_PEM_H
+#ifndef OPENSSL_PEM_H
+# define OPENSSL_PEM_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_PEM_H
+# endif
 
 # include <openssl/e_os2.h>
 # include <openssl/bio.h>
diff --git a/include/openssl/pem2.h b/include/openssl/pem2.h
index fea32df747..baaff3204d 100644
--- a/include/openssl/pem2.h
+++ b/include/openssl/pem2.h
@@ -7,7 +7,13 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PEM2_H
-# define HEADER_PEM2_H
+#ifndef OPENSSL_PEM2_H
+# define OPENSSL_PEM2_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_PEM2_H
+# endif
 # include <openssl/pemerr.h>
 #endif
diff --git a/include/openssl/pemerr.h b/include/openssl/pemerr.h
index 7f2d6e7a89..ca1b5d4ae3 100644
--- a/include/openssl/pemerr.h
+++ b/include/openssl/pemerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PEMERR_H
-# define HEADER_PEMERR_H
+#ifndef OPENSSL_PEMERR_H
+# define OPENSSL_PEMERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_PEMERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/pkcs12.h b/include/openssl/pkcs12.h
index 83caaeed7d..7fd5827d8a 100644
--- a/include/openssl/pkcs12.h
+++ b/include/openssl/pkcs12.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PKCS12_H
-# define HEADER_PKCS12_H
+#ifndef OPENSSL_PKCS12_H
+# define OPENSSL_PKCS12_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_PKCS12_H
+# endif
 
 # include <openssl/bio.h>
 # include <openssl/x509.h>
diff --git a/include/openssl/pkcs12err.h b/include/openssl/pkcs12err.h
index c599700162..b994240438 100644
--- a/include/openssl/pkcs12err.h
+++ b/include/openssl/pkcs12err.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PKCS12ERR_H
-# define HEADER_PKCS12ERR_H
+#ifndef OPENSSL_PKCS12ERR_H
+# define OPENSSL_PKCS12ERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_PKCS12ERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/pkcs7.h b/include/openssl/pkcs7.h
index 5dec27fc8e..8b208f3700 100644
--- a/include/openssl/pkcs7.h
+++ b/include/openssl/pkcs7.h
@@ -7,15 +7,21 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PKCS7_H
-# define HEADER_PKCS7_H
+#ifndef OPENSSL_PKCS7_H
+# define OPENSSL_PKCS7_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_PKCS7_H
+# endif
 
 # include <openssl/asn1.h>
 # include <openssl/bio.h>
 # include <openssl/e_os2.h>
 
 # include <openssl/symhacks.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/pkcs7err.h>
 
 #ifdef  __cplusplus
diff --git a/include/openssl/pkcs7err.h b/include/openssl/pkcs7err.h
index 01d9dc22fa..e82f6ef83f 100644
--- a/include/openssl/pkcs7err.h
+++ b/include/openssl/pkcs7err.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PKCS7ERR_H
-# define HEADER_PKCS7ERR_H
+#ifndef OPENSSL_PKCS7ERR_H
+# define OPENSSL_PKCS7ERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_PKCS7ERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/provider.h b/include/openssl/provider.h
index db8e714393..86dabf42ce 100644
--- a/include/openssl/provider.h
+++ b/include/openssl/provider.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_PROVIDER_H
-# define OSSL_PROVIDER_H
+#ifndef OPENSSL_PROVIDER_H
+# define OPENSSL_PROVIDER_H
 
 # include <openssl/core.h>
 
diff --git a/include/openssl/rand.h b/include/openssl/rand.h
index 974fd2e5c3..974476765d 100644
--- a/include/openssl/rand.h
+++ b/include/openssl/rand.h
@@ -7,11 +7,17 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RAND_H
-# define HEADER_RAND_H
+#ifndef OPENSSL_RAND_H
+# define OPENSSL_RAND_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RAND_H
+# endif
 
 # include <stdlib.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/e_os2.h>
 # include <openssl/randerr.h>
 
diff --git a/include/openssl/rand_drbg.h b/include/openssl/rand_drbg.h
index 4e99d71a1d..0aef0da5a3 100644
--- a/include/openssl/rand_drbg.h
+++ b/include/openssl/rand_drbg.h
@@ -7,11 +7,17 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_DRBG_RAND_H
-# define HEADER_DRBG_RAND_H
+#ifndef OPENSSL_RAND_DRBG_H
+# define OPENSSL_RAND_DRBG_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_DRBG_RAND_H
+# endif
 
 # include <time.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/obj_mac.h>
 
 /*
diff --git a/include/openssl/randerr.h b/include/openssl/randerr.h
index cd7ae667bb..eb952b4ad4 100644
--- a/include/openssl/randerr.h
+++ b/include/openssl/randerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RANDERR_H
-# define HEADER_RANDERR_H
+#ifndef OPENSSL_RANDERR_H
+# define OPENSSL_RANDERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RANDERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/rc2.h b/include/openssl/rc2.h
index 0693db66b0..d7be6b49ea 100644
--- a/include/openssl/rc2.h
+++ b/include/openssl/rc2.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RC2_H
-# define HEADER_RC2_H
+#ifndef OPENSSL_RC2_H
+# define OPENSSL_RC2_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RC2_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/rc4.h b/include/openssl/rc4.h
index 95da746c85..fed6fcae65 100644
--- a/include/openssl/rc4.h
+++ b/include/openssl/rc4.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RC4_H
-# define HEADER_RC4_H
+#ifndef OPENSSL_RC4_H
+# define OPENSSL_RC4_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RC4_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/rc5.h b/include/openssl/rc5.h
index 97e22f7ac9..d4d97ed226 100644
--- a/include/openssl/rc5.h
+++ b/include/openssl/rc5.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RC5_H
-# define HEADER_RC5_H
+#ifndef OPENSSL_RC5_H
+# define OPENSSL_RC5_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RC5_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/ripemd.h b/include/openssl/ripemd.h
index ef334ffb77..7f1dbd2a68 100644
--- a/include/openssl/ripemd.h
+++ b/include/openssl/ripemd.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RIPEMD_H
-# define HEADER_RIPEMD_H
+#ifndef OPENSSL_RIPEMD_H
+# define OPENSSL_RIPEMD_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RIPEMD_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
index 6b681f4ef5..8ddc970396 100644
--- a/include/openssl/rsa.h
+++ b/include/openssl/rsa.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RSA_H
-# define HEADER_RSA_H
+#ifndef OPENSSL_RSA_H
+# define OPENSSL_RSA_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RSA_H
+# endif
 
 # include <openssl/opensslconf.h>
 
@@ -16,7 +22,7 @@
 # include <openssl/asn1.h>
 # include <openssl/bio.h>
 # include <openssl/crypto.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # if !OPENSSL_API_1_1_0
 #  include <openssl/bn.h>
 # endif
diff --git a/include/openssl/rsaerr.h b/include/openssl/rsaerr.h
index da092fb02f..1f685ec8ea 100644
--- a/include/openssl/rsaerr.h
+++ b/include/openssl/rsaerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_RSAERR_H
-# define HEADER_RSAERR_H
+#ifndef OPENSSL_RSAERR_H
+# define OPENSSL_RSAERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_RSAERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/safestack.h b/include/openssl/safestack.h
index 1fbe6cbd95..1b7b73d4b5 100644
--- a/include/openssl/safestack.h
+++ b/include/openssl/safestack.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SAFESTACK_H
-# define HEADER_SAFESTACK_H
+#ifndef OPENSSL_SAFESTACK_H
+# define OPENSSL_SAFESTACK_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SAFESTACK_H
+# endif
 
 # include <openssl/stack.h>
 # include <openssl/e_os2.h>
diff --git a/include/openssl/seed.h b/include/openssl/seed.h
index 6ef0e8057c..9ae2bce1ca 100644
--- a/include/openssl/seed.h
+++ b/include/openssl/seed.h
@@ -32,8 +32,14 @@
  * SUCH DAMAGE.
  */
 
-#ifndef HEADER_SEED_H
-# define HEADER_SEED_H
+#ifndef OPENSSL_SEED_H
+# define OPENSSL_SEED_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SEED_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/sha.h b/include/openssl/sha.h
index 1d55845a4d..5d21bdf0d8 100644
--- a/include/openssl/sha.h
+++ b/include/openssl/sha.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SHA_H
-# define HEADER_SHA_H
+#ifndef OPENSSL_SHA_H
+# define OPENSSL_SHA_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SHA_H
+# endif
 
 # include <openssl/e_os2.h>
 # include <stddef.h>
diff --git a/include/openssl/srp.h b/include/openssl/srp.h
index 8da92ca258..82b4d5b3dd 100644
--- a/include/openssl/srp.h
+++ b/include/openssl/srp.h
@@ -11,8 +11,14 @@
  * for the EdelKey project.
  */
 
-#ifndef HEADER_SRP_H
-# define HEADER_SRP_H
+#ifndef OPENSSL_SRP_H
+# define OPENSSL_SRP_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SRP_H
+# endif
 
 #include <openssl/opensslconf.h>
 
diff --git a/include/openssl/srtp.h b/include/openssl/srtp.h
index 2a00d08879..32056cb280 100644
--- a/include/openssl/srtp.h
+++ b/include/openssl/srtp.h
@@ -13,8 +13,14 @@
  * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.
  */
 
-#ifndef HEADER_D1_SRTP_H
-# define HEADER_D1_SRTP_H
+#ifndef OPENSSL_SRTP_H
+# define OPENSSL_SRTP_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_D1_SRTP_H
+# endif
 
 # include <openssl/ssl.h>
 
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index 93f6bbc8f8..35477d9cb7 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -9,8 +9,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSL_H
-# define HEADER_SSL_H
+#ifndef OPENSSL_SSL_H
+# define OPENSSL_SSL_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SSL_H
+# endif
 
 # include <openssl/e_os2.h>
 # include <openssl/opensslconf.h>
@@ -1690,7 +1696,7 @@ __owur int SSL_has_matching_session_id(const SSL *s,
 SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
                              long length);
 
-# ifdef HEADER_X509_H
+# ifdef OPENSSL_X509_H
 __owur X509 *SSL_get_peer_certificate(const SSL *s);
 # endif
 
diff --git a/include/openssl/ssl2.h b/include/openssl/ssl2.h
index ed70be58f6..e9b9ba8802 100644
--- a/include/openssl/ssl2.h
+++ b/include/openssl/ssl2.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSL2_H
-# define HEADER_SSL2_H
+#ifndef OPENSSL_SSL2_H
+# define OPENSSL_SSL2_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SSL2_H
+# endif
 
 #ifdef  __cplusplus
 extern "C" {
diff --git a/include/openssl/ssl3.h b/include/openssl/ssl3.h
index cf0b51ddb5..63ab2a58e4 100644
--- a/include/openssl/ssl3.h
+++ b/include/openssl/ssl3.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSL3_H
-# define HEADER_SSL3_H
+#ifndef OPENSSL_SSL3_H
+# define OPENSSL_SSL3_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SSL3_H
+# endif
 
 # include <openssl/comp.h>
 # include <openssl/buffer.h>
diff --git a/include/openssl/sslerr.h b/include/openssl/sslerr.h
index d8d3cea5d8..87c6465edc 100644
--- a/include/openssl/sslerr.h
+++ b/include/openssl/sslerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSLERR_H
-# define HEADER_SSLERR_H
+#ifndef OPENSSL_SSLERR_H
+# define OPENSSL_SSLERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SSLERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/stack.h b/include/openssl/stack.h
index 638b3afc88..018e0d0a8b 100644
--- a/include/openssl/stack.h
+++ b/include/openssl/stack.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_STACK_H
-# define HEADER_STACK_H
+#ifndef OPENSSL_STACK_H
+# define OPENSSL_STACK_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_STACK_H
+# endif
 
 #ifdef  __cplusplus
 extern "C" {
diff --git a/include/openssl/store.h b/include/openssl/store.h
index 9200fd0ce8..846923e0ea 100644
--- a/include/openssl/store.h
+++ b/include/openssl/store.h
@@ -7,11 +7,17 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OSSL_STORE_H
-# define HEADER_OSSL_STORE_H
+#ifndef OPENSSL_STORE_H
+# define OPENSSL_STORE_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_OSSL_STORE_H
+# endif
 
 # include <stdarg.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/pem.h>
 # include <openssl/storeerr.h>
 
diff --git a/include/openssl/storeerr.h b/include/openssl/storeerr.h
index 192a240899..29e365bcc9 100644
--- a/include/openssl/storeerr.h
+++ b/include/openssl/storeerr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OSSL_STOREERR_H
-# define HEADER_OSSL_STOREERR_H
+#ifndef OPENSSL_STOREERR_H
+# define OPENSSL_STOREERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_OSSL_STOREERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/symhacks.h b/include/openssl/symhacks.h
index 046c2a402a..abc5df3874 100644
--- a/include/openssl/symhacks.h
+++ b/include/openssl/symhacks.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SYMHACKS_H
-# define HEADER_SYMHACKS_H
+#ifndef OPENSSL_SYMHACKS_H
+# define OPENSSL_SYMHACKS_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_SYMHACKS_H
+# endif
 
 # include <openssl/e_os2.h>
 
diff --git a/include/openssl/tls1.h b/include/openssl/tls1.h
index f587f2a488..62a1763623 100644
--- a/include/openssl/tls1.h
+++ b/include/openssl/tls1.h
@@ -9,8 +9,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_TLS1_H
-# define HEADER_TLS1_H
+#ifndef OPENSSL_TLS1_H
+# define OPENSSL_TLS1_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_TLS1_H
+# endif
 
 # include <openssl/buffer.h>
 # include <openssl/x509.h>
diff --git a/include/openssl/trace.h b/include/openssl/trace.h
index cc1888b579..31e6fcc3f5 100644
--- a/include/openssl/trace.h
+++ b/include/openssl/trace.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_TRACE_H
-# define OSSL_TRACE_H
+#ifndef OPENSSL_TRACE_H
+# define OPENSSL_TRACE_H
 
 # include <stdarg.h>
 
diff --git a/include/openssl/ts.h b/include/openssl/ts.h
index 3165a786e2..231d6052f9 100644
--- a/include/openssl/ts.h
+++ b/include/openssl/ts.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_TS_H
-# define HEADER_TS_H
+#ifndef OPENSSL_TS_H
+# define OPENSSL_TS_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_TS_H
+# endif
 
 # include <openssl/opensslconf.h>
 
diff --git a/include/openssl/tserr.h b/include/openssl/tserr.h
index b15c7cfa38..6da6946ffc 100644
--- a/include/openssl/tserr.h
+++ b/include/openssl/tserr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_TSERR_H
-# define HEADER_TSERR_H
+#ifndef OPENSSL_TSERR_H
+# define OPENSSL_TSERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_TSERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/txt_db.h b/include/openssl/txt_db.h
index 34fb0d5ddb..cb646450ca 100644
--- a/include/openssl/txt_db.h
+++ b/include/openssl/txt_db.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_TXT_DB_H
-# define HEADER_TXT_DB_H
+#ifndef OPENSSL_TXT_DB_H
+# define OPENSSL_TXT_DB_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_TXT_DB_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/bio.h>
diff --git a/include/openssl/ossl_typ.h b/include/openssl/types.h
similarity index 98%
copy from include/openssl/ossl_typ.h
copy to include/openssl/types.h
index 70d9144ba1..73bf88d92d 100644
--- a/include/openssl/ossl_typ.h
+++ b/include/openssl/types.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_OPENSSL_TYPES_H
-# define HEADER_OPENSSL_TYPES_H
+#ifndef OPENSSL_TYPES_H
+# define OPENSSL_TYPES_H
 
 #include <limits.h>
 
@@ -215,4 +215,4 @@ typedef unsigned long ossl_uintmax_t;
 #ifdef  __cplusplus
 }
 #endif
-#endif                          /* def HEADER_OPENSSL_TYPES_H */
+#endif                          /* def OPENSSL_TYPES_H */
diff --git a/include/openssl/ui.h b/include/openssl/ui.h
index 4ae06e9673..a084402c68 100644
--- a/include/openssl/ui.h
+++ b/include/openssl/ui.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_UI_H
-# define HEADER_UI_H
+#ifndef OPENSSL_UI_H
+# define OPENSSL_UI_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_UI_H
+# endif
 
 # include <openssl/opensslconf.h>
 
@@ -17,7 +23,7 @@
 # endif
 # include <openssl/safestack.h>
 # include <openssl/pem.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/uierr.h>
 
 /* For compatibility reasons, the macro OPENSSL_NO_UI is currently retained */
diff --git a/include/openssl/uierr.h b/include/openssl/uierr.h
index b3f7871995..36567dce45 100644
--- a/include/openssl/uierr.h
+++ b/include/openssl/uierr.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_UIERR_H
-# define HEADER_UIERR_H
+#ifndef OPENSSL_UIERR_H
+# define OPENSSL_UIERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_UIERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/whrlpool.h b/include/openssl/whrlpool.h
index a0b4d9d857..f375607a36 100644
--- a/include/openssl/whrlpool.h
+++ b/include/openssl/whrlpool.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_WHRLPOOL_H
-# define HEADER_WHRLPOOL_H
+#ifndef OPENSSL_WHRLPOOL_H
+# define OPENSSL_WHRLPOOL_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_WHRLPOOL_H
+# endif
 
 #include <openssl/opensslconf.h>
 
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index d2466f2972..3b9c7ad506 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -8,11 +8,17 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_X509_H
-# define HEADER_X509_H
+#ifndef OPENSSL_X509_H
+# define OPENSSL_X509_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_X509_H
+# endif
 
 # include <openssl/e_os2.h>
-# include <openssl/ossl_typ.h>
+# include <openssl/types.h>
 # include <openssl/symhacks.h>
 # include <openssl/buffer.h>
 # include <openssl/evp.h>
diff --git a/include/openssl/x509_vfy.h b/include/openssl/x509_vfy.h
index e9a70f57f7..e16ad1d7c0 100644
--- a/include/openssl/x509_vfy.h
+++ b/include/openssl/x509_vfy.h
@@ -7,13 +7,19 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_X509_VFY_H
-# define HEADER_X509_VFY_H
+#ifndef OPENSSL_X509_VFY_H
+# define OPENSSL_X509_VFY_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_X509_VFY_H
+# endif
 
 /*
  * Protect against recursion, x509.h and x509_vfy.h each include the other.
  */
-# ifndef HEADER_X509_H
+# ifndef OPENSSL_X509_H
 #  include <openssl/x509.h>
 # endif
 
diff --git a/include/openssl/x509err.h b/include/openssl/x509err.h
index 2a237dd6a4..19eb3ddcf1 100644
--- a/include/openssl/x509err.h
+++ b/include/openssl/x509err.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_X509ERR_H
-# define HEADER_X509ERR_H
+#ifndef OPENSSL_X509ERR_H
+# define OPENSSL_X509ERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_X509ERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/include/openssl/x509v3.h b/include/openssl/x509v3.h
index bd60fcc8b7..419dc795dd 100644
--- a/include/openssl/x509v3.h
+++ b/include/openssl/x509v3.h
@@ -7,8 +7,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_X509V3_H
-# define HEADER_X509V3_H
+#ifndef OPENSSL_X509V3_H
+# define OPENSSL_X509V3_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_X509V3_H
+# endif
 
 # include <openssl/bio.h>
 # include <openssl/x509.h>
@@ -550,7 +556,7 @@ GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,
                                X509V3_CTX *ctx, int gen_type,
                                const char *value, int is_nc);
 
-# ifdef HEADER_CONF_H
+# ifdef OPENSSL_CONF_H
 GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method,
                                X509V3_CTX *ctx, CONF_VALUE *cnf);
 GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,
diff --git a/include/openssl/x509v3err.h b/include/openssl/x509v3err.h
index 4ccc76b171..f5f7e0bf2c 100644
--- a/include/openssl/x509v3err.h
+++ b/include/openssl/x509v3err.h
@@ -8,8 +8,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_X509V3ERR_H
-# define HEADER_X509V3ERR_H
+#ifndef OPENSSL_X509V3ERR_H
+# define OPENSSL_X509V3ERR_H
+# pragma once
+
+# include <openssl/macros.h>
+# if !OPENSSL_API_3
+#  define HEADER_X509V3ERR_H
+# endif
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/providers/build.info b/providers/build.info
index 9642a3c153..80b2952494 100644
--- a/providers/build.info
+++ b/providers/build.info
@@ -9,7 +9,7 @@ IF[{- !$disabled{fips} -}]
     SOURCE[fips]=fips.ld
     GENERATE[fips.ld]=../util/providers.num
   ENDIF
-  INCLUDE[fips]=.. ../include ../crypto/include common/include
+  INCLUDE[fips]=.. ../include common/include
   DEFINE[fips]=FIPS_MODE
 ENDIF
 
@@ -25,6 +25,6 @@ IF[{- !$disabled{legacy} -}]
       GENERATE[legacy.ld]=../util/providers.num
     ENDIF
     DEPEND[legacy]=../libcrypto
-    INCLUDE[legacy]=.. ../include ../crypto/include common/include
+    INCLUDE[legacy]=.. ../include common/include
   ENDIF
 ENDIF
diff --git a/providers/common/ciphers/block.c b/providers/common/ciphers/block.c
index a53e9255c9..ec2dab6849 100644
--- a/providers/common/ciphers/block.c
+++ b/providers/common/ciphers/block.c
@@ -8,7 +8,7 @@
  */
 
 #include <assert.h>
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/providercommonerr.h"
 
 /*
diff --git a/providers/common/ciphers/cipher_aes_ccm.c b/providers/common/ciphers/cipher_aes_ccm.c
index 75f6e3fc9d..c8015898dd 100644
--- a/providers/common/ciphers/cipher_aes_ccm.c
+++ b/providers/common/ciphers/cipher_aes_ccm.c
@@ -9,7 +9,7 @@
 
 /* Dispatch functions for AES CCM mode */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_ccm.h"
 #include "internal/provider_algs.h"
 
diff --git a/providers/common/ciphers/cipher_aes_ccm_hw.c b/providers/common/ciphers/cipher_aes_ccm_hw.c
index f445cb73b7..ba7ce4dcab 100644
--- a/providers/common/ciphers/cipher_aes_ccm_hw.c
+++ b/providers/common/ciphers/cipher_aes_ccm_hw.c
@@ -9,7 +9,7 @@
 
 /* AES CCM mode */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_ccm.h"
 
 #define AES_HW_CCM_SET_KEY_FN(fn_set_enc_key, fn_blk, fn_ccm_enc, fn_ccm_dec)  \
diff --git a/providers/common/ciphers/cipher_aes_gcm.c b/providers/common/ciphers/cipher_aes_gcm.c
index 69c98f4e13..ba03bed590 100644
--- a/providers/common/ciphers/cipher_aes_gcm.c
+++ b/providers/common/ciphers/cipher_aes_gcm.c
@@ -9,7 +9,7 @@
 
 /* Dispatch functions for AES GCM mode */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_gcm.h"
 #include "internal/provider_algs.h"
 
diff --git a/providers/common/ciphers/cipher_aes_gcm_hw.c b/providers/common/ciphers/cipher_aes_gcm_hw.c
index 3f56e6861d..5263bdd6dd 100644
--- a/providers/common/ciphers/cipher_aes_gcm_hw.c
+++ b/providers/common/ciphers/cipher_aes_gcm_hw.c
@@ -9,7 +9,7 @@
 
 /* Dispatch functions for AES GCM mode */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_gcm.h"
 
 static int generic_aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key,
diff --git a/providers/common/ciphers/cipher_ccm.c b/providers/common/ciphers/cipher_ccm.c
index 9c58dfeafa..cc37b49c60 100644
--- a/providers/common/ciphers/cipher_ccm.c
+++ b/providers/common/ciphers/cipher_ccm.c
@@ -9,7 +9,7 @@
 
 /* Dispatch functions for ccm mode */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_ccm.h"
 #include "internal/providercommonerr.h"
 
diff --git a/providers/common/ciphers/cipher_common.c b/providers/common/ciphers/cipher_common.c
index 3c45dd5b9a..34407879e6 100644
--- a/providers/common/ciphers/cipher_common.c
+++ b/providers/common/ciphers/cipher_common.c
@@ -11,7 +11,7 @@
  * Generic dispatch table functions for ciphers.
  */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/provider_ctx.h"
 #include "internal/providercommonerr.h"
 
diff --git a/providers/common/ciphers/cipher_common_hw.c b/providers/common/ciphers/cipher_common_hw.c
index 5a3fb3060b..6f1b4babd8 100644
--- a/providers/common/ciphers/cipher_common_hw.c
+++ b/providers/common/ciphers/cipher_common_hw.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 
 /*-
  * The generic cipher functions for cipher modes cbc, ecb, ofb, cfb and ctr.
diff --git a/providers/common/ciphers/cipher_gcm.c b/providers/common/ciphers/cipher_gcm.c
index b5c79daee7..137ad5029c 100644
--- a/providers/common/ciphers/cipher_gcm.c
+++ b/providers/common/ciphers/cipher_gcm.c
@@ -9,10 +9,10 @@
 
 /* Dispatch functions for gcm mode */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_gcm.h"
 #include "internal/providercommonerr.h"
-#include "internal/rand_int.h"
+#include "crypto/rand.h"
 #include "internal/provider_ctx.h"
 
 static int gcm_tls_init(PROV_GCM_CTX *dat, unsigned char *aad, size_t aad_len);
diff --git a/providers/common/ciphers/cipher_gcm_hw.c b/providers/common/ciphers/cipher_gcm_hw.c
index 8b2913c695..1d9c3ea49c 100644
--- a/providers/common/ciphers/cipher_gcm_hw.c
+++ b/providers/common/ciphers/cipher_gcm_hw.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_gcm.h"
 
 
diff --git a/providers/common/ciphers/cipher_locl.h b/providers/common/ciphers/cipher_local.h
similarity index 100%
rename from providers/common/ciphers/cipher_locl.h
rename to providers/common/ciphers/cipher_local.h
diff --git a/providers/common/ciphers/cipher_tdes.c b/providers/common/ciphers/cipher_tdes.c
index e3e80d186a..004ebc7269 100644
--- a/providers/common/ciphers/cipher_tdes.c
+++ b/providers/common/ciphers/cipher_tdes.c
@@ -7,9 +7,9 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_tdes.h"
-#include "internal/rand_int.h"
+#include "crypto/rand.h"
 #include "internal/provider_algs.h"
 #include "internal/providercommonerr.h"
 
diff --git a/providers/common/ciphers/cipher_tdes_hw.c b/providers/common/ciphers/cipher_tdes_hw.c
index 92b6de2422..10ba5a24da 100644
--- a/providers/common/ciphers/cipher_tdes_hw.c
+++ b/providers/common/ciphers/cipher_tdes_hw.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "internal/ciphers/cipher_tdes.h"
 
 #define ks1 tks.ks[0]
diff --git a/providers/common/digests/sha2_prov.c b/providers/common/digests/sha2_prov.c
index b872676506..d2c7df2ee6 100644
--- a/providers/common/digests/sha2_prov.c
+++ b/providers/common/digests/sha2_prov.c
@@ -16,7 +16,7 @@
 #include <openssl/core_names.h>
 #include "internal/digestcommon.h"
 #include "internal/provider_algs.h"
-#include "internal/sha.h"
+#include "crypto/sha.h"
 
 static OSSL_OP_digest_set_ctx_params_fn sha1_set_ctx_params;
 static OSSL_OP_digest_settable_ctx_params_fn sha1_settable_ctx_params;
diff --git a/providers/common/include/internal/ciphers/ciphercommon.h b/providers/common/include/internal/ciphers/ciphercommon.h
index 7539d8cb81..9a01abf6cb 100644
--- a/providers/common/include/internal/ciphers/ciphercommon.h
+++ b/providers/common/include/internal/ciphers/ciphercommon.h
@@ -12,8 +12,8 @@
 #include <openssl/core_names.h>
 #include <openssl/evp.h>
 #include "internal/cryptlib.h"
-#include "internal/modes_int.h"
-#include "internal/ciphermode_platform.h"
+#include "crypto/modes.h"
+#include "crypto/ciphermode_platform.h"
 
 #define MAXCHUNK    ((size_t)1 << (sizeof(long) * 8 - 2))
 #define MAXBITCHUNK ((size_t)1 << (sizeof(size_t) * 8 - 4))
diff --git a/providers/common/include/internal/digestcommon.h b/providers/common/include/internal/digestcommon.h
index 88caccf7cd..868cbbf79f 100644
--- a/providers/common/include/internal/digestcommon.h
+++ b/providers/common/include/internal/digestcommon.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OSSL_DIGESTCOMMON_H
-# define OSSL_DIGESTCOMMON_H
+#ifndef OSSL_PROVIDERS_DIGESTCOMMON_H
+# define OSSL_PROVIDERS_DIGESTCOMMON_H
 
 # include <openssl/core_numbers.h>
 # include <openssl/core_names.h>
@@ -100,4 +100,4 @@ int digest_default_get_params(OSSL_PARAM params[], size_t blksz, size_t paramsz,
 }
 # endif
 
-#endif /* OSSL_DIGESTCOMMON_H */
+#endif /* OSSL_PROVIDERS_DIGESTCOMMON_H */
diff --git a/providers/common/include/internal/providercommonerr.h b/providers/common/include/internal/providercommonerr.h
index a9f79762b5..5ce5f32e7d 100644
--- a/providers/common/include/internal/providercommonerr.h
+++ b/providers/common/include/internal/providercommonerr.h
@@ -8,8 +8,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PROVERR_H
-# define HEADER_PROVERR_H
+#ifndef OSSL_PROVIDERS_PROVIDERCOMMONERR_H
+# define OSSL_PROVIDERS_PROVIDERCOMMONERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>
diff --git a/providers/common/kdfs/hkdf.c b/providers/common/kdfs/hkdf.c
index ac5cc34a21..041811f0e1 100644
--- a/providers/common/kdfs/hkdf.c
+++ b/providers/common/kdfs/hkdf.c
@@ -16,7 +16,7 @@
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider_ctx.h"
 #include "internal/providercommonerr.h"
 #include "internal/provider_algs.h"
diff --git a/providers/common/kdfs/kbkdf.c b/providers/common/kdfs/kbkdf.c
index 77cee258e8..ffffef0b17 100644
--- a/providers/common/kdfs/kbkdf.c
+++ b/providers/common/kdfs/kbkdf.c
@@ -35,7 +35,7 @@
 #include <openssl/params.h>
 
 #include "internal/cryptlib.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/numbers.h"
 #include "internal/provider_algs.h"
 #include "internal/provider_ctx.h"
diff --git a/providers/common/kdfs/pbkdf2.c b/providers/common/kdfs/pbkdf2.c
index c8480125b2..b98123b872 100644
--- a/providers/common/kdfs/pbkdf2.c
+++ b/providers/common/kdfs/pbkdf2.c
@@ -16,7 +16,7 @@
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider_ctx.h"
 #include "internal/providercommonerr.h"
 #include "internal/provider_algs.h"
diff --git a/providers/common/kdfs/sskdf.c b/providers/common/kdfs/sskdf.c
index d74da436a2..1e538a9c0a 100644
--- a/providers/common/kdfs/sskdf.c
+++ b/providers/common/kdfs/sskdf.c
@@ -44,7 +44,7 @@
 #include <openssl/params.h>
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider_ctx.h"
 #include "internal/providercommonerr.h"
 #include "internal/provider_algs.h"
diff --git a/providers/common/kdfs/tls1_prf.c b/providers/common/kdfs/tls1_prf.c
index 3053b756dc..af49b1b044 100644
--- a/providers/common/kdfs/tls1_prf.c
+++ b/providers/common/kdfs/tls1_prf.c
@@ -54,7 +54,7 @@
 #include <openssl/params.h>
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider_ctx.h"
 #include "internal/providercommonerr.h"
 #include "internal/provider_algs.h"
diff --git a/providers/default/ciphers/cipher_aria.h b/providers/default/ciphers/cipher_aria.h
index 984be8f4aa..e95e4ca93c 100644
--- a/providers/default/ciphers/cipher_aria.h
+++ b/providers/default/ciphers/cipher_aria.h
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/aria.h"
+#include "crypto/aria.h"
 #include "internal/ciphers/ciphercommon.h"
 
 typedef struct prov_aria_ctx_st {
diff --git a/providers/default/ciphers/cipher_aria_ccm.h b/providers/default/ciphers/cipher_aria_ccm.h
index b3e990766d..fe0a3908bc 100644
--- a/providers/default/ciphers/cipher_aria_ccm.h
+++ b/providers/default/ciphers/cipher_aria_ccm.h
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/aria.h"
+#include "crypto/aria.h"
 #include "internal/ciphers/ciphercommon.h"
 #include "internal/ciphers/cipher_ccm.h"
 
diff --git a/providers/default/ciphers/cipher_aria_gcm.h b/providers/default/ciphers/cipher_aria_gcm.h
index 3499ceaaf7..ac5c248201 100644
--- a/providers/default/ciphers/cipher_aria_gcm.h
+++ b/providers/default/ciphers/cipher_aria_gcm.h
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/aria.h"
+#include "crypto/aria.h"
 #include "internal/ciphers/ciphercommon.h"
 #include "internal/ciphers/cipher_gcm.h"
 
diff --git a/providers/default/ciphers/cipher_des.c b/providers/default/ciphers/cipher_des.c
index a1976fb737..c4eb10be15 100644
--- a/providers/default/ciphers/cipher_des.c
+++ b/providers/default/ciphers/cipher_des.c
@@ -7,9 +7,9 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "cipher_locl.h"
+#include "cipher_local.h"
 #include "cipher_des.h"
-#include "internal/rand_int.h"
+#include "crypto/rand.h"
 #include "internal/provider_algs.h"
 #include "internal/providercommonerr.h"
 
diff --git a/providers/default/ciphers/cipher_sm4.h b/providers/default/ciphers/cipher_sm4.h
index 842c218f30..4740bb3355 100644
--- a/providers/default/ciphers/cipher_sm4.h
+++ b/providers/default/ciphers/cipher_sm4.h
@@ -8,7 +8,7 @@
  */
 
 #include "internal/ciphers/ciphercommon.h"
-#include "internal/sm4.h"
+#include "crypto/sm4.h"
 
 typedef struct prov_cast_ctx_st {
     PROV_CIPHER_CTX base;      /* Must be first */
diff --git a/providers/default/ciphers/cipher_tdes_wrap.c b/providers/default/ciphers/cipher_tdes_wrap.c
index 08662dbdb0..b48b3c9733 100644
--- a/providers/default/ciphers/cipher_tdes_wrap.c
+++ b/providers/default/ciphers/cipher_tdes_wrap.c
@@ -9,8 +9,8 @@
 
 #include <openssl/sha.h>
 #include "cipher_tdes_default.h"
-#include "internal/evp_int.h"
-#include "internal/rand_int.h"
+#include "crypto/evp.h"
+#include "crypto/rand.h"
 #include "internal/provider_algs.h"
 #include "internal/providercommonerr.h"
 
diff --git a/providers/default/include/internal/blake2.h b/providers/default/include/internal/blake2.h
index 1c2808bacc..895cfb87f0 100644
--- a/providers/default/include/internal/blake2.h
+++ b/providers/default/include/internal/blake2.h
@@ -8,8 +8,8 @@
  */
 
 /* TODO(3.0) Move this header into provider when dependencies are removed */
-#ifndef HEADER_BLAKE2_H
-# define HEADER_BLAKE2_H
+#ifndef OSSL_PROVIDERS_DEFAULT_INCLUDE_INTERNAL_BLAKE2_H
+# define OSSL_PROVIDERS_DEFAULT_INCLUDE_INTERNAL_BLAKE2_H
 
 # include <openssl/opensslconf.h>
 
@@ -113,4 +113,4 @@ void blake2s_param_set_key_length(BLAKE2S_PARAM *P, uint8_t keylen);
 void blake2s_param_set_personal(BLAKE2S_PARAM *P, const uint8_t *personal, size_t length);
 void blake2s_param_set_salt(BLAKE2S_PARAM *P, const uint8_t *salt, size_t length);
 
-#endif /* HEADER_BLAKE2_H */
+#endif /* OSSL_PROVIDERS_DEFAULT_INCLUDE_INTERNAL_BLAKE2_H */
diff --git a/providers/default/kdfs/scrypt.c b/providers/default/kdfs/scrypt.c
index abb4437d70..505963eec5 100644
--- a/providers/default/kdfs/scrypt.c
+++ b/providers/default/kdfs/scrypt.c
@@ -14,7 +14,7 @@
 #include <openssl/kdf.h>
 #include <openssl/err.h>
 #include <openssl/core_names.h>
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/numbers.h"
 #include "internal/provider_algs.h"
 #include "internal/provider_ctx.h"
diff --git a/providers/default/kdfs/sshkdf.c b/providers/default/kdfs/sshkdf.c
index 2db5397294..7e6445dbdd 100644
--- a/providers/default/kdfs/sshkdf.c
+++ b/providers/default/kdfs/sshkdf.c
@@ -15,7 +15,7 @@
 #include <openssl/core_names.h>
 #include "internal/cryptlib.h"
 #include "internal/numbers.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider_ctx.h"
 #include "internal/providercommonerr.h"
 #include "internal/provider_algs.h"
diff --git a/providers/default/kdfs/x942kdf.c b/providers/default/kdfs/x942kdf.c
index 7c3afef911..65c586fb99 100644
--- a/providers/default/kdfs/x942kdf.c
+++ b/providers/default/kdfs/x942kdf.c
@@ -24,7 +24,7 @@
 # include <openssl/core_names.h>
 # include "internal/cryptlib.h"
 # include "internal/numbers.h"
-# include "internal/evp_int.h"
+# include "crypto/evp.h"
 # include "internal/provider_ctx.h"
 # include "internal/providercommonerr.h"
 # include "internal/provider_algs.h"
diff --git a/providers/default/macs/poly1305_prov.c b/providers/default/macs/poly1305_prov.c
index e76f982ace..88005716e6 100644
--- a/providers/default/macs/poly1305_prov.c
+++ b/providers/default/macs/poly1305_prov.c
@@ -13,7 +13,7 @@
 #include <openssl/evp.h>
 #include <openssl/err.h>
 
-#include "internal/poly1305.h"
+#include "crypto/poly1305.h"
 /*
  * TODO(3.0) when poly1305 has moved entirely to our providers, this
  * header should be moved to the provider include directory.  For the
diff --git a/providers/default/macs/siphash_prov.c b/providers/default/macs/siphash_prov.c
index 1a36846bfe..a9511925f0 100644
--- a/providers/default/macs/siphash_prov.c
+++ b/providers/default/macs/siphash_prov.c
@@ -14,7 +14,7 @@
 #include <openssl/evp.h>
 #include <openssl/err.h>
 
-#include "internal/siphash.h"
+#include "crypto/siphash.h"
 /*
  * TODO(3.0) when siphash has moved entirely to our providers, this
  * header should be moved to the provider include directory.  For the
diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c
index ce843552d7..166d02496e 100644
--- a/providers/fips/fipsprov.c
+++ b/providers/fips/fipsprov.c
@@ -25,7 +25,7 @@
 
 #include "internal/cryptlib.h"
 #include "internal/property.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 #include "internal/provider_algs.h"
 #include "internal/provider_ctx.h"
 #include "internal/providercommon.h"
diff --git a/providers/fips/selftest.h b/providers/fips/selftest.h
index 3e97e0d786..230d448b1d 100644
--- a/providers/fips/selftest.h
+++ b/providers/fips/selftest.h
@@ -8,7 +8,7 @@
  */
 
 #include <openssl/core_numbers.h>
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 
 typedef struct self_test_post_params_st {
     /* FIPS module integrity check parameters */
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c
index a94fd90e32..b44ec3e5e1 100644
--- a/ssl/bio_ssl.c
+++ b/ssl/bio_ssl.c
@@ -14,7 +14,7 @@
 #include <openssl/crypto.h>
 #include "internal/bio.h"
 #include <openssl/err.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 static int ssl_write(BIO *h, const char *buf, size_t size, size_t *written);
 static int ssl_read(BIO *b, char *buf, size_t size, size_t *readbytes);
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index 01955d7b4f..f30a685150 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -11,7 +11,7 @@
 #include <stdio.h>
 #include <openssl/objects.h>
 #include <openssl/rand.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 static void get_current_time(struct timeval *t);
 static int dtls1_handshake_write(SSL *s);
diff --git a/ssl/d1_msg.c b/ssl/d1_msg.c
index 0dc83614a6..96741efd7c 100644
--- a/ssl/d1_msg.c
+++ b/ssl/d1_msg.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 int dtls1_write_app_data_bytes(SSL *s, int type, const void *buf_, size_t len,
                                size_t *written)
diff --git a/ssl/d1_srtp.c b/ssl/d1_srtp.c
index b6b2025898..6498f84de6 100644
--- a/ssl/d1_srtp.c
+++ b/ssl/d1_srtp.c
@@ -15,7 +15,7 @@
 
 #include <stdio.h>
 #include <openssl/objects.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 #ifndef OPENSSL_NO_SRTP
 
diff --git a/ssl/methods.c b/ssl/methods.c
index 1b80dce635..0b03f80160 100644
--- a/ssl/methods.c
+++ b/ssl/methods.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <openssl/objects.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 /*-
  * TLS/SSLv3 methods
diff --git a/ssl/pqueue.c b/ssl/pqueue.c
index 0c0f735f3b..2e9ceeccd9 100644
--- a/ssl/pqueue.c
+++ b/ssl/pqueue.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include <openssl/bn.h>
 
 struct pqueue_st {
diff --git a/ssl/record/README b/ssl/record/README
index 987e9fd305..630fe8027a 100644
--- a/ssl/record/README
+++ b/ssl/record/README
@@ -12,7 +12,7 @@ of these components is defined by:
 3) A set of accessor macros
 
 All struct definitions are in record.h. The functions and macros are either
-defined in record.h or record_locl.h dependent on whether they are intended to
+defined in record.h or record_local.h dependent on whether they are intended to
 be private to the record layer, or whether they form part of the API to the rest
 of libssl.
 
@@ -55,7 +55,7 @@ Conceptually it looks like this:
                    || rec_layer_d1.c     ||
                    ||____________________||
                    |______________________|
-        record_locl.h     ^   ^   ^
+        record_local.h     ^   ^   ^
          _________________|   |   |_________________
         |                     |                     |
    _____V_________      ______V________      _______V________
diff --git a/ssl/record/dtls1_bitmap.c b/ssl/record/dtls1_bitmap.c
index ec24bf887b..4733a62a96 100644
--- a/ssl/record/dtls1_bitmap.c
+++ b/ssl/record/dtls1_bitmap.c
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "../ssl_locl.h"
-#include "record_locl.h"
+#include "../ssl_local.h"
+#include "record_local.h"
 
 /* mod 128 saturating subtract of two 64-bit values in big-endian order */
 static int satsub64be(const unsigned char *v1, const unsigned char *v2)
diff --git a/ssl/record/rec_layer_d1.c b/ssl/record/rec_layer_d1.c
index 1256f9e0c9..9a82e3ffa2 100644
--- a/ssl/record/rec_layer_d1.c
+++ b/ssl/record/rec_layer_d1.c
@@ -9,10 +9,10 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include "../ssl_locl.h"
+#include "../ssl_local.h"
 #include <openssl/evp.h>
 #include <openssl/buffer.h>
-#include "record_locl.h"
+#include "record_local.h"
 #include "internal/packet.h"
 #include "internal/cryptlib.h"
 
diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index df5f6812eb..876e738a44 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -10,11 +10,11 @@
 #include <stdio.h>
 #include <limits.h>
 #include <errno.h>
-#include "../ssl_locl.h"
+#include "../ssl_local.h"
 #include <openssl/evp.h>
 #include <openssl/buffer.h>
 #include <openssl/rand.h>
-#include "record_locl.h"
+#include "record_local.h"
 #include "internal/packet.h"
 
 #if     defined(OPENSSL_SMALL_FOOTPRINT) || \
diff --git a/ssl/record/record_locl.h b/ssl/record/record_local.h
similarity index 100%
rename from ssl/record/record_locl.h
rename to ssl/record/record_local.h
diff --git a/ssl/record/ssl3_buffer.c b/ssl/record/ssl3_buffer.c
index 09cf587bf3..bffe521947 100644
--- a/ssl/record/ssl3_buffer.c
+++ b/ssl/record/ssl3_buffer.c
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "../ssl_locl.h"
-#include "record_locl.h"
+#include "../ssl_local.h"
+#include "record_local.h"
 
 void SSL3_BUFFER_set_data(SSL3_BUFFER *b, const unsigned char *d, size_t n)
 {
diff --git a/ssl/record/ssl3_record.c b/ssl/record/ssl3_record.c
index c5614dc08e..a08b81c868 100644
--- a/ssl/record/ssl3_record.c
+++ b/ssl/record/ssl3_record.c
@@ -7,11 +7,11 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "../ssl_locl.h"
-#include "internal/constant_time_locl.h"
+#include "../ssl_local.h"
+#include "internal/constant_time.h"
 #include <openssl/trace.h>
 #include <openssl/rand.h>
-#include "record_locl.h"
+#include "record_local.h"
 #include "internal/cryptlib.h"
 
 static const unsigned char ssl3_pad_1[48] = {
diff --git a/ssl/record/ssl3_record_tls13.c b/ssl/record/ssl3_record_tls13.c
index b3bda1f3d5..0429a46729 100644
--- a/ssl/record/ssl3_record_tls13.c
+++ b/ssl/record/ssl3_record_tls13.c
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "../ssl_locl.h"
-#include "record_locl.h"
+#include "../ssl_local.h"
+#include "record_local.h"
 #include "internal/cryptlib.h"
 
 /*-
diff --git a/ssl/s3_cbc.c b/ssl/s3_cbc.c
index 056fb1f6cf..1fe2846cd4 100644
--- a/ssl/s3_cbc.c
+++ b/ssl/s3_cbc.c
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "internal/constant_time_locl.h"
-#include "ssl_locl.h"
+#include "internal/constant_time.h"
+#include "ssl_local.h"
 #include "internal/cryptlib.h"
 
 #include <openssl/md5.h>
diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c
index 3edbae284e..0b2eb669b0 100644
--- a/ssl/s3_enc.c
+++ b/ssl/s3_enc.c
@@ -9,7 +9,7 @@
  */
 
 #include <stdio.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include <openssl/evp.h>
 #include <openssl/md5.h>
 #include <openssl/core_names.h>
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index d23f932ce9..a329915ac9 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -12,7 +12,7 @@
 #include <stdio.h>
 #include <openssl/objects.h>
 #include "internal/nelem.h"
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include <openssl/md5.h>
 #include <openssl/dh.h>
 #include <openssl/rand.h>
diff --git a/ssl/s3_msg.c b/ssl/s3_msg.c
index 83778d3a14..7c021c175a 100644
--- a/ssl/s3_msg.c
+++ b/ssl/s3_msg.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 int ssl3_do_change_cipher_spec(SSL *s)
 {
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c
index e54d5309ef..d2d23d5dc9 100644
--- a/ssl/ssl_asn1.c
+++ b/ssl/ssl_asn1.c
@@ -10,7 +10,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include <openssl/asn1t.h>
 #include <openssl/x509.h>
 
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index f902091968..e3ad6a55ee 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -20,7 +20,7 @@
 #include <openssl/bn.h>
 #include <openssl/crypto.h>
 #include "internal/refcount.h"
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include "ssl_cert_table.h"
 #include "internal/thread_once.h"
 
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c
index e427c407fc..d047b8ff5d 100644
--- a/ssl/ssl_ciph.c
+++ b/ssl/ssl_ciph.c
@@ -18,7 +18,7 @@
 #include <openssl/conf.h>
 #include <openssl/trace.h>
 #include "internal/nelem.h"
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include "internal/thread_once.h"
 #include "internal/cryptlib.h"
 
@@ -93,7 +93,7 @@ static CRYPTO_ONCE ssl_load_builtin_comp_once = CRYPTO_ONCE_STATIC_INIT;
 
 /*
  * Constant SSL_MAX_DIGEST equal to size of digests array should be defined
- * in the ssl_locl.h
+ * in the ssl_local.h
  */
 
 #define SSL_MD_NUM_IDX  SSL_MAX_DIGEST
diff --git a/ssl/ssl_conf.c b/ssl/ssl_conf.c
index f0bec364bb..9ce1e187c4 100644
--- a/ssl/ssl_conf.c
+++ b/ssl/ssl_conf.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include <openssl/conf.h>
 #include <openssl/objects.h>
 #include <openssl/dh.h>
diff --git a/ssl/ssl_init.c b/ssl/ssl_init.c
index 86296136d6..3e85426112 100644
--- a/ssl/ssl_init.c
+++ b/ssl/ssl_init.c
@@ -13,7 +13,7 @@
 #include <openssl/crypto.h>
 #include <openssl/evp.h>
 #include <openssl/trace.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include "internal/thread_once.h"
 
 static int stopped;
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 0d40ecaec9..120566d8e6 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -10,7 +10,7 @@
  */
 
 #include <stdio.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include "e_os.h"
 #include <openssl/objects.h>
 #include <openssl/x509v3.h>
diff --git a/ssl/ssl_locl.h b/ssl/ssl_local.h
similarity index 99%
rename from ssl/ssl_locl.h
rename to ssl/ssl_local.h
index b66979b4da..c6f0af7922 100644
--- a/ssl/ssl_locl.h
+++ b/ssl/ssl_local.h
@@ -9,8 +9,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSL_LOCL_H
-# define HEADER_SSL_LOCL_H
+#ifndef OSSL_SSL_LOCAL_H
+# define OSSL_SSL_LOCAL_H
 
 # include "e_os.h"              /* struct timeval for DTLS */
 # include <stdlib.h>
diff --git a/ssl/ssl_mcnf.c b/ssl/ssl_mcnf.c
index b77c030455..27ba7728d7 100644
--- a/ssl/ssl_mcnf.c
+++ b/ssl/ssl_mcnf.c
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <openssl/conf.h>
 #include <openssl/ssl.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include "internal/sslconf.h"
 
 /* SSL library configuration module. */
diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c
index 2c447eea3e..ae910a04da 100644
--- a/ssl/ssl_rsa.c
+++ b/ssl/ssl_rsa.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdio.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include "internal/packet.h"
 #include <openssl/bio.h>
 #include <openssl/objects.h>
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index f80b8e24a7..8d18ce4504 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -13,8 +13,8 @@
 #include <openssl/engine.h>
 #include "internal/refcount.h"
 #include "internal/cryptlib.h"
-#include "ssl_locl.h"
-#include "statem/statem_locl.h"
+#include "ssl_local.h"
+#include "statem/statem_local.h"
 
 static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s);
 static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *s);
diff --git a/ssl/ssl_stat.c b/ssl/ssl_stat.c
index da8f5ed9e1..3ef0e15814 100644
--- a/ssl/ssl_stat.c
+++ b/ssl/ssl_stat.c
@@ -9,7 +9,7 @@
  */
 
 #include <stdio.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 const char *SSL_state_string_long(const SSL *s)
 {
diff --git a/ssl/ssl_txt.c b/ssl/ssl_txt.c
index 554cc34409..bc3fcfbd1d 100644
--- a/ssl/ssl_txt.c
+++ b/ssl/ssl_txt.c
@@ -10,7 +10,7 @@
 
 #include <stdio.h>
 #include <openssl/buffer.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 #ifndef OPENSSL_NO_STDIO
 int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *x)
diff --git a/ssl/ssl_utst.c b/ssl/ssl_utst.c
index c6a21ab8dc..690db6d497 100644
--- a/ssl/ssl_utst.c
+++ b/ssl/ssl_utst.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 #ifndef OPENSSL_NO_UNIT_TEST
 
diff --git a/ssl/statem/README b/ssl/statem/README
index 145c69db8d..86cc066372 100644
--- a/ssl/statem/README
+++ b/ssl/statem/README
@@ -40,7 +40,7 @@ Conceptually the state machine component is designed as follows:
                    |                            |
                    |    Core state machine code |
                    |____________________________|
-        statem_locl.h     ^          ^
+        statem_local.h     ^          ^
                  _________|          |_______
                 |                            |
    _____________|____________   _____________|____________
diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c
index 68163a20aa..c529579019 100644
--- a/ssl/statem/extensions.c
+++ b/ssl/statem/extensions.c
@@ -10,8 +10,8 @@
 #include <string.h>
 #include "internal/nelem.h"
 #include "internal/cryptlib.h"
-#include "../ssl_locl.h"
-#include "statem_locl.h"
+#include "../ssl_local.h"
+#include "statem_local.h"
 #include "internal/cryptlib.h"
 
 static int final_renegotiate(SSL *s, unsigned int context, int sent);
@@ -92,7 +92,7 @@ typedef struct extensions_definition_st {
 /*
  * Definitions of all built-in extensions. NOTE: Changes in the number or order
  * of these extensions should be mirrored with equivalent changes to the
- * indexes ( TLSEXT_IDX_* ) defined in ssl_locl.h.
+ * indexes ( TLSEXT_IDX_* ) defined in ssl_local.h.
  * Each extension has an initialiser, a client and
  * server side parser and a finaliser. The initialiser is called (if the
  * extension is relevant to the given context) even if we did not see the
diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c
index e6b674cebe..75fecdeaa6 100644
--- a/ssl/statem/extensions_clnt.c
+++ b/ssl/statem/extensions_clnt.c
@@ -8,9 +8,9 @@
  */
 
 #include <openssl/ocsp.h>
-#include "../ssl_locl.h"
+#include "../ssl_local.h"
 #include "internal/cryptlib.h"
-#include "statem_locl.h"
+#include "statem_local.h"
 
 EXT_RETURN tls_construct_ctos_renegotiate(SSL *s, WPACKET *pkt,
                                           unsigned int context, X509 *x,
diff --git a/ssl/statem/extensions_cust.c b/ssl/statem/extensions_cust.c
index cfe57c50e4..78dcd13d9d 100644
--- a/ssl/statem/extensions_cust.c
+++ b/ssl/statem/extensions_cust.c
@@ -10,9 +10,9 @@
 /* Custom extension utility functions */
 
 #include <openssl/ct.h>
-#include "../ssl_locl.h"
+#include "../ssl_local.h"
 #include "internal/cryptlib.h"
-#include "statem_locl.h"
+#include "statem_local.h"
 
 typedef struct {
     void *add_arg;
diff --git a/ssl/statem/extensions_srvr.c b/ssl/statem/extensions_srvr.c
index 1c023fc6c4..194b521877 100644
--- a/ssl/statem/extensions_srvr.c
+++ b/ssl/statem/extensions_srvr.c
@@ -8,8 +8,8 @@
  */
 
 #include <openssl/ocsp.h>
-#include "../ssl_locl.h"
-#include "statem_locl.h"
+#include "../ssl_local.h"
+#include "statem_local.h"
 #include "internal/cryptlib.h"
 
 #define COOKIE_STATE_FORMAT_VERSION     0
diff --git a/ssl/statem/statem.c b/ssl/statem/statem.c
index bd9277b71e..697e33e2b5 100644
--- a/ssl/statem/statem.c
+++ b/ssl/statem/statem.c
@@ -9,8 +9,8 @@
 
 #include "internal/cryptlib.h"
 #include <openssl/rand.h>
-#include "../ssl_locl.h"
-#include "statem_locl.h"
+#include "../ssl_local.h"
+#include "statem_local.h"
 #include <assert.h>
 
 /*
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c
index d096143530..bb37e406c6 100644
--- a/ssl/statem/statem_clnt.c
+++ b/ssl/statem/statem_clnt.c
@@ -12,8 +12,8 @@
 #include <stdio.h>
 #include <time.h>
 #include <assert.h>
-#include "../ssl_locl.h"
-#include "statem_locl.h"
+#include "../ssl_local.h"
+#include "statem_local.h"
 #include <openssl/buffer.h>
 #include <openssl/rand.h>
 #include <openssl/objects.h>
diff --git a/ssl/statem/statem_dtls.c b/ssl/statem/statem_dtls.c
index 8616e98368..564829c808 100644
--- a/ssl/statem/statem_dtls.c
+++ b/ssl/statem/statem_dtls.c
@@ -10,8 +10,8 @@
 #include <limits.h>
 #include <string.h>
 #include <stdio.h>
-#include "../ssl_locl.h"
-#include "statem_locl.h"
+#include "../ssl_local.h"
+#include "statem_local.h"
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
diff --git a/ssl/statem/statem_lib.c b/ssl/statem/statem_lib.c
index 4d3808c559..898c608170 100644
--- a/ssl/statem/statem_lib.c
+++ b/ssl/statem/statem_lib.c
@@ -11,8 +11,8 @@
 #include <limits.h>
 #include <string.h>
 #include <stdio.h>
-#include "../ssl_locl.h"
-#include "statem_locl.h"
+#include "../ssl_local.h"
+#include "statem_local.h"
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/objects.h>
diff --git a/ssl/statem/statem_locl.h b/ssl/statem/statem_local.h
similarity index 100%
rename from ssl/statem/statem_locl.h
rename to ssl/statem/statem_local.h
diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c
index acd3e27087..5f709e5f99 100644
--- a/ssl/statem/statem_srvr.c
+++ b/ssl/statem/statem_srvr.c
@@ -10,9 +10,9 @@
  */
 
 #include <stdio.h>
-#include "../ssl_locl.h"
-#include "statem_locl.h"
-#include "internal/constant_time_locl.h"
+#include "../ssl_local.h"
+#include "statem_local.h"
+#include "internal/constant_time.h"
 #include "internal/cryptlib.h"
 #include <openssl/buffer.h>
 #include <openssl/rand.h>
diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c
index fc082530db..64806a333c 100644
--- a/ssl/t1_enc.c
+++ b/ssl/t1_enc.c
@@ -9,8 +9,8 @@
  */
 
 #include <stdio.h>
-#include "ssl_locl.h"
-#include "record/record_locl.h"
+#include "ssl_local.h"
+#include "record/record_local.h"
 #include "internal/ktls.h"
 #include "internal/cryptlib.h"
 #include <openssl/comp.h>
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c
index 2f7b570a06..f13183a046 100644
--- a/ssl/t1_lib.c
+++ b/ssl/t1_lib.c
@@ -18,7 +18,7 @@
 #include <openssl/dh.h>
 #include <openssl/bn.h>
 #include "internal/nelem.h"
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include <openssl/ct.h>
 
 static const SIGALG_LOOKUP *find_sig_alg(SSL *s, X509 *x, EVP_PKEY *pkey);
diff --git a/ssl/t1_trce.c b/ssl/t1_trce.c
index 489558e052..a2cb4f7385 100644
--- a/ssl/t1_trce.c
+++ b/ssl/t1_trce.c
@@ -7,7 +7,7 @@
  * https://www.openssl.org/source/license.html
  */
 
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 #ifndef OPENSSL_NO_SSL_TRACE
 
diff --git a/ssl/tls13_enc.c b/ssl/tls13_enc.c
index 2339a05aad..266b7dfd21 100644
--- a/ssl/tls13_enc.c
+++ b/ssl/tls13_enc.c
@@ -8,7 +8,7 @@
  */
 
 #include <stdlib.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 #include "internal/cryptlib.h"
 #include <openssl/evp.h>
 #include <openssl/kdf.h>
diff --git a/ssl/tls_srp.c b/ssl/tls_srp.c
index 963c080a3d..d252db33fb 100644
--- a/ssl/tls_srp.c
+++ b/ssl/tls_srp.c
@@ -14,7 +14,7 @@
 #include <openssl/crypto.h>
 #include <openssl/rand.h>
 #include <openssl/err.h>
-#include "ssl_locl.h"
+#include "ssl_local.h"
 
 #ifndef OPENSSL_NO_SRP
 # include <openssl/srp.h>
diff --git a/test/asn1_dsa_internal_test.c b/test/asn1_dsa_internal_test.c
index a62f5e4cd4..21e574d3fb 100644
--- a/test/asn1_dsa_internal_test.c
+++ b/test/asn1_dsa_internal_test.c
@@ -11,7 +11,7 @@
 #include <string.h>
 
 #include <openssl/bn.h>
-#include "internal/asn1_dsa.h"
+#include "crypto/asn1_dsa.h"
 #include "testutil.h"
 
 static unsigned char t_dsa_sig[] = {
diff --git a/test/asn1_internal_test.c b/test/asn1_internal_test.c
index 753449cabb..e77299a7c8 100644
--- a/test/asn1_internal_test.c
+++ b/test/asn1_internal_test.c
@@ -59,7 +59,7 @@ static int test_tbl_standard(void)
  *
  ***/
 
-#include "internal/asn1_int.h"
+#include "crypto/asn1.h"
 #include "../crypto/asn1/standard_methods.h"
 
 static int test_standard_methods(void)
diff --git a/test/bn_internal_test.c b/test/bn_internal_test.c
index cf47e8b734..f3e874960d 100644
--- a/test/bn_internal_test.c
+++ b/test/bn_internal_test.c
@@ -20,7 +20,7 @@
 #include "internal/numbers.h"
 #include "testutil.h"
 #include "bn_prime.h"
-#include "internal/bn_int.h"
+#include "crypto/bn.h"
 
 static BN_CTX *ctx;
 
diff --git a/test/build.info b/test/build.info
index caa70da821..7328641243 100644
--- a/test/build.info
+++ b/test/build.info
@@ -546,7 +546,7 @@ IF[{- !$disabled{tests} -}]
     DEPEND[property_test]=../libcrypto.a libtestutil.a
 
     SOURCE[ctype_internal_test]=ctype_internal_test.c
-    INCLUDE[ctype_internal_test]=.. ../crypto/include ../include ../apps/include
+    INCLUDE[ctype_internal_test]=.. ../include ../apps/include
     DEPEND[ctype_internal_test]=../libcrypto.a libtestutil.a
 
     SOURCE[sparse_array_test]=sparse_array_test.c
@@ -578,11 +578,11 @@ IF[{- !$disabled{tests} -}]
     DEPEND[rdrand_sanitytest]=../libcrypto.a libtestutil.a
 
     SOURCE[rsa_sp800_56b_test]=rsa_sp800_56b_test.c
-    INCLUDE[rsa_sp800_56b_test]=.. ../include ../crypto/include ../crypto/rsa ../apps/include
+    INCLUDE[rsa_sp800_56b_test]=.. ../include ../crypto/rsa ../apps/include
     DEPEND[rsa_sp800_56b_test]=../libcrypto.a libtestutil.a
 
     SOURCE[bn_internal_test]=bn_internal_test.c
-    INCLUDE[bn_internal_test]=.. ../include ../crypto/include ../crypto/bn ../apps/include
+    INCLUDE[bn_internal_test]=.. ../include ../crypto/bn ../apps/include
     DEPEND[bn_internal_test]=../libcrypto.a libtestutil.a
 
     SOURCE[asn1_dsa_internal_test]=asn1_dsa_internal_test.c
diff --git a/test/chacha_internal_test.c b/test/chacha_internal_test.c
index 40f1f12fcd..878bd752e0 100644
--- a/test/chacha_internal_test.c
+++ b/test/chacha_internal_test.c
@@ -15,7 +15,7 @@
 #include <string.h>
 #include <openssl/opensslconf.h>
 #include "testutil.h"
-#include "internal/chacha.h"
+#include "crypto/chacha.h"
 
 static const unsigned int key[] = {
     0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c,
diff --git a/test/cipher_overhead_test.c b/test/cipher_overhead_test.c
index 0492e67ec5..04be8d71cf 100644
--- a/test/cipher_overhead_test.c
+++ b/test/cipher_overhead_test.c
@@ -9,7 +9,7 @@
 
 #include "internal/nelem.h"
 #include "testutil.h"
-#include "../ssl/ssl_locl.h"
+#include "../ssl/ssl_local.h"
 
 static int cipher_overhead(void)
 {
diff --git a/test/cmp_testlib.h b/test/cmp_testlib.h
index afd32b7ce3..22b96bf113 100644
--- a/test/cmp_testlib.h
+++ b/test/cmp_testlib.h
@@ -9,14 +9,14 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_CMP_TEST_LIB_H
-# define HEADER_CMP_TEST_LIB_H
+#ifndef OSSL_TEST_CMP_TESTLIB_H
+# define OSSL_TEST_CMP_TESTLIB_H
 
 # include <openssl/cmp.h>
 # include <openssl/pem.h>
 # include <openssl/rand.h>
 
-#include "../crypto/cmp/cmp_int.h"
+#include "../crypto/cmp/cmp_local.h"
 
 # include "testutil.h"
 
@@ -31,4 +31,4 @@ int STACK_OF_X509_cmp(const STACK_OF(X509) *sk1, const STACK_OF(X509) *sk2);
 int STACK_OF_X509_push1(STACK_OF(X509) *sk, X509 *cert);
 # endif
 
-#endif /* HEADER_CMP_TEST_LIB_H */
+#endif /* OSSL_TEST_CMP_TESTLIB_H */
diff --git a/test/constant_time_test.c b/test/constant_time_test.c
index 97d568aada..044100b14a 100644
--- a/test/constant_time_test.c
+++ b/test/constant_time_test.c
@@ -11,7 +11,7 @@
 #include <stdlib.h>
 
 #include "internal/nelem.h"
-#include "internal/constant_time_locl.h"
+#include "internal/constant_time.h"
 #include "testutil.h"
 #include "internal/numbers.h"
 
diff --git a/test/ctype_internal_test.c b/test/ctype_internal_test.c
index b0aac6a4d2..e2e7dc0bac 100644
--- a/test/ctype_internal_test.c
+++ b/test/ctype_internal_test.c
@@ -8,7 +8,7 @@
  */
 
 #include "testutil.h"
-#include "internal/ctype.h"
+#include "crypto/ctype.h"
 #include "internal/nelem.h"
 #include <ctype.h>
 #include <stdio.h>
diff --git a/test/curve448_internal_test.c b/test/curve448_internal_test.c
index d3e3abab83..054948d23b 100644
--- a/test/curve448_internal_test.c
+++ b/test/curve448_internal_test.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <openssl/e_os2.h>
 #include <openssl/evp.h>
-#include "curve448_lcl.h"
+#include "curve448_local.h"
 #include "testutil.h"
 
 static unsigned int max = 1000;
diff --git a/test/drbg_cavs_data.h b/test/drbg_cavs_data.h
index 1a83b64f06..f37af3a2a8 100644
--- a/test/drbg_cavs_data.h
+++ b/test/drbg_cavs_data.h
@@ -13,8 +13,8 @@
 
 #include <stddef.h>
 
-#ifndef DRBG_CAVS_DATA_H
-# define DRBG_CAVS_DATA_H
+#ifndef OSSL_TEST_DRBG_CAVS_DATA_H
+# define OSSL_TEST_DRBG_CAVS_DATA_H
 
 enum drbg_kat_type {
     NO_RESEED,
diff --git a/test/drbg_cavs_test.c b/test/drbg_cavs_test.c
index 183624c3bc..2c0829da8e 100644
--- a/test/drbg_cavs_test.c
+++ b/test/drbg_cavs_test.c
@@ -15,7 +15,7 @@
 #include <openssl/obj_mac.h>
 #include <openssl/evp.h>
 #include <openssl/aes.h>
-#include "../crypto/rand/rand_lcl.h"
+#include "../crypto/rand/rand_local.h"
 
 #include "testutil.h"
 #include "drbg_cavs_data.h"
diff --git a/test/drbgtest.c b/test/drbgtest.c
index 4559ffd635..93adb48d08 100644
--- a/test/drbgtest.c
+++ b/test/drbgtest.c
@@ -15,8 +15,8 @@
 #include <openssl/obj_mac.h>
 #include <openssl/evp.h>
 #include <openssl/aes.h>
-#include "../crypto/rand/rand_lcl.h"
-#include "../crypto/include/internal/rand_int.h"
+#include "../crypto/rand/rand_local.h"
+#include "../include/crypto/rand.h"
 
 #if defined(_WIN32)
 # include <windows.h>
diff --git a/test/dtls_mtu_test.c b/test/dtls_mtu_test.c
index bba1bdbcef..33603baed6 100644
--- a/test/dtls_mtu_test.c
+++ b/test/dtls_mtu_test.c
@@ -18,7 +18,7 @@
 #include "testutil.h"
 
 /* for SSL_READ_ETM() */
-#include "../ssl/ssl_locl.h"
+#include "../ssl/ssl_local.h"
 
 static int debug = 0;
 
diff --git a/test/ec_internal_test.c b/test/ec_internal_test.c
index 8d3a4fdd67..4b849312be 100644
--- a/test/ec_internal_test.c
+++ b/test/ec_internal_test.c
@@ -10,7 +10,7 @@
 #include "internal/nelem.h"
 #include "testutil.h"
 #include <openssl/ec.h>
-#include "ec_lcl.h"
+#include "ec_local.h"
 #include <openssl/objects.h>
 
 static size_t crv_len = 0;
diff --git a/test/ecdsatest.h b/test/ecdsatest.h
index 216e66e277..63fe319025 100644
--- a/test/ecdsatest.h
+++ b/test/ecdsatest.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef ECDSATEST_CAVS_H
-# define ECDSATEST_CAVS_H
+#ifndef OSSL_TEST_ECDSATEST_H
+# define OSSL_TEST_ECDSATEST_H
 
 /*-
  * NIST CAVP ECDSA KATs:
@@ -10211,4 +10211,4 @@ static const ecdsa_cavs_kat_t ecdsa_cavs_kats[] = {
      "1c8c4343a8ecbf7c4d4e48f7d76d5658bc027c77086ec8b10097deb307d6"}
 # endif                         /* OPENSSL_NO_EC2M */
 };
-#endif                          /* ECDSATEST_CAVS_H */
+#endif                          /* OSSL_TEST_ECDSATEST_H */
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 1898e31de8..12c21e195c 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -24,7 +24,7 @@
 #include <openssl/dsa.h>
 #include "testutil.h"
 #include "internal/nelem.h"
-#include "internal/evp_int.h"
+#include "crypto/evp.h"
 
 /*
  * kExampleRSAKeyDER is an RSA private key in ASN.1, DER format. Of course, you
diff --git a/test/handshake_helper.c b/test/handshake_helper.c
index a85d22e368..c2528b9e1e 100644
--- a/test/handshake_helper.c
+++ b/test/handshake_helper.c
@@ -16,7 +16,7 @@
 #include <openssl/srp.h>
 #endif
 
-#include "../ssl/ssl_locl.h"
+#include "../ssl/ssl_local.h"
 #include "internal/sockets.h"
 #include "internal/nelem.h"
 #include "handshake_helper.h"
diff --git a/test/handshake_helper.h b/test/handshake_helper.h
index 9d04274869..f0ae5a8d7e 100644
--- a/test/handshake_helper.h
+++ b/test/handshake_helper.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_HANDSHAKE_HELPER_H
-#define HEADER_HANDSHAKE_HELPER_H
+#ifndef OSSL_TEST_HANDSHAKE_HELPER_H
+#define OSSL_TEST_HANDSHAKE_HELPER_H
 
 #include "ssl_test_ctx.h"
 
@@ -78,4 +78,4 @@ HANDSHAKE_RESULT *do_handshake(SSL_CTX *server_ctx, SSL_CTX *server2_ctx,
                                SSL_CTX *resume_client_ctx,
                                const SSL_TEST_CTX *test_ctx);
 
-#endif  /* HEADER_HANDSHAKE_HELPER_H */
+#endif  /* OSSL_TEST_HANDSHAKE_HELPER_H */
diff --git a/test/mdc2test.c b/test/mdc2test.c
index d1c2f26bdc..f8c492297e 100644
--- a/test/mdc2test.c
+++ b/test/mdc2test.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <openssl/provider.h>
 #include <openssl/params.h>
-#include <openssl/ossl_typ.h>
+#include <openssl/types.h>
 #include <openssl/core_names.h>
 #include "internal/nelem.h"
 #include "testutil.h"
diff --git a/test/modes_internal_test.c b/test/modes_internal_test.c
index 02e5c8d0a8..37ca2b14bd 100644
--- a/test/modes_internal_test.c
+++ b/test/modes_internal_test.c
@@ -15,7 +15,7 @@
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 #include "testutil.h"
-#include "internal/modes_int.h"
+#include "crypto/modes.h"
 #include "internal/nelem.h"
 
 typedef struct {
diff --git a/test/ossl_shim/async_bio.h b/test/ossl_shim/async_bio.h
index d1b0462e65..0d3b0ebc6e 100644
--- a/test/ossl_shim/async_bio.h
+++ b/test/ossl_shim/async_bio.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_ASYNC_BIO
-#define HEADER_ASYNC_BIO
+#ifndef OSSL_TEST_SHIM_ASYNC_BIO_H
+#define OSSL_TEST_SHIM_ASYNC_BIO_H
 
 #include <openssl/base.h>
 #include <openssl/bio.h>
@@ -36,4 +36,4 @@ void AsyncBioAllowWrite(BIO *bio, size_t count);
 void AsyncBioEnforceWriteQuota(BIO *bio, bool enforce);
 
 
-#endif  // HEADER_ASYNC_BIO
+#endif  // OSSL_TEST_SHIM_ASYNC_BIO_H
diff --git a/test/ossl_shim/include/openssl/base.h b/test/ossl_shim/include/openssl/base.h
index 464d910aa2..92e3648e1c 100644
--- a/test/ossl_shim/include/openssl/base.h
+++ b/test/ossl_shim/include/openssl/base.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef OPENSSL_HEADER_BASE_H
-#define OPENSSL_HEADER_BASE_H
+#ifndef OSSL_TEST_SHIM_INCLUDE_OPENSSL_BASE_H
+#define OSSL_TEST_SHIM_INCLUDE_OPENSSL_BASE_H
 
 /* Needed for BORINGSSL_MAKE_DELETER */
 # include <openssl/bio.h>
@@ -108,4 +108,4 @@ BORINGSSL_MAKE_DELETER(SSL_SESSION, SSL_SESSION_free)
 }  /* extern C++ */
 
 
-#endif  /* OPENSSL_HEADER_BASE_H */
+#endif  /* OSSL_TEST_SHIM_INCLUDE_OPENSSL_BASE_H */
diff --git a/test/ossl_shim/packeted_bio.h b/test/ossl_shim/packeted_bio.h
index e46d9dcb33..27678bd7e6 100644
--- a/test/ossl_shim/packeted_bio.h
+++ b/test/ossl_shim/packeted_bio.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_PACKETED_BIO
-#define HEADER_PACKETED_BIO
+#ifndef OSSL_TEST_SHIM_PACKETED_BIO_H
+#define OSSL_TEST_SHIM_PACKETED_BIO_H
 
 #include <openssl/base.h>
 #include <openssl/bio.h>
@@ -32,4 +32,4 @@ timeval PacketedBioGetClock(const BIO *bio);
 bool PacketedBioAdvanceClock(BIO *bio);
 
 
-#endif  // HEADER_PACKETED_BIO
+#endif  // OSSL_TEST_SHIM_PACKETED_BIO_H
diff --git a/test/ossl_shim/test_config.h b/test/ossl_shim/test_config.h
index 87b540d495..83677df52b 100644
--- a/test/ossl_shim/test_config.h
+++ b/test/ossl_shim/test_config.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_TEST_CONFIG
-#define HEADER_TEST_CONFIG
+#ifndef OSSL_TEST_SHIM_TEST_CONFIG_H
+#define OSSL_TEST_SHIM_TEST_CONFIG_H
 
 #include <string>
 #include <vector>
@@ -85,4 +85,4 @@ struct TestConfig {
 bool ParseConfig(int argc, char **argv, TestConfig *out_config);
 
 
-#endif  // HEADER_TEST_CONFIG
+#endif  // OSSL_TEST_SHIM_TEST_CONFIG_H
diff --git a/test/ossl_test_endian.h b/test/ossl_test_endian.h
index 0bcec047e6..38711d0d76 100644
--- a/test/ossl_test_endian.h
+++ b/test/ossl_test_endian.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_INTERNAL_ENDIAN_H
-# define HEADER_INTERNAL_ENDIAN_H
+#ifndef OSSL_TEST_OSSL_TEST_ENDIAN_H
+# define OSSL_TEST_OSSL_TEST_ENDIAN_H
 
 # define DECLARE_IS_ENDIAN \
     const union { \
diff --git a/test/poly1305_internal_test.c b/test/poly1305_internal_test.c
index e2f9381621..504e474b7c 100644
--- a/test/poly1305_internal_test.c
+++ b/test/poly1305_internal_test.c
@@ -13,7 +13,7 @@
 #include <string.h>
 
 #include "testutil.h"
-#include "internal/poly1305.h"
+#include "crypto/poly1305.h"
 #include "../crypto/poly1305/poly1305_local.h"
 #include "internal/nelem.h"
 
diff --git a/test/property_test.c b/test/property_test.c
index 29e8ac3f51..8b953e41e2 100644
--- a/test/property_test.c
+++ b/test/property_test.c
@@ -12,7 +12,7 @@
 #include "testutil.h"
 #include "internal/nelem.h"
 #include "internal/property.h"
-#include "../crypto/property/property_lcl.h"
+#include "../crypto/property/property_local.h"
 
 static int add_property_names(const char *n, ...)
 {
diff --git a/test/rsa_sp800_56b_test.c b/test/rsa_sp800_56b_test.c
index 89dab09c44..1e6ea8d0b6 100644
--- a/test/rsa_sp800_56b_test.c
+++ b/test/rsa_sp800_56b_test.c
@@ -26,7 +26,7 @@ int setup_tests(void)
     return 1;
 }
 #else
-# include "rsa_locl.h"
+# include "rsa_local.h"
 # include <openssl/rsa.h>
 
 /* taken from RSA2 cavs data */
diff --git a/test/shlibloadtest.c b/test/shlibloadtest.c
index 6934b89dc0..bbac99674e 100644
--- a/test/shlibloadtest.c
+++ b/test/shlibloadtest.c
@@ -12,8 +12,8 @@
 #include <stdlib.h>
 #include <openssl/opensslv.h>
 #include <openssl/ssl.h>
-#include <openssl/ossl_typ.h>
-#include "internal/dso_conf.h"
+#include <openssl/types.h>
+#include "crypto/dso_conf.h"
 
 typedef void DSO;
 
diff --git a/test/siphash_internal_test.c b/test/siphash_internal_test.c
index 75caefd899..e77e9d265f 100644
--- a/test/siphash_internal_test.c
+++ b/test/siphash_internal_test.c
@@ -14,7 +14,7 @@
 
 #include <openssl/bio.h>
 #include "testutil.h"
-#include "internal/siphash.h"
+#include "crypto/siphash.h"
 #include "../crypto/siphash/siphash_local.h"
 #include "internal/nelem.h"
 
diff --git a/test/sm2_internal_test.c b/test/sm2_internal_test.c
index 8e76daa913..0c626526b1 100644
--- a/test/sm2_internal_test.c
+++ b/test/sm2_internal_test.c
@@ -21,7 +21,7 @@
 
 #ifndef OPENSSL_NO_SM2
 
-# include "internal/sm2.h"
+# include "crypto/sm2.h"
 
 static RAND_METHOD fake_rand;
 static const RAND_METHOD *saved_rand;
diff --git a/test/sm4_internal_test.c b/test/sm4_internal_test.c
index 7ccd6e46db..0a5ea738e5 100644
--- a/test/sm4_internal_test.c
+++ b/test/sm4_internal_test.c
@@ -17,7 +17,7 @@
 #include "testutil.h"
 
 #ifndef OPENSSL_NO_SM4
-# include "internal/sm4.h"
+# include "crypto/sm4.h"
 
 static int test_sm4_ecb(void)
 {
diff --git a/test/sparse_array_test.c b/test/sparse_array_test.c
index 5cc8038f7f..2c7f5a878c 100644
--- a/test/sparse_array_test.c
+++ b/test/sparse_array_test.c
@@ -15,7 +15,7 @@
 #include <openssl/crypto.h>
 #include <internal/nelem.h>
 
-#include "internal/sparse_array.h"
+#include "crypto/sparse_array.h"
 #include "testutil.h"
 
 /* The macros below generate unused functions which error out one of the clang
diff --git a/test/ssl_cert_table_internal_test.c b/test/ssl_cert_table_internal_test.c
index 81274db980..d6e93af5b6 100644
--- a/test/ssl_cert_table_internal_test.c
+++ b/test/ssl_cert_table_internal_test.c
@@ -15,7 +15,7 @@
 #include <openssl/ssl.h>
 #include "testutil.h"
 #include "internal/nelem.h"
-#include "../ssl/ssl_locl.h"
+#include "../ssl/ssl_local.h"
 #include "../ssl/ssl_cert_table.h"
 
 #define test_cert_table(nid, amask, idx) \
diff --git a/test/ssl_test_ctx.h b/test/ssl_test_ctx.h
index 3a21ac52d9..29a989abc8 100644
--- a/test/ssl_test_ctx.h
+++ b/test/ssl_test_ctx.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSL_TEST_CTX_H
-#define HEADER_SSL_TEST_CTX_H
+#ifndef OSSL_TEST_SSL_TEST_CTX_H
+#define OSSL_TEST_SSL_TEST_CTX_H
 
 #include <openssl/conf.h>
 #include <openssl/ssl.h>
@@ -250,4 +250,4 @@ SSL_TEST_CTX *SSL_TEST_CTX_new(void);
 
 void SSL_TEST_CTX_free(SSL_TEST_CTX *ctx);
 
-#endif  /* HEADER_SSL_TEST_CTX_H */
+#endif  /* OSSL_TEST_SSL_TEST_CTX_H */
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 4b510eb3f7..2442b6967d 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -25,7 +25,7 @@
 #include "testutil/output.h"
 #include "internal/nelem.h"
 #include "internal/ktls.h"
-#include "../ssl/ssl_locl.h"
+#include "../ssl/ssl_local.h"
 
 #ifndef OPENSSL_NO_TLS1_3
 
diff --git a/test/ssltestlib.h b/test/ssltestlib.h
index 32d3bfb3f6..a45aaf81de 100644
--- a/test/ssltestlib.h
+++ b/test/ssltestlib.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_SSLTESTLIB_H
-# define HEADER_SSLTESTLIB_H
+#ifndef OSSL_TEST_SSLTESTLIB_H
+# define OSSL_TEST_SSLTESTLIB_H
 
 # include <openssl/ssl.h>
 
@@ -56,4 +56,4 @@ typedef struct mempacket_st MEMPACKET;
 
 DEFINE_STACK_OF(MEMPACKET)
 
-#endif /* HEADER_SSLTESTLIB_H */
+#endif /* OSSL_TEST_SSLTESTLIB_H */
diff --git a/test/testutil.h b/test/testutil.h
index f7d00dc813..57ab15356c 100644
--- a/test/testutil.h
+++ b/test/testutil.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_TESTUTIL_H
-# define HEADER_TESTUTIL_H
+#ifndef OSSL_TESTUTIL_H
+# define OSSL_TESTUTIL_H
 
 #include <stdarg.h>
 
@@ -548,4 +548,4 @@ void test_random_seed(uint32_t sd);
 /* Create a file path from a directory and a filename */
 char *test_mk_file_path(const char *dir, const char *file);
 
-#endif                          /* HEADER_TESTUTIL_H */
+#endif                          /* OSSL_TESTUTIL_H */
diff --git a/test/testutil/output.h b/test/testutil/output.h
index e637c7bd4b..def76af151 100644
--- a/test/testutil/output.h
+++ b/test/testutil/output.h
@@ -7,8 +7,8 @@
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_TU_OUTPUT_H
-# define HEADER_TU_OUTPUT_H
+#ifndef OSSL_TESTUTIL_OUTPUT_H
+# define OSSL_TESTUTIL_OUTPUT_H
 
 # include <stdarg.h>
 
@@ -53,4 +53,4 @@ int test_printf_stderr(const char *fmt, ...)
 # undef ossl_test__printf__
 # undef ossl_test__attr__
 
-#endif                          /* HEADER_TU_OUTPUT_H */
+#endif                          /* OSSL_TESTUTIL_OUTPUT_H */
diff --git a/test/tls13encryptiontest.c b/test/tls13encryptiontest.c
index a5580a2992..84a8557e4e 100644
--- a/test/tls13encryptiontest.c
+++ b/test/tls13encryptiontest.c
@@ -9,8 +9,8 @@
 
 #include <openssl/ssl.h>
 #include <openssl/evp.h>
-#include "../ssl/ssl_locl.h"
-#include "../ssl/record/record_locl.h"
+#include "../ssl/ssl_local.h"
+#include "../ssl/record/record_local.h"
 #include "internal/nelem.h"
 #include "testutil.h"
 
diff --git a/test/tls13secretstest.c b/test/tls13secretstest.c
index 4756faac00..def78b9920 100644
--- a/test/tls13secretstest.c
+++ b/test/tls13secretstest.c
@@ -10,7 +10,7 @@
 #include <openssl/ssl.h>
 #include <openssl/evp.h>
 
-#include "../ssl/ssl_locl.h"
+#include "../ssl/ssl_local.h"
 #include "testutil.h"
 
 #define IVLEN   12
diff --git a/util/fix-includes b/util/fix-includes
new file mode 100755
index 0000000000..c49163875b
--- /dev/null
+++ b/util/fix-includes
@@ -0,0 +1,19 @@
+#!/bin/sh
+#
+# Copyright 2019 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
+
+find -name ossl_typ.h -o \( \
+	 -name '*.h' -o \
+	 -name '*.h.in' -o \
+	 -name '*.c' -o \
+	 -name '*.ec' -o \
+	 -name 'README*' -o \
+	 -name '*.pod' -o \
+	 -name '*.conf' \
+	 \) -exec sed -E -i \
+	 -f util/fix-includes.sed {} \;
diff --git a/util/fix-includes.sed b/util/fix-includes.sed
new file mode 100644
index 0000000000..5272e363fc
--- /dev/null
+++ b/util/fix-includes.sed
@@ -0,0 +1,6 @@
+s|internal/([a-z0-9_]+)_int\.h|crypto/\1.h|g ;
+s at internal/(aria.h|asn1_dsa.h|async.h|bn_conf.h|bn_conf.h|bn_dh.h|bn_srp.h|chacha.h|ciphermode_platform.h|ctype.h|__DECC_INCLUDE_EPILOGUE.H|__DECC_INCLUDE_PROLOGUE.H|dso_conf.h|dso_conf.h|engine.h|lhash.h|md32_common.h|objects.h|poly1305.h|sha.h|siphash.h|sm2err.h|sm2.h|sm4.h|sparse_array.h|store.h|foobar)@crypto/\1 at g ;
+s/constant_time_locl/constant_time/g ;
+s/_lo?cl\.h/_local.h/g ;
+s/_int\.h/_local.h/g ;
+s|openssl/ossl_typ\.h|openssl/types.h|g ;
diff --git a/util/mkerr.pl b/util/mkerr.pl
index c2888890cd..c8ec94d288 100755
--- a/util/mkerr.pl
+++ b/util/mkerr.pl
@@ -447,8 +447,8 @@ foreach my $lib ( keys %errorfile ) {
  * https://www.openssl.org/source/license.html
  */
 
-#ifndef HEADER_${lib}ERR_H
-# define HEADER_${lib}ERR_H
+#ifndef OPENSSL_${lib}ERR_H
+# define OPENSSL_${lib}ERR_H
 
 # include <openssl/opensslconf.h>
 # include <openssl/symhacks.h>


More information about the openssl-commits mailing list