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@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9333)
diff --git a/ssl/bio_ssl.c b/ssl/bio_ssl.c
index a94fd90..b44ec3e 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 01955d7..f30a685 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 0dc8361..96741ef 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 b6b2025..6498f84 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 1b80dce..0b03f80 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 0c0f735..2e9ceec 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 987e9fd..630fe80 100644
--- a/ssl/record/README
+++ b/ssl/record/README
@@ -12,7 +12,7 @@
 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 @@
                    || 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 ec24bf8..4733a62 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 1256f9e..9a82e3f 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 df5f681..876e738 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 09cf587..bffe521 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 c5614dc..a08b81c 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 b3bda1f..0429a46 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 056fb1f..1fe2846 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 3edbae2..0b2eb66 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 d23f932..a329915 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 83778d3..7c021c1 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 e54d530..d2d23d5 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 f902091..e3ad6a5 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 e427c40..d047b8f 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 @@
 
 /*
  * 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 f0bec36..9ce1e18 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 8629613..3e85426 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 0d40eca..120566d 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 100%
rename from ssl/ssl_locl.h
rename to ssl/ssl_local.h
diff --git a/ssl/ssl_mcnf.c b/ssl/ssl_mcnf.c
index b77c030..27ba772 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 2c447ee..ae910a0 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 f80b8e2..8d18ce4 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 da8f5ed..3ef0e15 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 554cc34..bc3fcfb 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 c6a21ab..690db6d 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 145c69d..86cc066 100644
--- a/ssl/statem/README
+++ b/ssl/statem/README
@@ -40,7 +40,7 @@
                    |                            |
                    |    Core state machine code |
                    |____________________________|
-        statem_locl.h     ^          ^
+        statem_local.h     ^          ^
                  _________|          |_______
                 |                            |
    _____________|____________   _____________|____________
diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c
index 68163a2..c529579 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 @@
 /*
  * 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 e6b674c..75fecde 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 cfe57c5..78dcd13 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 1c023fc..194b521 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 bd9277b..697e33e 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 d096143..bb37e40 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 8616e98..564829c 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 4d3808c..898c608 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 acd3e27..5f709e5 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 fc08253..64806a3 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 2f7b570..f13183a 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 489558e..a2cb4f7 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 2339a05..266b7df 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 963c080..d252db3 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>