summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Rühsen <tim.ruehsen@gmx.de>2019-05-08 07:46:40 +0000
committerTim Rühsen <tim.ruehsen@gmx.de>2019-05-08 07:46:40 +0000
commit664fc06c44301eb811a28b444f35dd8e3c688dea (patch)
tree5fbe7626602bdb11e91a8b7e5cd92ae792424657
parent03e1f6430150ef19d432e56d334b0f1d2424aeaa (diff)
parentd726c955344bbcda9b17c5b5f17785a68f0870b9 (diff)
downloadgnutls-664fc06c44301eb811a28b444f35dd8e3c688dea.tar.gz
Merge branch 'tmp-header-guards' into 'master'
Add or clean header guards in lib/ Closes #728 See merge request gnutls/gnutls!954
-rw-r--r--CONTRIBUTING.md22
-rw-r--r--lib/abstract_int.h6
-rw-r--r--lib/algorithms.h6
-rw-r--r--lib/atfork.h6
-rw-r--r--lib/atomic.h6
-rw-r--r--lib/auth.h6
-rw-r--r--lib/auth/anon.h5
-rw-r--r--lib/auth/cert.h7
-rw-r--r--lib/auth/dh_common.h6
-rw-r--r--lib/auth/ecdhe.h6
-rw-r--r--lib/auth/psk.h6
-rw-r--r--lib/auth/psk_passwd.h5
-rw-r--r--lib/auth/rsa_common.h6
-rw-r--r--lib/auth/srp_kx.h6
-rw-r--r--lib/auth/srp_passwd.h5
-rw-r--r--lib/buffers.h7
-rw-r--r--lib/cert-cred.h5
-rw-r--r--lib/cipher.h5
-rw-r--r--lib/cipher_int.h6
-rw-r--r--lib/constate.h6
-rw-r--r--lib/crypto-api.h6
-rw-r--r--lib/crypto-backend.h6
-rw-r--r--lib/crypto.h6
-rw-r--r--lib/datum.h6
-rw-r--r--lib/db.h5
-rw-r--r--lib/debug.h5
-rw-r--r--lib/dh.h6
-rw-r--r--lib/dtls.h6
-rw-r--r--lib/ecc.h6
-rw-r--r--lib/errors.h6
-rw-r--r--lib/ext/alpn.h7
-rw-r--r--lib/ext/cert_types.h5
-rw-r--r--lib/ext/client_cert_type.h6
-rw-r--r--lib/ext/cookie.h6
-rw-r--r--lib/ext/dumbfw.h7
-rw-r--r--lib/ext/early_data.h6
-rw-r--r--lib/ext/ec_point_formats.h7
-rw-r--r--lib/ext/etm.h6
-rw-r--r--lib/ext/ext_master_secret.h6
-rw-r--r--lib/ext/heartbeat.h7
-rw-r--r--lib/ext/key_share.h6
-rw-r--r--lib/ext/max_record.h6
-rw-r--r--lib/ext/post_handshake.h6
-rw-r--r--lib/ext/pre_shared_key.h6
-rw-r--r--lib/ext/psk_ke_modes.h6
-rw-r--r--lib/ext/record_size_limit.h6
-rw-r--r--lib/ext/safe_renegotiation.h6
-rw-r--r--lib/ext/server_cert_type.h6
-rw-r--r--lib/ext/server_name.h7
-rw-r--r--lib/ext/session_ticket.h6
-rw-r--r--lib/ext/signature.h8
-rw-r--r--lib/ext/srp.h6
-rw-r--r--lib/ext/srtp.h5
-rw-r--r--lib/ext/status_request.h6
-rw-r--r--lib/ext/supported_groups.h7
-rw-r--r--lib/ext/supported_versions.h6
-rw-r--r--lib/extras/hex.h10
-rw-r--r--lib/extras/randomart.h5
-rw-r--r--lib/extv.h6
-rw-r--r--lib/file.h5
-rw-r--r--lib/fips.h6
-rw-r--r--lib/global.h6
-rw-r--r--lib/gnutls_int.h6
-rw-r--r--lib/gthreads.h5
-rw-r--r--lib/handshake.h6
-rw-r--r--lib/hash_int.h6
-rw-r--r--lib/hello_ext.h6
-rw-r--r--lib/hello_ext_lib.h6
-rw-r--r--lib/kx.h5
-rw-r--r--lib/locks.h6
-rw-r--r--lib/mbuffers.h6
-rw-r--r--lib/mem.h6
-rw-r--r--lib/mpi.h6
-rw-r--r--lib/nettle/backport/cfb8.h7
-rw-r--r--lib/nettle/backport/cmac.h7
-rw-r--r--lib/nettle/backport/xts.h6
-rw-r--r--lib/nettle/gnettle.h5
-rw-r--r--lib/nettle/gost/bignum-le.h6
-rw-r--r--lib/nettle/gost/ecc-gost-curve.h6
-rw-r--r--lib/nettle/gost/ecc-gost256cpa-32.h5
-rw-r--r--lib/nettle/gost/ecc-gost256cpa-64.h5
-rw-r--r--lib/nettle/gost/ecc-gost512a-32.h5
-rw-r--r--lib/nettle/gost/ecc-gost512a-64.h5
-rw-r--r--lib/nettle/gost/ecc-internal.h6
-rw-r--r--lib/nettle/gost/gmp-glue.h6
-rw-r--r--lib/nettle/gost/gost28147.h6
-rw-r--r--lib/nettle/gost/gostdsa.h6
-rw-r--r--lib/nettle/gost/gosthash94.h6
-rw-r--r--lib/nettle/gost/hmac-gost.h6
-rw-r--r--lib/nettle/gost/nettle-internal.h6
-rw-r--r--lib/nettle/gost/nettle-write.h6
-rw-r--r--lib/nettle/gost/pbkdf2-gost.h6
-rw-r--r--lib/nettle/gost/streebog.h6
-rw-r--r--lib/nettle/int/drbg-aes.h6
-rw-r--r--lib/nettle/int/dsa-fips.h6
-rw-r--r--lib/nettle/int/rsa-fips.h6
-rw-r--r--lib/nettle/int/tls1-prf.h6
-rw-r--r--lib/nettle/rnd-common.h5
-rw-r--r--lib/num.h6
-rw-r--r--lib/pin.h6
-rw-r--r--lib/pk.h6
-rw-r--r--lib/pkcs11_int.h6
-rw-r--r--lib/pkcs11x.h6
-rw-r--r--lib/random.h6
-rw-r--r--lib/record.h6
-rw-r--r--lib/secrets.h7
-rw-r--r--lib/session_pack.h5
-rw-r--r--lib/srp.h6
-rw-r--r--lib/sslv2_compat.h5
-rw-r--r--lib/state.h8
-rw-r--r--lib/stek.h6
-rw-r--r--lib/str.h6
-rw-r--r--lib/str_array.h6
-rw-r--r--lib/supplemental.h5
-rw-r--r--lib/system-keys.h6
-rw-r--r--lib/system.h6
-rw-r--r--lib/tls-sig.h6
-rw-r--r--lib/tls13-sig.h6
-rw-r--r--lib/tls13/anti_replay.h5
-rw-r--r--lib/tls13/certificate.h5
-rw-r--r--lib/tls13/certificate_request.h5
-rw-r--r--lib/tls13/certificate_verify.h5
-rw-r--r--lib/tls13/early_data.h5
-rw-r--r--lib/tls13/encrypted_extensions.h5
-rw-r--r--lib/tls13/finished.h5
-rw-r--r--lib/tls13/hello_retry.h5
-rw-r--r--lib/tls13/key_update.h5
-rw-r--r--lib/tls13/psk_ext_parser.h5
-rw-r--r--lib/tls13/session_ticket.h7
-rw-r--r--lib/urls.h5
-rw-r--r--lib/x509.h5
-rw-r--r--lib/x509/attributes.h5
-rw-r--r--lib/x509/common.h6
-rw-r--r--lib/x509/ip-in-cidr.h5
-rw-r--r--lib/x509/ip.h6
-rw-r--r--lib/x509/krb5.h5
-rw-r--r--lib/x509/ocsp.h5
-rw-r--r--lib/x509/pkcs7_int.h6
-rw-r--r--lib/x509/prov-seed.h5
-rw-r--r--lib/x509/verify-high.h6
-rw-r--r--lib/x509/virt-san.h6
-rw-r--r--lib/x509/x509_ext_int.h6
-rw-r--r--lib/x509/x509_int.h6
-rw-r--r--lib/x509_b64.h5
-rw-r--r--src/benchmark.h5
-rw-r--r--src/certtool-cfg.h5
-rw-r--r--src/certtool-common.h6
-rw-r--r--src/common.h6
-rwxr-xr-xsrc/inline_cmds.h5
-rw-r--r--src/list.h9
-rw-r--r--src/ocsptool-common.h6
-rw-r--r--src/p11tool.h6
-rw-r--r--src/tests.h5
-rw-r--r--src/udp-serv.h5
-rw-r--r--tests/cert-common.h5
-rw-r--r--tests/cert-repro-20170915.h5
-rw-r--r--tests/cmocka-common.h5
-rw-r--r--tests/common-cert-key-exchange.h5
-rw-r--r--tests/common-key-tests.h5
-rw-r--r--tests/eagain-common.h5
-rw-r--r--tests/hex.h6
-rw-r--r--tests/ocsp-common.h6
-rw-r--r--tests/test-chains.h5
-rw-r--r--tests/utils.h6
-rw-r--r--tests/virt-time.h6
-rw-r--r--tests/x509sign-verify-common.h5
166 files changed, 645 insertions, 337 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e38bba321e..3a20170f6b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -115,6 +115,28 @@ They can however be used by unit tests in tests/ directory; in that
case they should be part of the GNUTLS_PRIVATE_3_4 tag in libgnutls.map.
+# Header guards
+
+ Each private C header file SHOULD have a header guard consisting of the
+project name and the file path relative to the project directory, all uppercase.
+
+Example: `lib/srp.h` uses the header guard `GNUTLS_LIB_SRP_H`.
+
+The header guard is used as first and last effective code in a header file,
+like e.g. in lib/srp.h:
+
+```
+#ifndef GNUTLS_LIB_SRP_H
+#define GNUTLS_LIB_SRP_H
+
+...
+
+#endif /* GNUTLS_LIB_SRP_H */
+
+The public header files follow a similar convention but use the relative
+install directory as template, e.g. `GNUTLS_GNUTLS_H` for `gnutls/gnutls.h`.
+
+
# Introducing new functions / API
Prior to introducing any new API consider all options to offer the same
diff --git a/lib/abstract_int.h b/lib/abstract_int.h
index 8900e51dbc..8f436b0a9f 100644
--- a/lib/abstract_int.h
+++ b/lib/abstract_int.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef _ABSTRACT_INT_H
-#define _ABSTRACT_INT_H
+#ifndef GNUTLS_LIB_ABSTRACT_INT_H
+#define GNUTLS_LIB_ABSTRACT_INT_H
#include <gnutls/abstract.h>
@@ -121,4 +121,4 @@ const mac_entry_st *_gnutls_dsa_q_to_hash(const gnutls_pk_params_st *
int
_gnutls_privkey_get_mpis(gnutls_privkey_t key, gnutls_pk_params_st * params);
-#endif
+#endif /* GNUTLS_LIB_ABSTRACT_INT_H */
diff --git a/lib/algorithms.h b/lib/algorithms.h
index c1977a368a..6f82879d31 100644
--- a/lib/algorithms.h
+++ b/lib/algorithms.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef ALGORITHMS_H
-#define ALGORITHMS_H
+#ifndef GNUTLS_LIB_ALGORITHMS_H
+#define GNUTLS_LIB_ALGORITHMS_H
#include "auth.h"
@@ -478,4 +478,4 @@ static inline int _sig_is_ecdsa(gnutls_sign_algorithm_t sig)
bool _gnutls_pk_are_compat(gnutls_pk_algorithm_t pk1, gnutls_pk_algorithm_t pk2);
-#endif
+#endif /* GNUTLS_LIB_ALGORITHMS_H */
diff --git a/lib/atfork.h b/lib/atfork.h
index d3cbbcce97..8c779ef9b9 100644
--- a/lib/atfork.h
+++ b/lib/atfork.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef ATFORK_H
-# define ATFORK_H
+#ifndef GNUTLS_LIB_ATFORK_H
+#define GNUTLS_LIB_ATFORK_H
#include <config.h>
#include "gnutls_int.h"
@@ -61,4 +61,4 @@ unsigned int _gnutls_get_forkid(void);
#endif
-#endif
+#endif /* GNUTLS_LIB_ATFORK_H */
diff --git a/lib/atomic.h b/lib/atomic.h
index a53f3a2d05..b6db70375f 100644
--- a/lib/atomic.h
+++ b/lib/atomic.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_ATOMIC_H
-#define GNUTLS_ATOMIC_H
+#ifndef GNUTLS_LIB_ATOMIC_H
+#define GNUTLS_LIB_ATOMIC_H
#ifdef HAVE_STDATOMIC_H
# include <stdatomic.h>
@@ -78,4 +78,4 @@ inline static void gnutls_atomic_deinit(gnutls_atomic_uint_t x)
}
#endif
-#endif
+#endif /* GNUTLS_LIB_ATOMIC_H */
diff --git a/lib/auth.h b/lib/auth.h
index 6b95e1d142..7e2f3afdc4 100644
--- a/lib/auth.h
+++ b/lib/auth.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_AUTH_H
-#define GNUTLS_AUTH_H
+#ifndef GNUTLS_LIB_AUTH_H
+#define GNUTLS_LIB_AUTH_H
#include "str.h"
@@ -83,4 +83,4 @@ void *_gnutls_get_auth_info(gnutls_session_t session, gnutls_credentials_type_t
return NULL;
}
-#endif
+#endif /* GNUTLS_LIB_AUTH_H */
diff --git a/lib/auth/anon.h b/lib/auth/anon.h
index 3f4a5112df..3a8db4b5b3 100644
--- a/lib/auth/anon.h
+++ b/lib/auth/anon.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_AUTH_ANON_H
+#define GNUTLS_LIB_AUTH_ANON_H
+
/* this is not to be included by gnutls_anon.c */
#include <auth.h>
#include <auth/dh_common.h>
@@ -45,3 +48,5 @@ typedef struct anon_auth_info_st {
} *anon_auth_info_t;
typedef struct anon_auth_info_st anon_auth_info_st;
+
+#endif /* GNUTLS_LIB_AUTH_ANON_H */
diff --git a/lib/auth/cert.h b/lib/auth/cert.h
index c494975fa7..4499320865 100644
--- a/lib/auth/cert.h
+++ b/lib/auth/cert.h
@@ -21,8 +21,9 @@
*
*/
-#ifndef AUTH_CERT_H
-#define AUTH_CERT_H
+#ifndef GNUTLS_LIB_AUTH_CERT_H
+#define GNUTLS_LIB_AUTH_CERT_H
+
#include "auth.h"
#include <auth/dh_common.h>
#include <x509/x509_int.h>
@@ -181,4 +182,4 @@ inline static unsigned get_key_usage(gnutls_session_t session, gnutls_pubkey_t p
return pubkey->key_usage;
}
-#endif
+#endif /* GNUTLS_LIB_AUTH_CERT_H */
diff --git a/lib/auth/dh_common.h b/lib/auth/dh_common.h
index a87d2034af..7584f89cf7 100644
--- a/lib/auth/dh_common.h
+++ b/lib/auth/dh_common.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef AUTH_DH_COMMON
-#define AUTH_DH_COMMON
+#ifndef GNUTLS_LIB_AUTH_DH_COMMON_H
+#define GNUTLS_LIB_AUTH_DH_COMMON_H
#include <auth.h>
@@ -47,4 +47,4 @@ int _gnutls_dh_common_print_server_kx(gnutls_session_t,
int _gnutls_proc_dh_common_server_kx(gnutls_session_t session,
uint8_t * data, size_t _data_size);
-#endif
+#endif /* GNUTLS_LIB_AUTH_DH_COMMON_H */
diff --git a/lib/auth/ecdhe.h b/lib/auth/ecdhe.h
index d558abfb73..e80e1ba25a 100644
--- a/lib/auth/ecdhe.h
+++ b/lib/auth/ecdhe.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef AUTH_ECDH_COMMON
-#define AUTH_ECDH_COMMON
+#ifndef GNUTLS_LIB_AUTH_ECDHE_H
+#define GNUTLS_LIB_AUTH_ECDHE_H
#include <auth.h>
@@ -49,4 +49,4 @@ int _gnutls_proc_ecdh_common_server_kx(gnutls_session_t session,
-#endif
+#endif /* GNUTLS_LIB_AUTH_ECDHE_H */
diff --git a/lib/auth/psk.h b/lib/auth/psk.h
index 8b4a908a1a..1592035bb1 100644
--- a/lib/auth/psk.h
+++ b/lib/auth/psk.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef AUTH_PSK_H
-#define AUTH_PSK_H
+#ifndef GNUTLS_LIB_AUTH_PSK_H
+#define GNUTLS_LIB_AUTH_PSK_H
#include <auth.h>
#include <auth/dh_common.h>
@@ -79,4 +79,4 @@ int _gnutls_gen_psk_client_kx(gnutls_session_t, gnutls_buffer_st *);
#define _gnutls_set_psk_session_key(x,y,z) GNUTLS_E_UNIMPLEMENTED_FEATURE
#endif /* ENABLE_PSK */
-#endif
+#endif /* GNUTLS_LIB_AUTH_PSK_H */
diff --git a/lib/auth/psk_passwd.h b/lib/auth/psk_passwd.h
index 4fb29f5070..da4c90c064 100644
--- a/lib/auth/psk_passwd.h
+++ b/lib/auth/psk_passwd.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_AUTH_PSK_PASSWD_H
+#define GNUTLS_LIB_AUTH_PSK_PASSWD_H
+
/* this is locally allocated. It should be freed using the provided function */
int _gnutls_psk_pwd_find_entry(gnutls_session_t, char *username,
gnutls_datum_t * key);
@@ -28,3 +31,5 @@ int _gnutls_find_psk_key(gnutls_session_t session,
gnutls_psk_client_credentials_t cred,
gnutls_datum_t * username, gnutls_datum_t * key,
int *free);
+
+#endif /* GNUTLS_LIB_AUTH_PSK_PASSWD_H */
diff --git a/lib/auth/rsa_common.h b/lib/auth/rsa_common.h
index 60cd503726..d91448bec0 100644
--- a/lib/auth/rsa_common.h
+++ b/lib/auth/rsa_common.h
@@ -27,8 +27,8 @@
*
*/
-#ifndef AUTH_RSA_COMMON
-#define AUTH_RSA_COMMON
+#ifndef GNUTLS_LIB_AUTH_RSA_COMMON_H
+#define GNUTLS_LIB_AUTH_RSA_COMMON_H
#include <abstract_int.h>
@@ -36,4 +36,4 @@ int
_gnutls_get_public_rsa_params(gnutls_session_t session,
gnutls_pk_params_st * params);
-#endif
+#endif /* GNUTLS_LIB_AUTH_RSA_COMMON_H */
diff --git a/lib/auth/srp_kx.h b/lib/auth/srp_kx.h
index 9c54be066e..e4431ee28e 100644
--- a/lib/auth/srp_kx.h
+++ b/lib/auth/srp_kx.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef AUTH_SRP_H
-#define AUTH_SRP_H
+#ifndef GNUTLS_LIB_AUTH_SRP_KX_H
+#define GNUTLS_LIB_AUTH_SRP_KX_H
#include <auth.h>
@@ -68,4 +68,4 @@ typedef struct srp_server_auth_info_st srp_server_auth_info_st;
#endif /* ENABLE_SRP */
-#endif
+#endif /* GNUTLS_LIB_AUTH_SRP_KX_H */
diff --git a/lib/auth/srp_passwd.h b/lib/auth/srp_passwd.h
index 317e8bfac3..56ecec2ffe 100644
--- a/lib/auth/srp_passwd.h
+++ b/lib/auth/srp_passwd.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_AUTH_SRP_PASSWD_H
+#define GNUTLS_LIB_AUTH_SRP_PASSWD_H
+
#ifdef ENABLE_SRP
typedef struct {
@@ -39,3 +42,5 @@ int _gnutls_sbase64_decode(char *data, size_t data_size,
uint8_t ** result);
#endif /* ENABLE_SRP */
+
+#endif /* GNUTLS_LIB_AUTH_SRP_PASSWD_H */
diff --git a/lib/buffers.h b/lib/buffers.h
index 3fa07b39fd..7b76423c4b 100644
--- a/lib/buffers.h
+++ b/lib/buffers.h
@@ -19,8 +19,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
-#ifndef GNUTLS_BUFFERS_H
-#define GNUTLS_BUFFERS_H
+
+#ifndef GNUTLS_LIB_BUFFERS_H
+#define GNUTLS_LIB_BUFFERS_H
#include "mbuffers.h"
@@ -126,4 +127,4 @@ _gnutls_recv_in_buffers(gnutls_session_t session, content_type_t type,
_mbuffer_head_clear( &session->internals.handshake_send_buffer); \
_gnutls_handshake_recv_buffer_clear( session);
-#endif
+#endif /* GNUTLS_LIB_BUFFERS_H */
diff --git a/lib/cert-cred.h b/lib/cert-cred.h
index 0c3213ee90..1131f6db97 100644
--- a/lib/cert-cred.h
+++ b/lib/cert-cred.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_CERT_CRED_H
+#define GNUTLS_LIB_CERT_CRED_H
+
#include <gnutls/abstract.h>
#include "str_array.h"
@@ -51,3 +54,5 @@ _gnutls_get_x509_name(gnutls_x509_crt_t crt, gnutls_str_array_t * names);
} else { \
return 0; \
}
+
+#endif /* GNUTLS_LIB_CERT_CRED_H */
diff --git a/lib/cipher.h b/lib/cipher.h
index 2e1b2ac1e1..4b32eef9fa 100644
--- a/lib/cipher.h
+++ b/lib/cipher.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_CIPHER_H
+#define GNUTLS_LIB_CIPHER_H
+
int _gnutls_encrypt(gnutls_session_t session,
const uint8_t * data,
size_t data_size, size_t min_pad,
@@ -43,3 +46,5 @@ int cbc_mac_verify(gnutls_session_t session, record_parameters_st *params,
gnutls_uint64 *sequence,
const uint8_t *data, size_t data_size,
size_t tag_size);
+
+#endif /* GNUTLS_LIB_CIPHER_H */
diff --git a/lib/cipher_int.h b/lib/cipher_int.h
index e3e010a8e7..a0951f18c5 100644
--- a/lib/cipher_int.h
+++ b/lib/cipher_int.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_CIPHER_INT
-#define GNUTLS_CIPHER_INT
+#ifndef GNUTLS_LIB_CIPHER_INT_H
+#define GNUTLS_LIB_CIPHER_INT_H
#include <gnutls/crypto.h>
#include "errors.h"
@@ -259,4 +259,4 @@ inline static size_t _gnutls_auth_cipher_tag_len(auth_cipher_hd_st *
void _gnutls_auth_cipher_deinit(auth_cipher_hd_st * handle);
-#endif /* GNUTLS_CIPHER_INT */
+#endif /* GNUTLS_LIB_CIPHER_INT_H */
diff --git a/lib/constate.h b/lib/constate.h
index 94e91a75df..bd5d8c0fc0 100644
--- a/lib/constate.h
+++ b/lib/constate.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_CONSTATE_H
-#define GNUTLS_CONSTATE_H
+#ifndef GNUTLS_LIB_CONSTATE_H
+#define GNUTLS_LIB_CONSTATE_H
int _gnutls_set_cipher_suite2(gnutls_session_t session,
const gnutls_cipher_suite_entry_st *cs);
@@ -95,4 +95,4 @@ static inline int _gnutls_epoch_refcount_dec(gnutls_session_t session,
return 0;
}
-#endif
+#endif /* GNUTLS_LIB_CONSTATE_H */
diff --git a/lib/crypto-api.h b/lib/crypto-api.h
index 18ccb22fd0..d539534dab 100644
--- a/lib/crypto-api.h
+++ b/lib/crypto-api.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef CRYPTO_API_H
-# define CRYPTO_API_H
+#ifndef GNUTLS_LIB_CRYPTO_API_H
+#define GNUTLS_LIB_CRYPTO_API_H
#include <gnutls_int.h>
@@ -50,4 +50,4 @@ void _gnutls_aead_cipher_deinit(gnutls_aead_cipher_hd_t handle)
_gnutls_cipher_deinit(&h->ctx_enc);
}
-#endif
+#endif /* GNUTLS_LIB_CRYPTO_API_H */
diff --git a/lib/crypto-backend.h b/lib/crypto-backend.h
index 76004a7211..f2fbba947d 100644
--- a/lib/crypto-backend.h
+++ b/lib/crypto-backend.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_CRYPTO_BACKEND_H
-#define GNUTLS_CRYPTO_BACKEND_H
+#ifndef GNUTLS_LIB_CRYPTO_BACKEND_H
+#define GNUTLS_LIB_CRYPTO_BACKEND_H
#include <gnutls/crypto.h>
@@ -417,4 +417,4 @@ _gnutls_prf_raw(gnutls_mac_algorithm_t mac,
size_t seed_size, const uint8_t *seed, size_t outsize,
char *out);
-#endif
+#endif /* GNUTLS_LIB_CRYPTO_BACKEND_H */
diff --git a/lib/crypto.h b/lib/crypto.h
index d64a130010..684ee198f6 100644
--- a/lib/crypto.h
+++ b/lib/crypto.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef CRYPTO_H
-#define CRYPTO_H
+#ifndef GNUTLS_LIB_CRYPTO_H
+#define GNUTLS_LIB_CRYPTO_H
const gnutls_crypto_cipher_st
* _gnutls_get_crypto_cipher(gnutls_cipher_algorithm_t algo);
@@ -31,4 +31,4 @@ const gnutls_crypto_mac_st *_gnutls_get_crypto_mac(gnutls_mac_algorithm_t
algo);
void _gnutls_crypto_deregister(void);
-#endif /* CRYPTO_H */
+#endif /* GNUTLS_LIB_CRYPTO_H */
diff --git a/lib/datum.h b/lib/datum.h
index 171a80b3b6..cdab4b272d 100644
--- a/lib/datum.h
+++ b/lib/datum.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_DATUM_H
-#define GNUTLS_DATUM_H
+#ifndef GNUTLS_LIB_DATUM_H
+#define GNUTLS_LIB_DATUM_H
# include "gnutls_int.h"
@@ -74,4 +74,4 @@ void _gnutls_free_key_datum(gnutls_datum_t * dat)
dat->size = 0;
}
-#endif
+#endif /* GNUTLS_LIB_DATUM_H */
diff --git a/lib/db.h b/lib/db.h
index cdcc8420fe..784a36afbd 100644
--- a/lib/db.h
+++ b/lib/db.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_DB_H
+#define GNUTLS_LIB_DB_H
+
int _gnutls_server_register_current_session(gnutls_session_t session);
int _gnutls_server_restore_session(gnutls_session_t session,
uint8_t * session_id,
@@ -28,3 +31,5 @@ int _gnutls_server_restore_session(gnutls_session_t session,
int _gnutls_check_resumed_params(gnutls_session_t session);
#define PACKED_SESSION_MAGIC ((0xfadebadd)+(GNUTLS_VERSION_NUMBER))
+
+#endif /* GNUTLS_LIB_DB_H */
diff --git a/lib/debug.h b/lib/debug.h
index 1b8cb1acaa..231570f521 100644
--- a/lib/debug.h
+++ b/lib/debug.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_DEBUG_H
+#define GNUTLS_LIB_DEBUG_H
+
const char *_gnutls_packet2str(content_type_t packet);
inline static const char *_gnutls_handshake2str(unsigned x)
{
@@ -33,3 +36,5 @@ inline static const char *_gnutls_handshake2str(unsigned x)
void _gnutls_dump_mpi(const char *prefix, bigint_t a);
void _gnutls_dump_vector(const char *prefix, const uint8_t * a,
size_t a_size);
+
+#endif /* GNUTLS_LIB_DEBUG_H */
diff --git a/lib/dh.h b/lib/dh.h
index 143be009ea..9f3dc2a709 100644
--- a/lib/dh.h
+++ b/lib/dh.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_DH_H
-#define GNUTLS_DH_H
+#ifndef GNUTLS_LIB_DH_H
+#define GNUTLS_LIB_DH_H
const bigint_t *_gnutls_dh_params_to_mpi(gnutls_dh_params_t);
@@ -31,4 +31,4 @@ _gnutls_figure_dh_params(gnutls_session_t session, gnutls_dh_params_t dh_params,
int _gnutls_set_cred_dh_params(gnutls_dh_params_t *cparams, gnutls_sec_param_t sec_param);
-#endif
+#endif /* GNUTLS_LIB_DH_H */
diff --git a/lib/dtls.h b/lib/dtls.h
index d1bfe80da0..26df8b9831 100644
--- a/lib/dtls.h
+++ b/lib/dtls.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef DTLS_H
-#define DTLS_H
+#ifndef GNUTLS_LIB_DTLS_H
+#define GNUTLS_LIB_DTLS_H
#include <config.h>
#include "gnutls_int.h"
@@ -135,4 +135,4 @@ inline static int _dtls_retransmit(gnutls_session_t session)
return _dtls_transmit(session);
}
-#endif
+#endif /* GNUTLS_LIB_DTLS_H */
diff --git a/lib/ecc.h b/lib/ecc.h
index c9ff2b32d8..6e724b893a 100644
--- a/lib/ecc.h
+++ b/lib/ecc.h
@@ -20,12 +20,12 @@
*
*/
-#ifndef GNUTLS_ECC_H
-#define GNUTLS_ECC_H
+#ifndef GNUTLS_LIB_ECC_H
+#define GNUTLS_LIB_ECC_H
int _gnutls_ecc_ansi_x962_import(const uint8_t * in, unsigned long inlen,
bigint_t * x, bigint_t * y);
int _gnutls_ecc_ansi_x962_export(gnutls_ecc_curve_t curve, bigint_t x,
bigint_t y, gnutls_datum_t * out);
-#endif
+#endif /* GNUTLS_LIB_ECC_H */
diff --git a/lib/errors.h b/lib/errors.h
index 16b02ed046..976a788e7c 100644
--- a/lib/errors.h
+++ b/lib/errors.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_ERRORS_H
-#define GNUTLS_ERRORS_H
+#ifndef GNUTLS_LIB_ERRORS_H
+#define GNUTLS_LIB_ERRORS_H
#include "gnutls_int.h"
#include <global.h>
@@ -143,4 +143,4 @@ int gnutls_assert_val_int(int val, const char *file, const char *func, int line)
#define gnutls_assert_val(x) gnutls_assert_val_int(x, __FILE__, __func__, __LINE__)
#define gnutls_assert_val_fatal(x) (((x)!=GNUTLS_E_AGAIN && (x)!=GNUTLS_E_INTERRUPTED)?gnutls_assert_val_int(x, __FILE__, __func__, __LINE__):(x))
-#endif /* GNUTLS_ERRORS_H */
+#endif /* GNUTLS_LIB_ERRORS_H */
diff --git a/lib/ext/alpn.h b/lib/ext/alpn.h
index 8197628bd1..0b32a3292d 100644
--- a/lib/ext/alpn.h
+++ b/lib/ext/alpn.h
@@ -17,8 +17,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
-#ifndef EXT_ALPN_H
-#define EXT_ALPN_H
+
+#ifndef GNUTLS_LIB_EXT_ALPN_H
+#define GNUTLS_LIB_EXT_ALPN_H
#include <hello_ext.h>
@@ -36,4 +37,4 @@ typedef struct {
extern const hello_ext_entry_st ext_mod_alpn;
-#endif
+#endif /* GNUTLS_LIB_EXT_ALPN_H */
diff --git a/lib/ext/cert_types.h b/lib/ext/cert_types.h
index 886f66cc45..98dfdef101 100644
--- a/lib/ext/cert_types.h
+++ b/lib/ext/cert_types.h
@@ -23,6 +23,9 @@
*
*/
+#ifndef GNUTLS_LIB_EXT_CERT_TYPES_H
+#define GNUTLS_LIB_EXT_CERT_TYPES_H
+
/* Maps IANA TLS Certificate Types identifiers to internal
* certificate type representation.
*/
@@ -81,3 +84,5 @@ static inline bool are_alternative_cert_types_allowed(gnutls_session_t session)
#undef CERT_TYPES_FLAGS
}
+
+#endif /* GNUTLS_LIB_EXT_CERT_TYPES_H */
diff --git a/lib/ext/client_cert_type.h b/lib/ext/client_cert_type.h
index fca8c7b6e9..7e89ca816a 100644
--- a/lib/ext/client_cert_type.h
+++ b/lib/ext/client_cert_type.h
@@ -26,11 +26,11 @@
* when requested using a certificate_request message.
*/
-#ifndef EXT_CLIENT_CERT_TYPE_H
-#define EXT_CLIENT_CERT_TYPE_H
+#ifndef GNUTLS_LIB_EXT_CLIENT_CERT_TYPE_H
+#define GNUTLS_LIB_EXT_CLIENT_CERT_TYPE_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_client_cert_type;
-#endif
+#endif /* GNUTLS_LIB_EXT_CLIENT_CERT_TYPE_H */
diff --git a/lib/ext/cookie.h b/lib/ext/cookie.h
index 453fcd00bd..13ea7c7cde 100644
--- a/lib/ext/cookie.h
+++ b/lib/ext/cookie.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_COOKIE_H
-#define EXT_COOKIE_H
+#ifndef GNUTLS_LIB_EXT_COOKIE_H
+#define GNUTLS_LIB_EXT_COOKIE_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_cookie;
-#endif
+#endif /* GNUTLS_LIB_EXT_COOKIE_H */
diff --git a/lib/ext/dumbfw.h b/lib/ext/dumbfw.h
index 45665eb85b..87bb072e9f 100644
--- a/lib/ext/dumbfw.h
+++ b/lib/ext/dumbfw.h
@@ -17,11 +17,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
-#ifndef EXT_DUMBFW_H
-#define EXT_DUMBFW_H
+
+#ifndef GNUTLS_LIB_EXT_DUMBFW_H
+#define GNUTLS_LIB_EXT_DUMBFW_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_dumbfw;
-#endif
+#endif /* GNUTLS_LIB_EXT_DUMBFW_H */
diff --git a/lib/ext/early_data.h b/lib/ext/early_data.h
index d767f7e2f5..d7178e8ac2 100644
--- a/lib/ext/early_data.h
+++ b/lib/ext/early_data.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_EARLY_DATA_H
-#define EXT_EARLY_DATA_H
+#ifndef GNUTLS_LIB_EXT_EARLY_DATA_H
+#define GNUTLS_LIB_EXT_EARLY_DATA_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_early_data;
-#endif
+#endif /* GNUTLS_LIB_EXT_EARLY_DATA_H */
diff --git a/lib/ext/ec_point_formats.h b/lib/ext/ec_point_formats.h
index fb58a8fa5d..cc65c04c38 100644
--- a/lib/ext/ec_point_formats.h
+++ b/lib/ext/ec_point_formats.h
@@ -19,11 +19,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
-#ifndef EXT_EC_POINT_FORMATS_H
-#define EXT_EC_POINT_FORMATS_H
+
+#ifndef GNUTLS_LIB_EXT_EC_POINT_FORMATS_H
+#define GNUTLS_LIB_EXT_EC_POINT_FORMATS_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_supported_ec_point_formats;
-#endif
+#endif /* GNUTLS_LIB_EXT_EC_POINT_FORMATS_H */
diff --git a/lib/ext/etm.h b/lib/ext/etm.h
index 82d042574a..76f9dd5e51 100644
--- a/lib/ext/etm.h
+++ b/lib/ext/etm.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_ETM_H
-#define EXT_ETM_H
+#ifndef GNUTLS_LIB_EXT_ETM_H
+#define GNUTLS_LIB_EXT_ETM_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_etm;
-#endif
+#endif /* GNUTLS_LIB_EXT_ETM_H */
diff --git a/lib/ext/ext_master_secret.h b/lib/ext/ext_master_secret.h
index 3b40734854..419335b4e3 100644
--- a/lib/ext/ext_master_secret.h
+++ b/lib/ext/ext_master_secret.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_EXT_MASTER_SECRET_H
-#define EXT_EXT_MASTER_SECRET_H
+#ifndef GNUTLS_LIB_EXT_EXT_MASTER_SECRET_H
+#define GNUTLS_LIB_EXT_EXT_MASTER_SECRET_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_ext_master_secret;
-#endif
+#endif /* GNUTLS_LIB_EXT_EXT_MASTER_SECRET_H */
diff --git a/lib/ext/heartbeat.h b/lib/ext/heartbeat.h
index 5baa5e8c51..1a210040f5 100644
--- a/lib/ext/heartbeat.h
+++ b/lib/ext/heartbeat.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef EXT_HEARTBEAT_H
-#define EXT_HEARTBEAT_H
+#ifndef GNUTLS_LIB_EXT_HEARTBEAT_H
+#define GNUTLS_LIB_EXT_HEARTBEAT_H
#include <hello_ext.h>
@@ -40,4 +40,5 @@ extern const hello_ext_entry_st ext_mod_heartbeat;
int _gnutls_heartbeat_handle(gnutls_session_t session, mbuffer_st * bufel);
int _gnutls_heartbeat_enabled(gnutls_session_t session, int local);
-#endif
+
+#endif /* GNUTLS_LIB_EXT_HEARTBEAT_H */
diff --git a/lib/ext/key_share.h b/lib/ext/key_share.h
index f5d775da8a..ed9aa16800 100644
--- a/lib/ext/key_share.h
+++ b/lib/ext/key_share.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_KEY_SHARE_H
-#define EXT_KEY_SHARE_H
+#ifndef GNUTLS_LIB_EXT_KEY_SHARE_H
+#define GNUTLS_LIB_EXT_KEY_SHARE_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_key_share;
-#endif
+#endif /* GNUTLS_LIB_EXT_KEY_SHARE_H */
diff --git a/lib/ext/max_record.h b/lib/ext/max_record.h
index 553a37e4fc..758c8e12c8 100644
--- a/lib/ext/max_record.h
+++ b/lib/ext/max_record.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_MAX_RECORD_H
-#define EXT_MAX_RECORD_H
+#ifndef GNUTLS_LIB_EXT_MAX_RECORD_H
+#define GNUTLS_LIB_EXT_MAX_RECORD_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_max_record_size;
-#endif
+#endif /* GNUTLS_LIB_EXT_MAX_RECORD_H */
diff --git a/lib/ext/post_handshake.h b/lib/ext/post_handshake.h
index a2ac0419c4..7a1cc7a367 100644
--- a/lib/ext/post_handshake.h
+++ b/lib/ext/post_handshake.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_POST_HANDSHAKE_H
-#define EXT_POST_HANDSHAKE_H
+#ifndef GNUTLS_LIB_EXT_POST_HANDSHAKE_H
+#define GNUTLS_LIB_EXT_POST_HANDSHAKE_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_post_handshake;
-#endif
+#endif /* GNUTLS_LIB_EXT_POST_HANDSHAKE_H */
diff --git a/lib/ext/pre_shared_key.h b/lib/ext/pre_shared_key.h
index 71116e5d10..f1ea62c9ce 100644
--- a/lib/ext/pre_shared_key.h
+++ b/lib/ext/pre_shared_key.h
@@ -1,5 +1,5 @@
-#ifndef EXT_PRE_SHARED_KEY_H
-#define EXT_PRE_SHARED_KEY_H
+#ifndef GNUTLS_LIB_EXT_PRE_SHARED_KEY_H
+#define GNUTLS_LIB_EXT_PRE_SHARED_KEY_H
#include "auth/psk.h"
#include <hello_ext.h>
@@ -20,4 +20,4 @@ unsigned _gnutls_have_psk_credentials(const gnutls_psk_client_credentials_t cred
int _gnutls_generate_early_secrets_for_psk(gnutls_session_t session);
-#endif
+#endif /* GNUTLS_LIB_EXT_PRE_SHARED_KEY_H */
diff --git a/lib/ext/psk_ke_modes.h b/lib/ext/psk_ke_modes.h
index 82c2c10bba..56876a97d8 100644
--- a/lib/ext/psk_ke_modes.h
+++ b/lib/ext/psk_ke_modes.h
@@ -1,8 +1,8 @@
-#ifndef EXT_PSK_KE_MODES_H
-#define EXT_PSK_KE_MODES_H
+#ifndef GNUTLS_LIB_EXT_PSK_KE_MODES_H
+#define GNUTLS_LIB_EXT_PSK_KE_MODES_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_psk_ke_modes;
-#endif
+#endif /* GNUTLS_LIB_EXT_PSK_KE_MODES_H */
diff --git a/lib/ext/record_size_limit.h b/lib/ext/record_size_limit.h
index 30c340c1ba..da7cade58d 100644
--- a/lib/ext/record_size_limit.h
+++ b/lib/ext/record_size_limit.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_RECORD_SIZE_LIMIT_H
-#define EXT_RECORD_SIZE_LIMIT_H
+#ifndef GNUTLS_LIB_EXT_RECORD_SIZE_LIMIT_H
+#define GNUTLS_LIB_EXT_RECORD_SIZE_LIMIT_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_record_size_limit;
-#endif
+#endif /* GNUTLS_LIB_EXT_RECORD_SIZE_LIMIT_H */
diff --git a/lib/ext/safe_renegotiation.h b/lib/ext/safe_renegotiation.h
index 0b87f2b672..bc2024a9fc 100644
--- a/lib/ext/safe_renegotiation.h
+++ b/lib/ext/safe_renegotiation.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef EXT_SAFE_RENEGOTIATION_H
-#define EXT_SAFE_RENEGOTIATION_H
+#ifndef GNUTLS_LIB_EXT_SAFE_RENEGOTIATION_H
+#define GNUTLS_LIB_EXT_SAFE_RENEGOTIATION_H
#include <hello_ext.h>
@@ -46,4 +46,4 @@ int _gnutls_ext_sr_recv_cs(gnutls_session_t session);
int _gnutls_ext_sr_verify(gnutls_session_t session);
int _gnutls_ext_sr_send_cs(gnutls_session_t);
-#endif /* EXT_SAFE_RENEGOTIATION_H */
+#endif /* GNUTLS_LIB_EXT_SAFE_RENEGOTIATION_H */
diff --git a/lib/ext/server_cert_type.h b/lib/ext/server_cert_type.h
index e60480f3a8..3c15b0b7b8 100644
--- a/lib/ext/server_cert_type.h
+++ b/lib/ext/server_cert_type.h
@@ -26,11 +26,11 @@
* in order to authenticate the server.
*/
-#ifndef EXT_SERVER_CERT_TYPE_H
-#define EXT_SERVER_CERT_TYPE_H
+#ifndef GNUTLS_LIB_EXT_SERVER_CERT_TYPE_H
+#define GNUTLS_LIB_EXT_SERVER_CERT_TYPE_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_server_cert_type;
-#endif
+#endif /* GNUTLS_LIB_EXT_SERVER_CERT_TYPE_H */
diff --git a/lib/ext/server_name.h b/lib/ext/server_name.h
index 8c12b2ee8b..b5cdd0ea53 100644
--- a/lib/ext/server_name.h
+++ b/lib/ext/server_name.h
@@ -20,8 +20,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
-#ifndef EXT_SERVER_NAME_H
-#define EXT_SERVER_NAME_H
+
+#ifndef GNUTLS_LIB_EXT_SERVER_NAME_H
+#define GNUTLS_LIB_EXT_SERVER_NAME_H
#include <hello_ext.h>
@@ -29,4 +30,4 @@ extern const hello_ext_entry_st ext_mod_server_name;
unsigned _gnutls_server_name_matches_resumed(gnutls_session_t);
-#endif
+#endif /* GNUTLS_LIB_EXT_SERVER_NAME_H */
diff --git a/lib/ext/session_ticket.h b/lib/ext/session_ticket.h
index a0c687aa73..da804ec2f7 100644
--- a/lib/ext/session_ticket.h
+++ b/lib/ext/session_ticket.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef EXT_SESSION_TICKET_H
-#define EXT_SESSION_TICKET_H
+#ifndef GNUTLS_LIB_EXT_SESSION_TICKET_H
+#define GNUTLS_LIB_EXT_SESSION_TICKET_H
#include <hello_ext.h>
@@ -37,4 +37,4 @@ int _gnutls_decrypt_session_ticket(gnutls_session_t session,
const gnutls_datum_t *ticket_data,
gnutls_datum_t *state);
-#endif
+#endif /* GNUTLS_LIB_EXT_SESSION_TICKET_H */
diff --git a/lib/ext/signature.h b/lib/ext/signature.h
index 28e8966b1c..a6448f34b6 100644
--- a/lib/ext/signature.h
+++ b/lib/ext/signature.h
@@ -20,10 +20,11 @@
*
*/
+#ifndef GNUTLS_LIB_EXT_SIGNATURE_H
+#define GNUTLS_LIB_EXT_SIGNATURE_H
+
/* signature algorithms extension
*/
-#ifndef EXT_SIGNATURE_H
-#define EXT_SIGNATURE_H
#include <hello_ext.h>
@@ -55,4 +56,5 @@ gnutls_sign_algorithm_set_client(gnutls_session_t session,
{
session->security_parameters.client_sign_algo = sign;
}
-#endif
+
+#endif /* GNUTLS_LIB_EXT_SIGNATURE_H */
diff --git a/lib/ext/srp.h b/lib/ext/srp.h
index f70441c17c..fd7576fef7 100644
--- a/lib/ext/srp.h
+++ b/lib/ext/srp.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef EXT_SRP_H
-#define EXT_SRP_H
+#ifndef GNUTLS_LIB_EXT_SRP_H
+#define GNUTLS_LIB_EXT_SRP_H
#include <hello_ext.h>
@@ -39,4 +39,4 @@ typedef struct {
#endif
-#endif
+#endif /* GNUTLS_LIB_EXT_SRP_H */
diff --git a/lib/ext/srtp.h b/lib/ext/srtp.h
index 327f181ee8..d05454a477 100644
--- a/lib/ext/srtp.h
+++ b/lib/ext/srtp.h
@@ -19,6 +19,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
+
+#ifndef GNUTLS_LIB_EXT_SRTP_H
+#define GNUTLS_LIB_EXT_SRTP_H
#ifndef EXT_SRTP_H
#define EXT_SRTP_H
@@ -38,3 +41,5 @@ typedef struct {
extern const hello_ext_entry_st ext_mod_srtp;
#endif
+
+#endif /* GNUTLS_LIB_EXT_SRTP_H */
diff --git a/lib/ext/status_request.h b/lib/ext/status_request.h
index a2d9c7969f..dc1d233ea2 100644
--- a/lib/ext/status_request.h
+++ b/lib/ext/status_request.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef EXT_STATUS_REQUEST_H
-#define EXT_STATUS_REQUEST_H
+#ifndef GNUTLS_LIB_EXT_STATUS_REQUEST_H
+#define GNUTLS_LIB_EXT_STATUS_REQUEST_H
#include <hello_ext.h>
@@ -38,4 +38,4 @@ int _gnutls_parse_ocsp_response(gnutls_session_t session, const uint8_t *data,
ssize_t data_size,
gnutls_datum_t *resp);
-#endif
+#endif /* GNUTLS_LIB_EXT_STATUS_REQUEST_H */
diff --git a/lib/ext/supported_groups.h b/lib/ext/supported_groups.h
index c75367f877..769b3be8e1 100644
--- a/lib/ext/supported_groups.h
+++ b/lib/ext/supported_groups.h
@@ -19,8 +19,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
-#ifndef EXT_SUPPORTED_GROUPS_H
-#define EXT_SUPPORTED_GROUPS_H
+
+#ifndef GNUTLS_LIB_EXT_SUPPORTED_GROUPS_H
+#define GNUTLS_LIB_EXT_SUPPORTED_GROUPS_H
#include <hello_ext.h>
@@ -30,4 +31,4 @@ int
_gnutls_session_supports_group(gnutls_session_t session,
unsigned int group);
-#endif
+#endif /* GNUTLS_LIB_EXT_SUPPORTED_GROUPS_H */
diff --git a/lib/ext/supported_versions.h b/lib/ext/supported_versions.h
index 68f9b8b436..f7dfb9ebb9 100644
--- a/lib/ext/supported_versions.h
+++ b/lib/ext/supported_versions.h
@@ -20,11 +20,11 @@
*
*/
-#ifndef EXT_SUPPORTED_VERSIONS_H
-#define EXT_SUPPORTED_VERSIONS_H
+#ifndef GNUTLS_LIB_EXT_SUPPORTED_VERSIONS_H
+#define GNUTLS_LIB_EXT_SUPPORTED_VERSIONS_H
#include <hello_ext.h>
extern const hello_ext_entry_st ext_mod_supported_versions;
-#endif
+#endif /* GNUTLS_LIB_EXT_SUPPORTED_VERSIONS_H */
diff --git a/lib/extras/hex.h b/lib/extras/hex.h
index 15d4e64932..5fcac98914 100644
--- a/lib/extras/hex.h
+++ b/lib/extras/hex.h
@@ -1,6 +1,8 @@
/* CC0 (Public domain) - see LICENSE file for details */
-#ifndef CCAN_HEX_H
-#define CCAN_HEX_H
+
+#ifndef GNUTLS_LIB_EXTRAS_HEX_H
+#define GNUTLS_LIB_EXTRAS_HEX_H
+
#include "config.h"
#include <stdbool.h>
#include <stdlib.h>
@@ -21,6 +23,7 @@
* if (!hex_decode(argv[1], strlen(argv[1]), data, 20))
* printf("String is malformed!\n");
*/
+
bool hex_decode(const char *str, size_t slen, void *buf, size_t bufsize);
/**
@@ -70,4 +73,5 @@ static inline size_t hex_data_size(size_t slen)
{
return slen / 2;
}
-#endif /* PETTYCOIN_HEX_H */
+
+#endif /* GNUTLS_LIB_EXTRAS_HEX_H */
diff --git a/lib/extras/randomart.h b/lib/extras/randomart.h
index 4c5769334b..b468eb4e80 100644
--- a/lib/extras/randomart.h
+++ b/lib/extras/randomart.h
@@ -1,5 +1,10 @@
+#ifndef GNUTLS_LIB_EXTRAS_RANDOMART_H
+#define GNUTLS_LIB_EXTRAS_RANDOMART_H
+
char *_gnutls_key_fingerprint_randomart(uint8_t * dgst_raw,
u_int dgst_raw_len,
const char *key_type,
unsigned int key_size,
const char *prefix);
+
+#endif /* GNUTLS_LIB_EXTRAS_RANDOMART_H */
diff --git a/lib/extv.h b/lib/extv.h
index 62f2dbccde..3c0bd33598 100644
--- a/lib/extv.h
+++ b/lib/extv.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_EXTV_H
-#define GNUTLS_EXTV_H
+#ifndef GNUTLS_LIB_EXTV_H
+#define GNUTLS_LIB_EXTV_H
#include <gnutls/gnutls.h>
#include "str.h"
@@ -78,4 +78,4 @@ int _gnutls_extv_append(gnutls_buffer_st *buf,
extv_append_func cb);
-#endif
+#endif /* GNUTLS_LIB_EXTV_H */
diff --git a/lib/file.h b/lib/file.h
index fe5e981679..98fb90ed0d 100644
--- a/lib/file.h
+++ b/lib/file.h
@@ -20,4 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_FILE_H
+#define GNUTLS_LIB_FILE_H
+
int _gnutls_file_exists(const char *file);
+
+#endif /* GNUTLS_LIB_FILE_H */
diff --git a/lib/fips.h b/lib/fips.h
index 97f1c26219..7385a95de0 100644
--- a/lib/fips.h
+++ b/lib/fips.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef FIPS_H
-# define FIPS_H
+#ifndef GNUTLS_LIB_FIPS_H
+#define GNUTLS_LIB_FIPS_H
#include "gnutls_int.h"
#include <gnutls/gnutls.h>
@@ -167,4 +167,4 @@ static unsigned is_cipher_algo_forbidden(gnutls_cipher_algorithm_t algo)
# define FIPS_RULE(condition, ret_error, ...)
#endif
-#endif /* FIPS_H */
+#endif /* GNUTLS_LIB_FIPS_H */
diff --git a/lib/global.h b/lib/global.h
index 95b6afe8ee..d9a09d8cdd 100644
--- a/lib/global.h
+++ b/lib/global.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_GLOBAL_H
-#define GNUTLS_GLOBAL_H
+#ifndef GNUTLS_LIB_GLOBAL_H
+#define GNUTLS_LIB_GLOBAL_H
#include <libtasn1.h>
#include <gnutls/gnutls.h>
@@ -49,4 +49,4 @@ extern void _gnutls_nss_keylog_deinit(void);
extern void _gnutls_load_system_priorities(void);
extern void _gnutls_unload_system_priorities(void);
-#endif
+#endif /* GNUTLS_LIB_GLOBAL_H */
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index 53ca32b19c..2c8d259086 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef GNUTLS_INT_H
-#define GNUTLS_INT_H
+#ifndef GNUTLS_LIB_GNUTLS_INT_H
+#define GNUTLS_LIB_GNUTLS_INT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -1608,4 +1608,4 @@ get_certificate_type(gnutls_session_t session,
#define CONSTCHECK_NOT_EQUAL(a, b) ((-((uint32_t)(a) ^ (uint32_t)(b))) >> 31)
#define CONSTCHECK_EQUAL(a, b) (1U - CONSTCHECK_NOT_EQUAL(a, b))
-#endif /* GNUTLS_INT_H */
+#endif /* GNUTLS_LIB_GNUTLS_INT_H */
diff --git a/lib/gthreads.h b/lib/gthreads.h
index 6c89a14ab2..02ab8d3da9 100644
--- a/lib/gthreads.h
+++ b/lib/gthreads.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_GTHREADS_H
+#define GNUTLS_LIB_GTHREADS_H
+
#include <config.h>
#ifdef HAVE_THREADS_H
@@ -31,3 +34,5 @@
#else
# error Unsupported platform
#endif
+
+#endif /* GNUTLS_LIB_GTHREADS_H */
diff --git a/lib/handshake.h b/lib/handshake.h
index a8740a57dd..8d858f4ef2 100644
--- a/lib/handshake.h
+++ b/lib/handshake.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef HANDSHAKE_H
-#define HANDSHAKE_H
+#ifndef GNUTLS_LIB_HANDSHAKE_H
+#define GNUTLS_LIB_HANDSHAKE_H
#include "errors.h"
#include "record.h"
@@ -174,4 +174,4 @@ _gnutls13_recv_hello_retry_request(gnutls_session_t session,
int
_gnutls13_recv_async_handshake(gnutls_session_t session);
-#endif
+#endif /* GNUTLS_LIB_HANDSHAKE_H */
diff --git a/lib/hash_int.h b/lib/hash_int.h
index edc9a1cd02..52fb2b01f0 100644
--- a/lib/hash_int.h
+++ b/lib/hash_int.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_HASH_INT_H
-#define GNUTLS_HASH_INT_H
+#ifndef GNUTLS_LIB_HASH_INT_H
+#define GNUTLS_LIB_HASH_INT_H
#include "gnutls_int.h"
#include <gnutls/crypto.h>
@@ -150,4 +150,4 @@ inline static int IS_SHA(gnutls_digest_algorithm_t algo)
return 0;
}
-#endif /* GNUTLS_HASH_INT_H */
+#endif /* GNUTLS_LIB_HASH_INT_H */
diff --git a/lib/hello_ext.h b/lib/hello_ext.h
index a4710f5366..f8570bb34e 100644
--- a/lib/hello_ext.h
+++ b/lib/hello_ext.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef GNUTLS_EXTENSIONS_H
-#define GNUTLS_EXTENSIONS_H
+#ifndef GNUTLS_LIB_HELLO_EXT_H
+#define GNUTLS_LIB_HELLO_EXT_H
#include "gnutls_int.h"
#include <gnutls/gnutls.h>
@@ -194,4 +194,4 @@ void _gnutls_hello_ext_save_sr(gnutls_session_t session)
_gnutls_hello_ext_save(session, GNUTLS_EXTENSION_SAFE_RENEGOTIATION, 1);
}
-#endif
+#endif /* GNUTLS_LIB_HELLO_EXT_H */
diff --git a/lib/hello_ext_lib.h b/lib/hello_ext_lib.h
index 5819f64a55..c1a79ec7e7 100644
--- a/lib/hello_ext_lib.h
+++ b/lib/hello_ext_lib.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_EXT_LIB_H
-#define GNUTLS_EXT_LIB_H
+#ifndef GNUTLS_LIB_HELLO_EXT_LIB_H
+#define GNUTLS_LIB_HELLO_EXT_LIB_H
#include <gnutls/gnutls.h>
#include "hello_ext.h"
@@ -64,4 +64,4 @@ _gnutls_hello_ext_default_pack(gnutls_ext_priv_data_t epriv, gnutls_buffer_st *p
int
_gnutls_hello_ext_default_unpack(gnutls_buffer_st *ps, gnutls_ext_priv_data_t *epriv);
-#endif
+#endif /* GNUTLS_LIB_HELLO_EXT_LIB_H */
diff --git a/lib/kx.h b/lib/kx.h
index 08d2b30e07..2d98fda3cd 100644
--- a/lib/kx.h
+++ b/lib/kx.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_KX_H
+#define GNUTLS_LIB_KX_H
+
int _gnutls_send_server_kx_message(gnutls_session_t session, int again);
int _gnutls_send_client_kx_message(gnutls_session_t session, int again);
int _gnutls_recv_server_kx_message(gnutls_session_t session);
@@ -38,3 +41,5 @@ int _gnutls_recv_client_certificate_verify_message(gnutls_session_t
void _gnutls_nss_keylog_write(gnutls_session_t session,
const char *label,
const uint8_t *secret, size_t secret_size);
+
+#endif /* GNUTLS_LIB_KX_H */
diff --git a/lib/locks.h b/lib/locks.h
index deb010b8d2..63780bf571 100644
--- a/lib/locks.h
+++ b/lib/locks.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_LOCKS_H
-#define GNUTLS_LOCKS_H
+#ifndef GNUTLS_LIB_LOCKS_H
+#define GNUTLS_LIB_LOCKS_H
#include <gnutls/gnutls.h>
#include "gnutls_int.h"
@@ -76,4 +76,4 @@ extern mutex_unlock_func gnutls_mutex_unlock;
# define GNUTLS_STATIC_MUTEX_UNLOCK(mutex)
#endif
-#endif
+#endif /* GNUTLS_LIB_LOCKS_H */
diff --git a/lib/mbuffers.h b/lib/mbuffers.h
index a06eb78112..a41850c504 100644
--- a/lib/mbuffers.h
+++ b/lib/mbuffers.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_MBUFFERS_H
-#define GNUTLS_MBUFFERS_H
+#ifndef GNUTLS_LIB_MBUFFERS_H
+#define GNUTLS_LIB_MBUFFERS_H
#include "gnutls_int.h"
#include "errors.h"
@@ -198,4 +198,4 @@ int _mbuffer_linearize_align16(mbuffer_head_st * buf, unsigned align_pos);
# define _mbuffer_linearize_align16(x,y) _mbuffer_linearize(x)
#endif
-#endif
+#endif /* GNUTLS_LIB_MBUFFERS_H */
diff --git a/lib/mem.h b/lib/mem.h
index 18152936fc..dc838a2b4d 100644
--- a/lib/mem.h
+++ b/lib/mem.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_MEM_H
-#define GNUTLS_MEM_H
+#ifndef GNUTLS_LIB_MEM_H
+#define GNUTLS_LIB_MEM_H
#include <config.h>
@@ -54,4 +54,4 @@ int safe_memcmp(const void *s1, const void *s2, size_t n)
#define zeroize_temp_key zeroize_key
#define zrelease_temp_mpi_key zrelease_mpi_key
-#endif /* GNUTLS_MEM_H */
+#endif /* GNUTLS_LIB_MEM_H */
diff --git a/lib/mpi.h b/lib/mpi.h
index d896ae5e72..a625094bbb 100644
--- a/lib/mpi.h
+++ b/lib/mpi.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_MPI_H
-#define GNUTLS_MPI_H
+#ifndef GNUTLS_LIB_MPI_H
+#define GNUTLS_LIB_MPI_H
#include "gnutls_int.h"
@@ -90,4 +90,4 @@ typedef int (*mpi_dprint_func)(const bigint_t a, gnutls_datum_t * dest);
#define _gnutls_mpi_generate_group( gg, bits) _gnutls_mpi_ops.bigint_generate_group( gg, bits)
-#endif
+#endif /* GNUTLS_LIB_MPI_H */
diff --git a/lib/nettle/backport/cfb8.h b/lib/nettle/backport/cfb8.h
index c0a452ca04..351b46f73f 100644
--- a/lib/nettle/backport/cfb8.h
+++ b/lib/nettle/backport/cfb8.h
@@ -32,8 +32,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_CFB8_H_INCLUDED
-#define NETTLE_CFB8_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_BACKPORT_CFB8_H
+#define GNUTLS_LIB_NETTLE_BACKPORT_CFB8_H
#include <nettle/cfb.h>
@@ -93,4 +93,5 @@ cfb8_decrypt(const void *ctx, nettle_cipher_func *f,
#ifdef __cplusplus
}
#endif
-#endif /* NETTLE_CFB8_H_INCLUDED */
+
+#endif /* GNUTLS_LIB_NETTLE_BACKPORT_CFB8_H */
diff --git a/lib/nettle/backport/cmac.h b/lib/nettle/backport/cmac.h
index 85939ce682..41dbfcf31b 100644
--- a/lib/nettle/backport/cmac.h
+++ b/lib/nettle/backport/cmac.h
@@ -33,8 +33,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_CMAC_H_INCLUDED
-#define NETTLE_CMAC_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_BACKPORT_CMAC_H
+#define GNUTLS_LIB_NETTLE_BACKPORT_CMAC_H
#include <nettle/nettle-types.h>
@@ -136,5 +136,4 @@ cmac_aes256_digest(struct cmac_aes256_ctx *ctx,
}
#endif
-#endif /* CMAC_H_INCLUDED */
-
+#endif /* GNUTLS_LIB_NETTLE_BACKPORT_CMAC_H */
diff --git a/lib/nettle/backport/xts.h b/lib/nettle/backport/xts.h
index 5111af0f38..238e31272a 100644
--- a/lib/nettle/backport/xts.h
+++ b/lib/nettle/backport/xts.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef _BACKPORT_NETTLE_XTS_H_INCLUDED
-#define _BACKPORT_NETTLE_XTS_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_BACKPORT_XTS_H
+#define GNUTLS_LIB_NETTLE_BACKPORT_XTS_H
#ifdef HAVE_XTS_ENCRYPT_MESSAGE
#include <nettle/xts.h>
@@ -119,4 +119,4 @@ xts_aes256_decrypt_message(struct xts_aes256_key *xts_key,
#endif /* HAVE_XTS_ENCRYPT_MESSAGE */
-#endif /* _BACKPORT_NETTLE_XTS_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_BACKPORT_XTS_H */
diff --git a/lib/nettle/gnettle.h b/lib/nettle/gnettle.h
index e27149c3ea..f47569bfc6 100644
--- a/lib/nettle/gnettle.h
+++ b/lib/nettle/gnettle.h
@@ -1,3 +1,8 @@
+#ifndef GNUTLS_LIB_NETTLE_GNETTLE_H
+#define GNUTLS_LIB_NETTLE_GNETTLE_H
+
#define PRIME_CHECK_PARAM 8
#define TOMPZ(x) ((__mpz_struct*)(x))
#define SIZEOF_MPZT sizeof(__mpz_struct)
+
+#endif /* GNUTLS_LIB_NETTLE_GNETTLE_H */
diff --git a/lib/nettle/gost/bignum-le.h b/lib/nettle/gost/bignum-le.h
index 009679f79a..3672ad2ef3 100644
--- a/lib/nettle/gost/bignum-le.h
+++ b/lib/nettle/gost/bignum-le.h
@@ -31,8 +31,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_BIGNUM_LE_H_INCLUDED
-#define NETTLE_BIGNUM_LE_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_BIGNUM_LE_H
+#define GNUTLS_LIB_NETTLE_GOST_BIGNUM_LE_H
#include <nettle/nettle-meta.h>
@@ -68,4 +68,4 @@ nettle_mpz_init_set_str_256_u_le(mpz_t x,
}
#endif
-#endif /* NETTLE_BIGNUM_LE_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_BIGNUM_LE_H */
diff --git a/lib/nettle/gost/ecc-gost-curve.h b/lib/nettle/gost/ecc-gost-curve.h
index ae68437ca0..9e972c7689 100644
--- a/lib/nettle/gost/ecc-gost-curve.h
+++ b/lib/nettle/gost/ecc-gost-curve.h
@@ -31,8 +31,8 @@
/* Development of Nettle's ECC support was funded by the .SE Internet Fund. */
-#ifndef NETTLE_ECC_GOST_CURVE_H_INCLUDED
-#define NETTLE_ECC_GOST_CURVE_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_ECC_GOST_CURVE_H
+#define GNUTLS_LIB_NETTLE_GOST_ECC_GOST_CURVE_H
#ifdef __cplusplus
extern "C" {
@@ -58,4 +58,4 @@ const struct ecc_curve * NETTLE_PURE nettle_get_gost_512a(void);
}
#endif
-#endif /* NETTLE_ECC_GOST_CURVE_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_ECC_GOST_CURVE_H */
diff --git a/lib/nettle/gost/ecc-gost256cpa-32.h b/lib/nettle/gost/ecc-gost256cpa-32.h
index 33d9fe41ae..bdd5b480d5 100644
--- a/lib/nettle/gost/ecc-gost256cpa-32.h
+++ b/lib/nettle/gost/ecc-gost256cpa-32.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_LIB_NETTLE_GOST_ECC_GOST256CPA_32_H
+#define GNUTLS_LIB_NETTLE_GOST_ECC_GOST256CPA_32_H
+
/* For NULL. */
#include <stddef.h>
#define ECC_LIMB_SIZE 8
@@ -1069,3 +1072,5 @@ static const mp_limb_t ecc_table[4096] = {
0x22753b51UL, 0xc2081d24UL, 0xf3beada6UL, 0xfca3e2e2UL, 0x1cd6ca20UL, 0x5ab1f143UL, 0x4c73315aUL, 0x1c40a0a3UL,
};
#endif
+
+#endif /* GNUTLS_LIB_NETTLE_GOST_ECC_GOST256CPA_32_H */
diff --git a/lib/nettle/gost/ecc-gost256cpa-64.h b/lib/nettle/gost/ecc-gost256cpa-64.h
index 64659d7adc..8f8c557f31 100644
--- a/lib/nettle/gost/ecc-gost256cpa-64.h
+++ b/lib/nettle/gost/ecc-gost256cpa-64.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_LIB_NETTLE_GOST_ECC_GOST256CPA_64_H
+#define GNUTLS_LIB_NETTLE_GOST_ECC_GOST256CPA_64_H
+
/* For NULL. */
#include <stddef.h>
#define ECC_LIMB_SIZE 4
@@ -1069,3 +1072,5 @@ static const mp_limb_t ecc_table[2048] = {
0xc2081d2422753b51ULL, 0xfca3e2e2f3beada6ULL, 0x5ab1f1431cd6ca20ULL, 0x1c40a0a34c73315aULL,
};
#endif
+
+#endif /* GNUTLS_LIB_NETTLE_GOST_ECC_GOST256CPA_64_H */
diff --git a/lib/nettle/gost/ecc-gost512a-32.h b/lib/nettle/gost/ecc-gost512a-32.h
index 59e09230cb..b401d83a9b 100644
--- a/lib/nettle/gost/ecc-gost512a-32.h
+++ b/lib/nettle/gost/ecc-gost512a-32.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_LIB_NETTLE_GOST_ECC_GOST512A_32_H
+#define GNUTLS_LIB_NETTLE_GOST_ECC_GOST512A_32_H
+
/* For NULL. */
#include <stddef.h>
#define ECC_LIMB_SIZE 16
@@ -1079,3 +1082,5 @@ static const mp_limb_t ecc_table[4096] = {
0xebf08ccdUL, 0xfa5a5e9bUL, 0x1514341bUL, 0xf3fa901eUL, 0x7274c4deUL, 0x58450d39UL, 0x3d7994ddUL, 0x11e797e3UL,
};
#endif
+
+#endif /* GNUTLS_LIB_NETTLE_GOST_ECC_GOST512A_32_H */
diff --git a/lib/nettle/gost/ecc-gost512a-64.h b/lib/nettle/gost/ecc-gost512a-64.h
index a9cd1498c0..4b2181a9fb 100644
--- a/lib/nettle/gost/ecc-gost512a-64.h
+++ b/lib/nettle/gost/ecc-gost512a-64.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_LIB_NETTLE_GOST_ECC_GOST512A_64_H
+#define GNUTLS_LIB_NETTLE_GOST_ECC_GOST512A_64_H
+
/* For NULL. */
#include <stddef.h>
#define ECC_LIMB_SIZE 8
@@ -557,3 +560,5 @@ static const mp_limb_t ecc_table[2048] = {
0x985a33a6204a4502ULL, 0x8b918c4eda502eb1ULL, 0x8026596480a17e66ULL, 0x173aeb7d9492eafbULL, 0xfa5a5e9bebf08ccdULL, 0xf3fa901e1514341bULL, 0x58450d397274c4deULL, 0x11e797e33d7994ddULL,
};
#endif
+
+#endif /* GNUTLS_LIB_NETTLE_GOST_ECC_GOST512A_64_H */
diff --git a/lib/nettle/gost/ecc-internal.h b/lib/nettle/gost/ecc-internal.h
index 70392aa7fb..a553983c9d 100644
--- a/lib/nettle/gost/ecc-internal.h
+++ b/lib/nettle/gost/ecc-internal.h
@@ -31,8 +31,8 @@
/* Development of Nettle's ECC support was funded by the .SE Internet Fund. */
-#ifndef NETTLE_GOST_ECC_INTERNAL_H_INCLUDED
-#define NETTLE_GOST_ECC_INTERNAL_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_ECC_INTERNAL_H
+#define GNUTLS_LIB_NETTLE_GOST_ECC_INTERNAL_H
#include <nettle/nettle-types.h>
#include <nettle/bignum.h>
@@ -250,4 +250,4 @@ cnd_copy (int cnd, mp_limb_t *rp, const mp_limb_t *ap, mp_size_t n);
#endif
#define ECC_GOSTDSA_SIGN_ITCH(size) (12*(size))
-#endif /* NETTLE_GOST_ECC_INTERNAL_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_ECC_INTERNAL_H */
diff --git a/lib/nettle/gost/gmp-glue.h b/lib/nettle/gost/gmp-glue.h
index ec3d4a1fd3..4b1d0932bd 100644
--- a/lib/nettle/gost/gmp-glue.h
+++ b/lib/nettle/gost/gmp-glue.h
@@ -30,8 +30,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_GMP_GLUE_H_INCLUDED
-#define NETTLE_GMP_GLUE_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_GMP_GLUE_H
+#define GNUTLS_LIB_NETTLE_GOST_GMP_GLUE_H
#include <nettle/bignum.h>
@@ -73,4 +73,4 @@ gmp_alloc_limbs (mp_size_t n);
void
gmp_free_limbs (mp_limb_t *p, mp_size_t n);
-#endif /* NETTLE_GMP_GLUE_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_GMP_GLUE_H */
diff --git a/lib/nettle/gost/gost28147.h b/lib/nettle/gost/gost28147.h
index 1a15785017..ca45517f41 100644
--- a/lib/nettle/gost/gost28147.h
+++ b/lib/nettle/gost/gost28147.h
@@ -32,8 +32,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_GOST28147_H_INCLUDED
-#define NETTLE_GOST28147_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_GOST28147_H
+#define GNUTLS_LIB_NETTLE_GOST_GOST28147_H
#include <nettle/nettle-types.h>
@@ -115,4 +115,4 @@ gost28147_encrypt_for_cfb(struct gost28147_ctx *ctx,
}
#endif
-#endif /* NETTLE_GOST28147_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_GOST28147_H */
diff --git a/lib/nettle/gost/gostdsa.h b/lib/nettle/gost/gostdsa.h
index aaad6520d9..9b0f517529 100644
--- a/lib/nettle/gost/gostdsa.h
+++ b/lib/nettle/gost/gostdsa.h
@@ -32,8 +32,8 @@
/* Development of Nettle's ECC support was funded by the .SE Internet Fund. */
-#ifndef NETTLE_GOSTDSA_H_INCLUDED
-#define NETTLE_GOSTDSA_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_GOSTDSA_H
+#define GNUTLS_LIB_NETTLE_GOST_GOSTDSA_H
#include <nettle/ecc.h>
#include <nettle/dsa.h>
@@ -104,4 +104,4 @@ ecc_gostdsa_verify (const struct ecc_curve *ecc,
}
#endif
-#endif /* NETTLE_GOSTDSA_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_GOSTDSA_H */
diff --git a/lib/nettle/gost/gosthash94.h b/lib/nettle/gost/gosthash94.h
index 3eda8c2d55..091d0256ee 100644
--- a/lib/nettle/gost/gosthash94.h
+++ b/lib/nettle/gost/gosthash94.h
@@ -59,8 +59,8 @@
* Ported to nettle by Nikos Mavrogiannopoulos.
*/
-#ifndef NETTLE_GOST_GOSTHASH94_H_INCLUDED
-#define NETTLE_GOST_GOSTHASH94_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_GOSTHASH94_H
+#define GNUTLS_LIB_NETTLE_GOST_GOSTHASH94_H
#include <nettle/nettle-types.h>
@@ -92,4 +92,4 @@ extern const struct nettle_hash _gnutls_gosthash94cp;
}
#endif
-#endif /* NETTLE_GOST_GOSTHASH94_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_GOSTHASH94_H */
diff --git a/lib/nettle/gost/hmac-gost.h b/lib/nettle/gost/hmac-gost.h
index ed5b1f7967..e847cda4f0 100644
--- a/lib/nettle/gost/hmac-gost.h
+++ b/lib/nettle/gost/hmac-gost.h
@@ -31,8 +31,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_HMAC_GOST_H_INCLUDED
-#define NETTLE_HMAC_GOST_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_HMAC_GOST_H
+#define GNUTLS_LIB_NETTLE_GOST_HMAC_GOST_H
#include <nettle/hmac.h>
@@ -100,4 +100,4 @@ hmac_streebog256_digest(struct hmac_streebog256_ctx *ctx,
}
#endif
-#endif /* NETTLE_HMAC_GOST_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_HMAC_GOST_H */
diff --git a/lib/nettle/gost/nettle-internal.h b/lib/nettle/gost/nettle-internal.h
index 2e06ebb0ff..00c899e7d4 100644
--- a/lib/nettle/gost/nettle-internal.h
+++ b/lib/nettle/gost/nettle-internal.h
@@ -32,8 +32,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_INTERNAL_H_INCLUDED
-#define NETTLE_INTERNAL_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_NETTLE_INTERNAL_H
+#define GNUTLS_LIB_NETTLE_GOST_NETTLE_INTERNAL_H
/* Temporary allocation, for systems that don't support alloca. Note
* that the allocation requests should always be reasonably small, so
@@ -49,4 +49,4 @@
do { if ((size) > (sizeof(name) / sizeof(name[0]))) abort(); } while (0)
#endif
-#endif /* NETTLE_INTERNAL_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_NETTLE_INTERNAL_H */
diff --git a/lib/nettle/gost/nettle-write.h b/lib/nettle/gost/nettle-write.h
index 655ab10b00..f3d2b74112 100644
--- a/lib/nettle/gost/nettle-write.h
+++ b/lib/nettle/gost/nettle-write.h
@@ -31,8 +31,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_WRITE_H_INCLUDED
-#define NETTLE_WRITE_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_NETTLE_WRITE_H
+#define GNUTLS_LIB_NETTLE_GOST_NETTLE_WRITE_H
/* For size_t */
#include <stddef.h>
@@ -55,4 +55,4 @@ void
_nettle_write_le64(size_t length, uint8_t *dst,
const uint64_t *src);
-#endif /* NETTLE_WRITE_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_NETTLE_WRITE_H */
diff --git a/lib/nettle/gost/pbkdf2-gost.h b/lib/nettle/gost/pbkdf2-gost.h
index 840627e213..bde2014704 100644
--- a/lib/nettle/gost/pbkdf2-gost.h
+++ b/lib/nettle/gost/pbkdf2-gost.h
@@ -31,8 +31,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_PBKDF2_GOST_H_INCLUDED
-#define NETTLE_PBKDF2_GOST_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_PBKDF2_GOST_H
+#define GNUTLS_LIB_NETTLE_GOST_PBKDF2_GOST_H
#include <nettle/nettle-meta.h>
#include <nettle/pbkdf2.h>
@@ -69,4 +69,4 @@ pbkdf2_hmac_streebog512 (size_t key_length, const uint8_t *key,
}
#endif
-#endif /* NETTLE_PBKDF2_GOST_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_PBKDF2_GOST_H */
diff --git a/lib/nettle/gost/streebog.h b/lib/nettle/gost/streebog.h
index 894a143ecc..3df9b3ab67 100644
--- a/lib/nettle/gost/streebog.h
+++ b/lib/nettle/gost/streebog.h
@@ -31,8 +31,8 @@
not, see https://www.gnu.org/licenses/.
*/
-#ifndef NETTLE_STREEBOG_H_INCLUDED
-#define NETTLE_STREEBOG_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_GOST_STREEBOG_H
+#define GNUTLS_LIB_NETTLE_GOST_STREEBOG_H
#include <nettle/nettle-types.h>
#include <nettle/nettle-meta.h>
@@ -102,4 +102,4 @@ extern const struct nettle_hash _gnutls_streebog512;
}
#endif
-#endif /* NETTLE_STREEBOG_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_GOST_STREEBOG_H */
diff --git a/lib/nettle/int/drbg-aes.h b/lib/nettle/int/drbg-aes.h
index 5d03929662..ac2b85860f 100644
--- a/lib/nettle/int/drbg-aes.h
+++ b/lib/nettle/int/drbg-aes.h
@@ -21,8 +21,8 @@
* MA 02111-1301, USA.
*/
-#ifndef DRBG_AES_H_INCLUDED
-#define DRBG_AES_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_INT_DRBG_AES_H
+#define GNUTLS_LIB_NETTLE_INT_DRBG_AES_H
#include <config.h>
#include <nettle/aes.h>
@@ -90,4 +90,4 @@ int drbg_aes_is_seeded(struct drbg_aes_ctx *ctx);
int drbg_aes_self_test(void);
-#endif /* DRBG_AES_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_INT_DRBG_AES_H */
diff --git a/lib/nettle/int/dsa-fips.h b/lib/nettle/int/dsa-fips.h
index 3d2fde4057..351e856f5d 100644
--- a/lib/nettle/int/dsa-fips.h
+++ b/lib/nettle/int/dsa-fips.h
@@ -21,8 +21,8 @@
* MA 02111-1301, USA.
*/
-#ifndef DSA_FIPS_H_INCLUDED
-#define DSA_FIPS_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_INT_DSA_FIPS_H
+#define GNUTLS_LIB_NETTLE_INT_DSA_FIPS_H
#include <nettle/bignum.h> /* includes gmp.h */
#include <nettle/dsa.h>
@@ -125,4 +125,4 @@ hash (uint8_t digest[DIGEST_SIZE], unsigned length, void *data)
unsigned mpz_seed_sizeinbase_256_u(mpz_t s, unsigned nominal);
-#endif /* DSA_FIPS_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_INT_DSA_FIPS_H */
diff --git a/lib/nettle/int/rsa-fips.h b/lib/nettle/int/rsa-fips.h
index 7b1cf701d2..a2a418a788 100644
--- a/lib/nettle/int/rsa-fips.h
+++ b/lib/nettle/int/rsa-fips.h
@@ -21,8 +21,8 @@
* MA 02111-1301, USA.
*/
-#ifndef RSA_FIPS_H_INCLUDED
-#define RSA_FIPS_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_INT_RSA_FIPS_H
+#define GNUTLS_LIB_NETTLE_INT_RSA_FIPS_H
#include <nettle/rsa.h>
@@ -46,4 +46,4 @@ rsa_generate_fips186_4_keypair(struct rsa_public_key *pub,
/* Desired size of modulo, in bits */
unsigned n_size);
-#endif
+#endif /* GNUTLS_LIB_NETTLE_INT_RSA_FIPS_H */
diff --git a/lib/nettle/int/tls1-prf.h b/lib/nettle/int/tls1-prf.h
index cb9b61f9af..f5d9c82702 100644
--- a/lib/nettle/int/tls1-prf.h
+++ b/lib/nettle/int/tls1-prf.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef TLS_PRF_H_INCLUDED
-#define TLS_PRF_H_INCLUDED
+#ifndef GNUTLS_LIB_NETTLE_INT_TLS1_PRF_H
+#define GNUTLS_LIB_NETTLE_INT_TLS1_PRF_H
#include <nettle/nettle-meta.h>
@@ -47,4 +47,4 @@ tls12_prf(void *mac_ctx,
size_t seed_size, const uint8_t *seed,
size_t length, uint8_t *dst);
-#endif /* TLS_PRF_H_INCLUDED */
+#endif /* GNUTLS_LIB_NETTLE_INT_TLS1_PRF_H */
diff --git a/lib/nettle/rnd-common.h b/lib/nettle/rnd-common.h
index 898e5d7fa3..429ca017d3 100644
--- a/lib/nettle/rnd-common.h
+++ b/lib/nettle/rnd-common.h
@@ -21,6 +21,9 @@
*
*/
+#ifndef GNUTLS_LIB_NETTLE_RND_COMMON_H
+#define GNUTLS_LIB_NETTLE_RND_COMMON_H
+
#include "gnutls_int.h"
#ifdef HAVE_GETPID
# include <unistd.h> /* getpid */
@@ -39,3 +42,5 @@ typedef int (*get_entropy_func)(void* rnd, size_t size);
extern get_entropy_func _rnd_get_system_entropy;
+
+#endif /* GNUTLS_LIB_NETTLE_RND_COMMON_H */
diff --git a/lib/num.h b/lib/num.h
index 75af1ea38e..6a7ec39d8c 100644
--- a/lib/num.h
+++ b/lib/num.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_NUM_H
-#define GNUTLS_NUM_H
+#ifndef GNUTLS_LIB_NUM_H
+#define GNUTLS_LIB_NUM_H
#include "gnutls_int.h"
@@ -162,4 +162,4 @@ inline static uint32_t _gnutls_uint64touint32(const gnutls_uint64 * num)
return ret;
}
-#endif /* GNUTLS_NUM_H */
+#endif /* GNUTLS_LIB_NUM_H */
diff --git a/lib/pin.h b/lib/pin.h
index 2721d04a0d..a21b185802 100644
--- a/lib/pin.h
+++ b/lib/pin.h
@@ -1,5 +1,5 @@
-#ifndef PIN_H
-#define PIN_H
+#ifndef GNUTLS_LIB_PIN_H
+#define GNUTLS_LIB_PIN_H
extern gnutls_pin_callback_t _gnutls_pin_func;
extern void *_gnutls_pin_data;
@@ -8,4 +8,4 @@ int
_gnutls_retrieve_pin(struct pin_info_st *pin_info, const char *url, const char *label,
unsigned pin_flags, char *pin, unsigned pin_size);
-#endif /* PIN_H */
+#endif /* GNUTLS_LIB_PIN_H */
diff --git a/lib/pk.h b/lib/pk.h
index b63ef2f75b..6c83cfa295 100644
--- a/lib/pk.h
+++ b/lib/pk.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_PK_H
-#define GNUTLS_PK_H
+#ifndef GNUTLS_LIB_PK_H
+#define GNUTLS_LIB_PK_H
extern int crypto_pk_prio;
extern gnutls_crypto_pk_st _gnutls_pk_ops;
@@ -129,4 +129,4 @@ int pk_hash_data(gnutls_pk_algorithm_t pk, const mac_entry_st * hash,
int _gnutls_find_rsa_pss_salt_size(unsigned bits, const mac_entry_st *me,
unsigned salt_size);
-#endif /* GNUTLS_PK_H */
+#endif /* GNUTLS_LIB_PK_H */
diff --git a/lib/pkcs11_int.h b/lib/pkcs11_int.h
index fa423422cb..9d88807098 100644
--- a/lib/pkcs11_int.h
+++ b/lib/pkcs11_int.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
-#ifndef PKCS11_INT_H
-#define PKCS11_INT_H
+#ifndef GNUTLS_LIB_PKCS11_INT_H
+#define GNUTLS_LIB_PKCS11_INT_H
#ifdef ENABLE_PKCS11
@@ -462,4 +462,4 @@ inline static bool is_pkcs11_url_object(const char *url)
#endif /* ENABLE_PKCS11 */
-#endif
+#endif /* GNUTLS_LIB_PKCS11_INT_H */
diff --git a/lib/pkcs11x.h b/lib/pkcs11x.h
index 9a648f0f2b..6fb10cb4cf 100644
--- a/lib/pkcs11x.h
+++ b/lib/pkcs11x.h
@@ -18,9 +18,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
-#ifndef PKCS11X_H
-#define PKCS11X_H
+#ifndef GNUTLS_LIB_PKCS11X_H
+#define GNUTLS_LIB_PKCS11X_H
#include <p11-kit/pkcs11x.h>
-#endif
+#endif /* GNUTLS_LIB_PKCS11X_H */
diff --git a/lib/random.h b/lib/random.h
index 21b85d5192..62b4dc2a07 100644
--- a/lib/random.h
+++ b/lib/random.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef RANDOM_H
-#define RANDOM_H
+#ifndef GNUTLS_LIB_RANDOM_H
+#define GNUTLS_LIB_RANDOM_H
#include <gnutls/crypto.h>
#include <crypto-backend.h>
@@ -38,4 +38,4 @@ inline static int _gnutls_rnd_check(void)
return _rnd_system_entropy_check();
}
-#endif
+#endif /* GNUTLS_LIB_RANDOM_H */
diff --git a/lib/record.h b/lib/record.h
index c7044e05d4..27aab48c7b 100644
--- a/lib/record.h
+++ b/lib/record.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_RECORD_H
-#define GNUTLS_RECORD_H
+#ifndef GNUTLS_LIB_RECORD_H
+#define GNUTLS_LIB_RECORD_H
#include <gnutls/gnutls.h>
#include <buffers.h>
@@ -105,4 +105,4 @@ inline static void session_invalidate(gnutls_session_t session)
session->internals.invalid_connection = 1;
}
-#endif
+#endif /* GNUTLS_LIB_RECORD_H */
diff --git a/lib/secrets.h b/lib/secrets.h
index f80d5c934e..13220264a3 100644
--- a/lib/secrets.h
+++ b/lib/secrets.h
@@ -20,8 +20,9 @@
*
*/
-#ifndef SECRETS_H
-#define SECRETS_H
+#ifndef GNUTLS_LIB_SECRETS_H
+#define GNUTLS_LIB_SECRETS_H
+
#include "gnutls_int.h"
int _tls13_init_secret(gnutls_session_t session, const uint8_t *psk, size_t psk_size);
@@ -54,4 +55,4 @@ int _tls13_expand_secret2(const mac_entry_st *prf,
const uint8_t secret[MAX_CIPHER_KEY_SIZE],
unsigned out_size, void *out);
-#endif
+#endif /* GNUTLS_LIB_SECRETS_H */
diff --git a/lib/session_pack.h b/lib/session_pack.h
index 43ddfa626f..20b3fbcd5e 100644
--- a/lib/session_pack.h
+++ b/lib/session_pack.h
@@ -20,7 +20,12 @@
*
*/
+#ifndef GNUTLS_LIB_SESSION_PACK_H
+#define GNUTLS_LIB_SESSION_PACK_H
+
int _gnutls_session_pack(gnutls_session_t session,
gnutls_datum_t * packed_session);
int _gnutls_session_unpack(gnutls_session_t session,
const gnutls_datum_t * packed_session);
+
+#endif /* GNUTLS_LIB_SESSION_PACK_H */
diff --git a/lib/srp.h b/lib/srp.h
index bf4f4d9679..ab5a184ac7 100644
--- a/lib/srp.h
+++ b/lib/srp.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef _SRP_H
-# define _SRP_H
+#ifndef GNUTLS_LIB_SRP_H
+#define GNUTLS_LIB_SRP_H
#include <config.h>
@@ -44,4 +44,4 @@ int _gnutls_srp_gn(uint8_t ** ret_g, uint8_t ** ret_n, int bits);
#endif
-#endif
+#endif /* GNUTLS_LIB_SRP_H */
diff --git a/lib/sslv2_compat.h b/lib/sslv2_compat.h
index fdfa367482..61b62cd650 100644
--- a/lib/sslv2_compat.h
+++ b/lib/sslv2_compat.h
@@ -20,5 +20,10 @@
*
*/
+#ifndef GNUTLS_LIB_SSLV2_COMPAT_H
+#define GNUTLS_LIB_SSLV2_COMPAT_H
+
int _gnutls_read_client_hello_v2(gnutls_session_t session, uint8_t * data,
unsigned int datalen);
+
+#endif /* GNUTLS_LIB_SSLV2_COMPAT_H */
diff --git a/lib/state.h b/lib/state.h
index 7081a7b136..819df21ec6 100644
--- a/lib/state.h
+++ b/lib/state.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_STATE_H
-#define GNUTLS_STATE_H
+#ifndef GNUTLS_LIB_STATE_H
+#define GNUTLS_LIB_STATE_H
#include "gnutls_int.h"
@@ -76,8 +76,6 @@ _gnutls_hello_set_default_version(gnutls_session_t session,
return ret; \
}
-#endif
-
int _gnutls_session_cert_type_supported(gnutls_session_t session,
gnutls_certificate_type_t cert_type,
@@ -123,3 +121,5 @@ _gnutls_PRF(gnutls_session_t session,
}
#define DEFAULT_CERT_TYPE GNUTLS_CRT_X509
+
+#endif /* GNUTLS_LIB_STATE_H */
diff --git a/lib/stek.h b/lib/stek.h
index 326ec6d082..284e6cbdb9 100644
--- a/lib/stek.h
+++ b/lib/stek.h
@@ -19,6 +19,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
+
+#ifndef GNUTLS_LIB_STEK_H
+#define GNUTLS_LIB_STEK_H
+
#include "gnutls_int.h"
int _gnutls_get_session_ticket_encryption_key(gnutls_session_t session,
@@ -36,3 +40,5 @@ void _gnutls_set_session_ticket_key_rotation_callback(gnutls_session_t session,
int _gnutls_initialize_session_ticket_key_rotation(gnutls_session_t session,
const gnutls_datum_t *key);
+
+#endif /* GNUTLS_LIB_STEK_H */
diff --git a/lib/str.h b/lib/str.h
index 9f0e7d6189..854cca12a6 100644
--- a/lib/str.h
+++ b/lib/str.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef GNUTLS_STR_H
-#define GNUTLS_STR_H
+#ifndef GNUTLS_LIB_STR_H
+#define GNUTLS_LIB_STR_H
#include <config.h>
#include "gnutls_int.h"
@@ -315,4 +315,4 @@ int _gnutls_hostname_compare(const char *certname, size_t certnamesize,
o.tv_nsec = s; \
}
-#endif
+#endif /* GNUTLS_LIB_STR_H */
diff --git a/lib/str_array.h b/lib/str_array.h
index bd0c97ac03..2a787233b8 100644
--- a/lib/str_array.h
+++ b/lib/str_array.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_STR_ARRAY_H
-#define GNUTLS_STR_ARRAY_H
+#ifndef GNUTLS_LIB_STR_ARRAY_H
+#define GNUTLS_LIB_STR_ARRAY_H
#include "gnutls_int.h"
#include "errors.h"
@@ -132,4 +132,4 @@ inline static int _gnutls_str_array_append_idna(gnutls_str_array_t * head,
return ret;
}
-#endif
+#endif /* GNUTLS_LIB_STR_ARRAY_H */
diff --git a/lib/supplemental.h b/lib/supplemental.h
index 5e4b5ca55c..446d70927a 100644
--- a/lib/supplemental.h
+++ b/lib/supplemental.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_SUPPLEMENTAL_H
+#define GNUTLS_LIB_SUPPLEMENTAL_H
+
#include "gnutls_int.h"
int _gnutls_parse_supplemental(gnutls_session_t session,
@@ -28,3 +31,5 @@ int _gnutls_gen_supplemental(gnutls_session_t session,
gnutls_buffer_st * buf);
void _gnutls_supplemental_deinit(void);
+
+#endif /* GNUTLS_LIB_SUPPLEMENTAL_H */
diff --git a/lib/system-keys.h b/lib/system-keys.h
index 7748c41158..ad3c411ca6 100644
--- a/lib/system-keys.h
+++ b/lib/system-keys.h
@@ -18,8 +18,8 @@
*
*/
-#ifndef SYSTEM_KEYS_H
-# define SYSTEM_KEYS_H
+#ifndef GNUTLS_LIB_SYSTEM_KEYS_H
+#define GNUTLS_LIB_SYSTEM_KEYS_H
#ifdef _WIN32
# define _gnutls_system_url_is_supported(x) 1
@@ -37,4 +37,4 @@ _gnutls_privkey_import_system_url(gnutls_privkey_t pkey,
void _gnutls_system_key_deinit(void);
int _gnutls_system_key_init(void);
-#endif
+#endif /* GNUTLS_LIB_SYSTEM_KEYS_H */
diff --git a/lib/system.h b/lib/system.h
index 2805ea46ff..b7b964fe11 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef SYSTEM_H
-#define SYSTEM_H
+#ifndef GNUTLS_LIB_SYSTEM_H
+#define GNUTLS_LIB_SYSTEM_H
#include "gnutls_int.h"
#include <time.h>
@@ -107,4 +107,4 @@ void _gnutls_global_set_gettime_function(gnutls_gettime_func gettime_func);
int gnutls_system_global_init(void);
void gnutls_system_global_deinit(void);
-#endif /* SYSTEM_H */
+#endif /* GNUTLS_LIB_SYSTEM_H */
diff --git a/lib/tls-sig.h b/lib/tls-sig.h
index e04303ee14..e2635eece4 100644
--- a/lib/tls-sig.h
+++ b/lib/tls-sig.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef GNUTLS_SIG_H
-#define GNUTLS_SIG_H
+#ifndef GNUTLS_LIB_TLS_SIG_H
+#define GNUTLS_LIB_TLS_SIG_H
#include <gnutls/abstract.h>
@@ -60,4 +60,4 @@ int _gnutls_handshake_verify_data(gnutls_session_t session,
gnutls_datum_t * signature,
gnutls_sign_algorithm_t algo);
-#endif
+#endif /* GNUTLS_LIB_TLS_SIG_H */
diff --git a/lib/tls13-sig.h b/lib/tls13-sig.h
index 115e39774a..a638420b45 100644
--- a/lib/tls13-sig.h
+++ b/lib/tls13-sig.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef _TLS13_SIG_H
-# define _TLS13_SIG_H
+#ifndef GNUTLS_LIB_TLS13_SIG_H
+#define GNUTLS_LIB_TLS13_SIG_H
#include "gnutls_int.h"
@@ -40,4 +40,4 @@ _gnutls13_handshake_sign_data(gnutls_session_t session,
gnutls_datum_t * signature,
const gnutls_sign_entry_st *se);
-#endif
+#endif /* GNUTLS_LIB_TLS13_SIG_H */
diff --git a/lib/tls13/anti_replay.h b/lib/tls13/anti_replay.h
index 934454fbd8..87726c3939 100644
--- a/lib/tls13/anti_replay.h
+++ b/lib/tls13/anti_replay.h
@@ -20,7 +20,12 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_ANTI_REPLAY_H
+#define GNUTLS_LIB_TLS13_ANTI_REPLAY_H
+
int _gnutls_anti_replay_check(gnutls_anti_replay_t,
uint32_t client_ticket_age,
struct timespec *ticket_creation_time,
gnutls_datum_t *id);
+
+#endif /* GNUTLS_LIB_TLS13_ANTI_REPLAY_H */
diff --git a/lib/tls13/certificate.h b/lib/tls13/certificate.h
index 1abecd1230..6f46cc2dd6 100644
--- a/lib/tls13/certificate.h
+++ b/lib/tls13/certificate.h
@@ -20,5 +20,10 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_CERTIFICATE_H
+#define GNUTLS_LIB_TLS13_CERTIFICATE_H
+
int _gnutls13_recv_certificate(gnutls_session_t session);
int _gnutls13_send_certificate(gnutls_session_t session, unsigned again);
+
+#endif /* GNUTLS_LIB_TLS13_CERTIFICATE_H */
diff --git a/lib/tls13/certificate_request.h b/lib/tls13/certificate_request.h
index 9a320f465e..40ac9f2ca2 100644
--- a/lib/tls13/certificate_request.h
+++ b/lib/tls13/certificate_request.h
@@ -20,7 +20,12 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_CERTIFICATE_REQUEST_H
+#define GNUTLS_LIB_TLS13_CERTIFICATE_REQUEST_H
+
int _gnutls13_recv_certificate_request(gnutls_session_t session);
int _gnutls13_recv_certificate_request_int(gnutls_session_t session, gnutls_buffer_st *buf);
int _gnutls13_send_certificate_request(gnutls_session_t session, unsigned again);
+
+#endif /* GNUTLS_LIB_TLS13_CERTIFICATE_REQUEST_H */
diff --git a/lib/tls13/certificate_verify.h b/lib/tls13/certificate_verify.h
index 74736b014b..9d4ce3135f 100644
--- a/lib/tls13/certificate_verify.h
+++ b/lib/tls13/certificate_verify.h
@@ -20,5 +20,10 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_CERTIFICATE_VERIFY_H
+#define GNUTLS_LIB_TLS13_CERTIFICATE_VERIFY_H
+
int _gnutls13_recv_certificate_verify(gnutls_session_t session);
int _gnutls13_send_certificate_verify(gnutls_session_t session, unsigned again);
+
+#endif /* GNUTLS_LIB_TLS13_CERTIFICATE_VERIFY_H */
diff --git a/lib/tls13/early_data.h b/lib/tls13/early_data.h
index 5c55be15c7..6fef12c107 100644
--- a/lib/tls13/early_data.h
+++ b/lib/tls13/early_data.h
@@ -20,6 +20,11 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_EARLY_DATA_H
+#define GNUTLS_LIB_TLS13_EARLY_DATA_H
+
int _gnutls13_send_end_of_early_data(gnutls_session_t session, unsigned again);
int _gnutls13_recv_end_of_early_data(gnutls_session_t session);
int _gnutls13_send_early_data(gnutls_session_t session);
+
+#endif /* GNUTLS_LIB_TLS13_EARLY_DATA_H */
diff --git a/lib/tls13/encrypted_extensions.h b/lib/tls13/encrypted_extensions.h
index be215b9c99..2c7cf7534a 100644
--- a/lib/tls13/encrypted_extensions.h
+++ b/lib/tls13/encrypted_extensions.h
@@ -20,5 +20,10 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_ENCRYPTED_EXTENSIONS_H
+#define GNUTLS_LIB_TLS13_ENCRYPTED_EXTENSIONS_H
+
int _gnutls13_recv_encrypted_extensions(gnutls_session_t session);
int _gnutls13_send_encrypted_extensions(gnutls_session_t session, unsigned again);
+
+#endif /* GNUTLS_LIB_TLS13_ENCRYPTED_EXTENSIONS_H */
diff --git a/lib/tls13/finished.h b/lib/tls13/finished.h
index b458b469d5..cf475b220f 100644
--- a/lib/tls13/finished.h
+++ b/lib/tls13/finished.h
@@ -20,9 +20,14 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_FINISHED_H
+#define GNUTLS_LIB_TLS13_FINISHED_H
+
int _gnutls13_compute_finished(const mac_entry_st *prf,
const uint8_t *base_key,
gnutls_buffer_st *handshake_hash_buffer,
void *out);
int _gnutls13_recv_finished(gnutls_session_t session);
int _gnutls13_send_finished(gnutls_session_t session, unsigned again);
+
+#endif /* GNUTLS_LIB_TLS13_FINISHED_H */
diff --git a/lib/tls13/hello_retry.h b/lib/tls13/hello_retry.h
index 8d4bf3c123..373670f208 100644
--- a/lib/tls13/hello_retry.h
+++ b/lib/tls13/hello_retry.h
@@ -20,4 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_HELLO_RETRY_H
+#define GNUTLS_LIB_TLS13_HELLO_RETRY_H
+
int _gnutls13_send_hello_retry_request(gnutls_session_t session, unsigned again);
+
+#endif /* GNUTLS_LIB_TLS13_HELLO_RETRY_H */
diff --git a/lib/tls13/key_update.h b/lib/tls13/key_update.h
index f42a6f620c..4a0123a1fb 100644
--- a/lib/tls13/key_update.h
+++ b/lib/tls13/key_update.h
@@ -20,5 +20,10 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_KEY_UPDATE_H
+#define GNUTLS_LIB_TLS13_KEY_UPDATE_H
+
int _gnutls13_recv_key_update(gnutls_session_t session, gnutls_buffer_st *buf);
int _gnutls13_send_key_update(gnutls_session_t session, unsigned again, unsigned flags);
+
+#endif /* GNUTLS_LIB_TLS13_KEY_UPDATE_H */
diff --git a/lib/tls13/psk_ext_parser.h b/lib/tls13/psk_ext_parser.h
index 52a140990e..30b47e904c 100644
--- a/lib/tls13/psk_ext_parser.h
+++ b/lib/tls13/psk_ext_parser.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_TLS13_PSK_EXT_PARSER_H
+#define GNUTLS_LIB_TLS13_PSK_EXT_PARSER_H
+
struct psk_ext_parser_st {
const unsigned char *identities_data;
ssize_t identities_len;
@@ -51,3 +54,5 @@ int _gnutls13_psk_ext_iter_next_identity(psk_ext_iter_st *iter,
struct psk_st *psk);
int _gnutls13_psk_ext_iter_next_binder(psk_ext_iter_st *iter,
gnutls_datum_t *binder);
+
+#endif /* GNUTLS_LIB_TLS13_PSK_EXT_PARSER_H */
diff --git a/lib/tls13/session_ticket.h b/lib/tls13/session_ticket.h
index 63b425e36d..cd65327e5a 100644
--- a/lib/tls13/session_ticket.h
+++ b/lib/tls13/session_ticket.h
@@ -19,8 +19,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*
*/
-#ifndef SESSION_TICKET_H
-#define SESSION_TICKET_H
+
+#ifndef GNUTLS_LIB_TLS13_SESSION_TICKET_H
+#define GNUTLS_LIB_TLS13_SESSION_TICKET_H
int _gnutls13_recv_session_ticket(gnutls_session_t session, gnutls_buffer_st *buf);
int _gnutls13_send_session_ticket(gnutls_session_t session, unsigned nr, unsigned again);
@@ -48,4 +49,4 @@ void _gnutls13_session_ticket_unset(gnutls_session_t session)
tls13_ticket_deinit(&session->internals.tls13_ticket);
}
-#endif
+#endif /* GNUTLS_LIB_TLS13_SESSION_TICKET_H */
diff --git a/lib/urls.h b/lib/urls.h
index 3d82fdf5d3..636592c45a 100644
--- a/lib/urls.h
+++ b/lib/urls.h
@@ -18,6 +18,9 @@
*
*/
+#ifndef GNUTLS_LIB_URLS_H
+#define GNUTLS_LIB_URLS_H
+
#define PKCS11_URL "pkcs11:"
#define SYSTEM_URL "system:"
#define TPMKEY_URL "tpmkey:"
@@ -36,3 +39,5 @@ int _gnutls_url_is_known(const char *url);
int _gnutls_get_raw_issuer(const char *url, gnutls_x509_crt_t cert,
gnutls_datum_t * issuer,
unsigned int flags);
+
+#endif /* GNUTLS_LIB_URLS_H */
diff --git a/lib/x509.h b/lib/x509.h
index b7c21965d6..3ad21f519a 100644
--- a/lib/x509.h
+++ b/lib/x509.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_X509_H
+#define GNUTLS_LIB_X509_H
+
#include <libtasn1.h>
@@ -39,3 +42,5 @@ int _gnutls_x509_cert_verify_peers(gnutls_session_t session,
int _gnutls_x509_raw_privkey_to_gkey(gnutls_privkey_t * privkey,
const gnutls_datum_t * raw_key,
gnutls_x509_crt_fmt_t type);
+
+#endif /* GNUTLS_LIB_X509_H */
diff --git a/lib/x509/attributes.h b/lib/x509/attributes.h
index 0d9314aa18..c148935b75 100644
--- a/lib/x509/attributes.h
+++ b/lib/x509/attributes.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_X509_ATTRIBUTES_H
+#define GNUTLS_LIB_X509_ATTRIBUTES_H
+
int
_x509_parse_attribute(ASN1_TYPE asn1_struct,
const char *attr_name, const char *given_oid, unsigned indx,
@@ -28,3 +31,5 @@ _x509_parse_attribute(ASN1_TYPE asn1_struct,
int
_x509_set_attribute(ASN1_TYPE asn, const char *root,
const char *ext_id, const gnutls_datum_t * ext_data);
+
+#endif /* GNUTLS_LIB_X509_ATTRIBUTES_H */
diff --git a/lib/x509/common.h b/lib/x509/common.h
index 99b767a694..8b60973388 100644
--- a/lib/x509/common.h
+++ b/lib/x509/common.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef COMMON_H
-#define COMMON_H
+#ifndef GNUTLS_LIB_X509_COMMON_H
+#define GNUTLS_LIB_X509_COMMON_H
#include <algorithms.h>
#include <abstract_int.h>
@@ -287,4 +287,4 @@ inline static int _asn1_strict_der_decode (asn1_node * element, const void *ider
return asn1_der_decoding2(element, ider, &len, _ASN1_DER_FLAGS, errorDescription);
}
-#endif
+#endif /* GNUTLS_LIB_X509_COMMON_H */
diff --git a/lib/x509/ip-in-cidr.h b/lib/x509/ip-in-cidr.h
index 40a65e637c..d5e26eb948 100644
--- a/lib/x509/ip-in-cidr.h
+++ b/lib/x509/ip-in-cidr.h
@@ -21,6 +21,9 @@
*
*/
+#ifndef GNUTLS_LIB_X509_IP_IN_CIDR_H
+#define GNUTLS_LIB_X509_IP_IN_CIDR_H
+
/*-
* ip_in_cidr:
* @ip: IP datum (IPv4 or IPv6)
@@ -51,3 +54,5 @@ static unsigned ip_in_cidr(const gnutls_datum_t *ip, const gnutls_datum_t *cidr)
return 1; /* match */
}
+
+#endif /* GNUTLS_LIB_X509_IP_IN_CIDR_H */
diff --git a/lib/x509/ip.h b/lib/x509/ip.h
index 86f9975d91..2c8569b889 100644
--- a/lib/x509/ip.h
+++ b/lib/x509/ip.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef IP_H
-#define IP_H
+#ifndef GNUTLS_LIB_X509_IP_H
+#define GNUTLS_LIB_X509_IP_H
// for documentation, see the definition
int _gnutls_mask_to_prefix(const unsigned char *mask, unsigned mask_size);
@@ -36,4 +36,4 @@ const char *_gnutls_cidr_to_string(const void *_ip, unsigned int ip_size, char *
// for documentation, see the definition
int _gnutls_mask_ip(unsigned char *ip, const unsigned char *mask, unsigned ipsize);
-#endif // IP_H
+#endif /* GNUTLS_LIB_X509_IP_H */
diff --git a/lib/x509/krb5.h b/lib/x509/krb5.h
index 6824fde8cc..d8926af67a 100644
--- a/lib/x509/krb5.h
+++ b/lib/x509/krb5.h
@@ -18,5 +18,10 @@
* <https://www.gnu.org/licenses/>.
*/
+#ifndef GNUTLS_LIB_X509_KRB5_H
+#define GNUTLS_LIB_X509_KRB5_H
+
int _gnutls_krb5_principal_to_der(const char *name, gnutls_datum_t * der);
int _gnutls_krb5_der_to_principal(const gnutls_datum_t * der, gnutls_datum_t *name);
+
+#endif /* GNUTLS_LIB_X509_KRB5_H */
diff --git a/lib/x509/ocsp.h b/lib/x509/ocsp.h
index 76bc309bb3..3f63a5bfe2 100644
--- a/lib/x509/ocsp.h
+++ b/lib/x509/ocsp.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_X509_OCSP_H
+#define GNUTLS_LIB_X509_OCSP_H
+
/* Online Certificate Status Protocol - RFC 2560
*/
#include <gnutls/ocsp.h>
@@ -30,3 +33,5 @@
time_t _gnutls_ocsp_get_validity(gnutls_ocsp_resp_t resp);
#define MAX_OCSP_MSG_SIZE 128
const char *_gnutls_ocsp_verify_status_to_str(gnutls_ocsp_verify_reason_t r, char out[MAX_OCSP_MSG_SIZE]);
+
+#endif /* GNUTLS_LIB_X509_OCSP_H */
diff --git a/lib/x509/pkcs7_int.h b/lib/x509/pkcs7_int.h
index 69e2873e56..97a01d7a40 100644
--- a/lib/x509/pkcs7_int.h
+++ b/lib/x509/pkcs7_int.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef PKCS7_INT_H
-#define PKCS7_INT_H
+#ifndef GNUTLS_LIB_X509_PKCS7_INT_H
+#define GNUTLS_LIB_X509_PKCS7_INT_H
#include <gnutls/x509.h>
@@ -131,4 +131,4 @@ int
_gnutls_pkcs7_data_enc_info(const gnutls_datum_t * data, const struct pkcs_cipher_schema_st **p,
struct pbkdf2_params *kdf_params, char **oid);
-#endif
+#endif /* GNUTLS_LIB_X509_PKCS7_INT_H */
diff --git a/lib/x509/prov-seed.h b/lib/x509/prov-seed.h
index d9dd8e6948..a7753ccb50 100644
--- a/lib/x509/prov-seed.h
+++ b/lib/x509/prov-seed.h
@@ -20,5 +20,10 @@
*
*/
+#ifndef GNUTLS_LIB_X509_PROV_SEED_H
+#define GNUTLS_LIB_X509_PROV_SEED_H
+
int _x509_encode_provable_seed(gnutls_x509_privkey_t pkey, gnutls_datum_t *der);
int _x509_decode_provable_seed(gnutls_x509_privkey_t pkey, const gnutls_datum_t *der);
+
+#endif /* GNUTLS_LIB_X509_PROV_SEED_H */
diff --git a/lib/x509/verify-high.h b/lib/x509/verify-high.h
index 68430fddba..ca1f98b831 100644
--- a/lib/x509/verify-high.h
+++ b/lib/x509/verify-high.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef VERIFY_HIGH_H
-# define VERIFY_HIGH_H
+#ifndef GNUTLS_LIB_X509_VERIFY_HIGH_H
+#define GNUTLS_LIB_X509_VERIFY_HIGH_H
struct gnutls_x509_trust_list_st {
unsigned int size;
@@ -46,4 +46,4 @@ struct gnutls_x509_trust_list_st {
int _gnutls_trustlist_inlist(gnutls_x509_trust_list_t list,
gnutls_x509_crt_t cert);
-#endif
+#endif /* GNUTLS_LIB_X509_VERIFY_HIGH_H */
diff --git a/lib/x509/virt-san.h b/lib/x509/virt-san.h
index c9fe3f7b55..44b6fe65c5 100644
--- a/lib/x509/virt-san.h
+++ b/lib/x509/virt-san.h
@@ -19,11 +19,11 @@
*
*/
-#ifndef VIRT_SAN_H
-# define VIRT_SAN_H
+#ifndef GNUTLS_LIB_X509_VIRT_SAN_H
+#define GNUTLS_LIB_X509_VIRT_SAN_H
#include "x509_ext_int.h"
int _gnutls_alt_name_assign_virt_type(struct name_st *name, unsigned type, gnutls_datum_t *san, const char *othername_oid, unsigned raw);
-#endif
+#endif /* GNUTLS_LIB_X509_VIRT_SAN_H */
diff --git a/lib/x509/x509_ext_int.h b/lib/x509/x509_ext_int.h
index d1a395a6f8..2e3f162a5d 100644
--- a/lib/x509/x509_ext_int.h
+++ b/lib/x509/x509_ext_int.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef X509_EXT_INT_H
-#define X509_EXT_INT_H
+#ifndef GNUTLS_LIB_X509_X509_EXT_INT_H
+#define GNUTLS_LIB_X509_X509_EXT_INT_H
#include "gnutls_int.h"
struct name_st {
@@ -31,4 +31,4 @@ struct name_st {
int _gnutls_alt_name_process(gnutls_datum_t *out, unsigned type, const gnutls_datum_t *san, unsigned raw);
-#endif
+#endif /* GNUTLS_LIB_X509_X509_EXT_INT_H */
diff --git a/lib/x509/x509_int.h b/lib/x509/x509_int.h
index 353eb8cdc4..3b94fc50da 100644
--- a/lib/x509/x509_int.h
+++ b/lib/x509/x509_int.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef X509_H
-#define X509_H
+#ifndef GNUTLS_LIB_X509_X509_INT_H
+#define GNUTLS_LIB_X509_X509_INT_H
#include <gnutls/x509.h>
#include <gnutls/x509-ext.h>
@@ -546,4 +546,4 @@ struct gnutls_x509_tlsfeatures_st {
unsigned _gnutls_is_broken_sig_allowed(const gnutls_sign_entry_st *se, unsigned int flags);
-#endif
+#endif /* GNUTLS_LIB_X509_X509_INT_H */
diff --git a/lib/x509_b64.h b/lib/x509_b64.h
index e33eed0622..271850a1dc 100644
--- a/lib/x509_b64.h
+++ b/lib/x509_b64.h
@@ -20,6 +20,9 @@
*
*/
+#ifndef GNUTLS_LIB_X509_B64_H
+#define GNUTLS_LIB_X509_B64_H
+
int _gnutls_fbase64_encode(const char *msg, const uint8_t * data,
size_t data_size, gnutls_datum_t * result);
int _gnutls_fbase64_decode(const char *header, const uint8_t * data,
@@ -37,3 +40,5 @@ _gnutls_base64_decode(const uint8_t * data, size_t data_size,
#define B64FSIZE( hsize, dsize) \
(B64SIZE(dsize) + (hsize) + /*newlines*/ \
B64SIZE(dsize)/64 + (((B64SIZE(dsize) % 64) > 0) ? 1 : 0))
+
+#endif /* GNUTLS_LIB_X509_B64_H */
diff --git a/src/benchmark.h b/src/benchmark.h
index f449a576ed..2152e6edcf 100644
--- a/src/benchmark.h
+++ b/src/benchmark.h
@@ -17,6 +17,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+#ifndef GNUTLS_SRC_BENCHMARK_H
+#define GNUTLS_SRC_BENCHMARK_H
+
#include <sys/time.h>
#include <time.h>
#include <signal.h>
@@ -67,3 +70,5 @@ timespec_sub_ms(struct timespec *a, struct timespec *b)
{
return (a->tv_sec - b->tv_sec) * 1000 + (a->tv_nsec - b->tv_nsec) / (1000 * 1000);
}
+
+#endif /* GNUTLS_SRC_BENCHMARK_H */
diff --git a/src/certtool-cfg.h b/src/certtool-cfg.h
index 6a4be91e6f..c23ff5b0b0 100644
--- a/src/certtool-cfg.h
+++ b/src/certtool-cfg.h
@@ -20,6 +20,9 @@
* Written by Nikos Mavrogiannopoulos <nmav@gnutls.org>.
*/
+#ifndef GNUTLS_SRC_CERTTOOL_CFG_H
+#define GNUTLS_SRC_CERTTOOL_CFG_H
+
#include <stdbool.h>
#include <stdint.h>
#include <gnutls/x509.h>
@@ -103,3 +106,5 @@ void get_oid_crq_set(gnutls_x509_crq_t crq);
const char *get_proxy_policy(char **policy, size_t * policylen);
void crq_extensions_set(gnutls_x509_crt_t crt, gnutls_x509_crq_t crq);
+
+#endif /* GNUTLS_SRC_CERTTOOL_CFG_H */
diff --git a/src/certtool-common.h b/src/certtool-common.h
index 9e423c0493..a4b4c5867f 100644
--- a/src/certtool-common.h
+++ b/src/certtool-common.h
@@ -19,8 +19,8 @@
* <https://www.gnu.org/licenses/>.
*/
-#ifndef CERTTOOL_COMMON_H
-#define CERTTOOL_COMMON_H
+#ifndef GNUTLS_SRC_CERTTOOL_COMMON_H
+#define GNUTLS_SRC_CERTTOOL_COMMON_H
#include <gnutls/x509.h>
#include <stdio.h>
@@ -193,4 +193,4 @@ gnutls_digest_algorithm_t hash_to_id(const char *hash);
void sign_params_to_flags(common_info_st *cinfo, const char *params);
-#endif
+#endif /* GNUTLS_SRC_CERTTOOL_COMMON_H */
diff --git a/src/common.h b/src/common.h
index 91b9ed04f2..40f16451ae 100644
--- a/src/common.h
+++ b/src/common.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-#ifndef INCLUDE_COMMON_H
-# define INCLUDE_COMMON_H
+#ifndef GNUTLS_SRC_COMMON_H
+#define GNUTLS_SRC_COMMON_H
#define SERVER "127.0.0.1"
@@ -144,4 +144,4 @@ void set_read_funcs(gnutls_session_t session)
# define set_read_funcs(x)
#endif
-#endif
+#endif /* GNUTLS_SRC_COMMON_H */
diff --git a/src/inline_cmds.h b/src/inline_cmds.h
index b773172345..2705a8cc30 100755
--- a/src/inline_cmds.h
+++ b/src/inline_cmds.h
@@ -17,6 +17,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+#ifndef GNUTLS_SRC_INLINE_CMDS_H
+#define GNUTLS_SRC_INLINE_CMDS_H
+
/*
* The inline commands is a facility that can be used optionally
* when --inline-commands is set during invocation of gnutls-cli
@@ -73,3 +76,5 @@ struct inline_command_definitions inline_commands_def[] = {
};
#define NUM_INLINE_COMMANDS ((unsigned)(sizeof(inline_commands_def)/sizeof(inline_commands_def[0])))
+
+#endif /* GNUTLS_SRC_INLINE_CMDS_H */
diff --git a/src/list.h b/src/list.h
index 138f6d476d..967eb193e2 100644
--- a/src/list.h
+++ b/src/list.h
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifndef GNUTLS_SRC_LIST_H
+#define GNUTLS_SRC_LIST_H
+
/*
SOAP:
@@ -123,10 +126,6 @@ int main (int argc, char **argv)
*/
-
-#ifndef _LIST_H
-#define _LIST_H
-
/* the `search' member points to the last found.
this speeds up repeated searches on the same list-item,
the consecutive list-item, or the pre-consecutive list-item.
@@ -444,4 +443,4 @@ struct list {
free (__t); \
} \
-#endif /* _LIST_H */
+#endif /* GNUTLS_SRC_LIST_H */
diff --git a/src/ocsptool-common.h b/src/ocsptool-common.h
index eda4adbc8b..76f16b0b92 100644
--- a/src/ocsptool-common.h
+++ b/src/ocsptool-common.h
@@ -18,8 +18,8 @@
* <https://www.gnu.org/licenses/>.
*/
-#ifndef OCSPTOOL_COMMON_H
-#define OCSPTOOL_COMMON_H
+#ifndef GNUTLS_SRC_OCSPTOOL_COMMON_H
+#define GNUTLS_SRC_OCSPTOOL_COMMON_H
#include <gnutls/ocsp.h>
@@ -45,4 +45,4 @@ check_ocsp_response(gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer,
gnutls_datum_t * data, gnutls_datum_t *nonce,
int verbose);
-#endif
+#endif /* GNUTLS_SRC_OCSPTOOL_COMMON_H */
diff --git a/src/p11tool.h b/src/p11tool.h
index 2a49b7256b..073bc79ca7 100644
--- a/src/p11tool.h
+++ b/src/p11tool.h
@@ -20,8 +20,8 @@
* <https://www.gnu.org/licenses/>.
*/
-#ifndef P11TOOL_H
-#define P11TOOL_H
+#ifndef GNUTLS_SRC_P11TOOL_H
+#define GNUTLS_SRC_P11TOOL_H
#include "certtool-common.h"
@@ -72,4 +72,4 @@ void pkcs11_set_label(FILE * outfile, const char *url, int detailed,
#define PKCS11_TYPE_PRIVKEY 5
#define PKCS11_TYPE_INFO 6
-#endif
+#endif /* GNUTLS_SRC_P11TOOL_H */
diff --git a/src/tests.h b/src/tests.h
index 79032d2175..098c441a8d 100644
--- a/src/tests.h
+++ b/src/tests.h
@@ -18,6 +18,9 @@
* <https://www.gnu.org/licenses/>.
*/
+#ifndef GNUTLS_SRC_TESTS_H
+#define GNUTLS_SRC_TESTS_H
+
typedef enum {
TEST_SUCCEED, TEST_FAILED, TEST_UNSURE, TEST_IGNORE/*keep socket*/, TEST_IGNORE2/*destroy socket*/
} test_code_t;
@@ -79,3 +82,5 @@ test_code_t test_aes_gcm(gnutls_session_t session);
test_code_t test_aes_ccm(gnutls_session_t session);
test_code_t test_aes_ccm_8(gnutls_session_t session);
test_code_t test_sha256(gnutls_session_t session);
+
+#endif /* GNUTLS_SRC_TESTS_H */
diff --git a/src/udp-serv.h b/src/udp-serv.h
index da8e4570ff..08c88de254 100644
--- a/src/udp-serv.h
+++ b/src/udp-serv.h
@@ -17,6 +17,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+#ifndef GNUTLS_SRC_UDP_SERV_H
+#define GNUTLS_SRC_UDP_SERV_H
+
#include <gnutls/dtls.h>
void udp_server(const char *name, int port, int mtu);
@@ -25,3 +28,5 @@ const char *human_addr(const struct sockaddr *sa, socklen_t salen,
char *buf, size_t buflen);
int wait_for_connection(void);
int listen_socket(const char *name, int listen_port, int socktype);
+
+#endif /* GNUTLS_SRC_UDP_SERV_H */
diff --git a/tests/cert-common.h b/tests/cert-common.h
index 86aeb5c924..5ccae43ccc 100644
--- a/tests/cert-common.h
+++ b/tests/cert-common.h
@@ -20,6 +20,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifndef GNUTLS_TESTS_CERT_COMMON_H
+#define GNUTLS_TESTS_CERT_COMMON_H
+
#include <gnutls/gnutls.h>
/* This file contains a lot of common parameters used by legacy and new
@@ -1911,3 +1914,5 @@ const gnutls_datum_t rawpk_private_key2 = {
(unsigned char*)rawpk_private_key_pem2,
sizeof(rawpk_private_key_pem2) - 1
};
+
+#endif /* GNUTLS_TESTS_CERT_COMMON_H */
diff --git a/tests/cert-repro-20170915.h b/tests/cert-repro-20170915.h
index 7381497c06..9078857a0a 100644
--- a/tests/cert-repro-20170915.h
+++ b/tests/cert-repro-20170915.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_TESTS_CERT_REPRO_20170915_H
+#define GNUTLS_TESTS_CERT_REPRO_20170915_H
+
static char client_cert_repro_pem[] =
"-----BEGIN CERTIFICATE-----\n"
"MIILITCCBiegAwIBAgIJAMHDrh3rcjmCMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"
@@ -376,3 +379,5 @@ static gnutls_datum_t server_repro_key = { (void*)server_key_repro_pem, sizeof(s
static gnutls_datum_t server_repro_cert = { (void*)server_cert_repro_pem, sizeof(server_cert_repro_pem)-1 };
static gnutls_datum_t client_repro_key = { (void*)client_key_repro_pem, sizeof(client_key_repro_pem)-1 };
static gnutls_datum_t client_repro_cert = { (void*)client_cert_repro_pem, sizeof(client_cert_repro_pem)-1 };
+
+#endif /* GNUTLS_TESTS_CERT_REPRO_20170915_H */
diff --git a/tests/cmocka-common.h b/tests/cmocka-common.h
index 2ac0dfbf9c..3f0c9316c6 100644
--- a/tests/cmocka-common.h
+++ b/tests/cmocka-common.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_TESTS_CMOCKA_COMMON_H
+#define GNUTLS_TESTS_CMOCKA_COMMON_H
+
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
@@ -5,3 +8,5 @@
#define USE_CMOCKA
#include "eagain-common.h"
+
+#endif /* GNUTLS_TESTS_CMOCKA_COMMON_H */
diff --git a/tests/common-cert-key-exchange.h b/tests/common-cert-key-exchange.h
index 5d68d72ff8..57b2b54239 100644
--- a/tests/common-cert-key-exchange.h
+++ b/tests/common-cert-key-exchange.h
@@ -20,6 +20,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifndef GNUTLS_TESTS_COMMON_CERT_KEY_EXCHANGE_H
+#define GNUTLS_TESTS_COMMON_CERT_KEY_EXCHANGE_H
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -114,3 +117,5 @@ void dtls_try_with_key_mtu(const char *name, const char *client_prio, gnutls_kx_
const gnutls_datum_t *cli_cert,
const gnutls_datum_t *cli_key,
unsigned client_cert, unsigned mtu);
+
+#endif /* GNUTLS_TESTS_COMMON_CERT_KEY_EXCHANGE_H */
diff --git a/tests/common-key-tests.h b/tests/common-key-tests.h
index 2c60176e6f..f3490409e8 100644
--- a/tests/common-key-tests.h
+++ b/tests/common-key-tests.h
@@ -20,6 +20,9 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifndef GNUTLS_TESTS_COMMON_KEY_TESTS_H
+#define GNUTLS_TESTS_COMMON_KEY_TESTS_H
+
#include "cert-common.h"
#include <gnutls/abstract.h>
@@ -88,3 +91,5 @@ struct _key_tests_st common_key_tests[] = {
.data_only = 1
}
};
+
+#endif /* GNUTLS_TESTS_COMMON_KEY_TESTS_H */
diff --git a/tests/eagain-common.h b/tests/eagain-common.h
index 19084050b7..6b168cb684 100644
--- a/tests/eagain-common.h
+++ b/tests/eagain-common.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_TESTS_EAGAIN_COMMON_H
+#define GNUTLS_TESTS_EAGAIN_COMMON_H
+
#include <errno.h>
#include <time.h>
#include <stdio.h>
@@ -361,3 +364,5 @@ inline static int record_send_loop(gnutls_session_t session,
return ret;
}
+
+#endif /* GNUTLS_TESTS_EAGAIN_COMMON_H */
diff --git a/tests/hex.h b/tests/hex.h
index 616d92489a..4129a0537e 100644
--- a/tests/hex.h
+++ b/tests/hex.h
@@ -19,8 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
-#ifndef HEX_H
-#define HEX_H
+#ifndef GNUTLS_TESTS_HEX_H
+#define GNUTLS_TESTS_HEX_H
#include <stdio.h>
#include <string.h>
@@ -47,4 +47,4 @@ inline static gnutls_datum_t SDATA(const char *txt)
return output;
}
-#endif
+#endif /* GNUTLS_TESTS_HEX_H */
diff --git a/tests/ocsp-common.h b/tests/ocsp-common.h
index a1bee46173..30bcbbf843 100644
--- a/tests/ocsp-common.h
+++ b/tests/ocsp-common.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef OCSP_COMMON_H
-#define OCSP_COMMON_H
+#ifndef GNUTLS_TESTS_OCSP_COMMON_H
+#define GNUTLS_TESTS_OCSP_COMMON_H
#if defined __clang__ || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
# pragma GCC diagnostic push
@@ -584,4 +584,4 @@ static gnutls_datum_t ocsp_subca3_unknown_pem = {
# pragma GCC diagnostic pop
#endif
-#endif
+#endif /* GNUTLS_TESTS_OCSP_COMMON_H */
diff --git a/tests/test-chains.h b/tests/test-chains.h
index 3ca098d4ba..cf4d0c442a 100644
--- a/tests/test-chains.h
+++ b/tests/test-chains.h
@@ -20,6 +20,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
+#ifndef GNUTLS_TESTS_TEST_CHAINS_H
+#define GNUTLS_TESTS_TEST_CHAINS_H
+
/* *INDENT-OFF* */
#define MAX_CHAIN 10
@@ -4150,3 +4153,5 @@ static struct
#endif
/* *INDENT-ON* */
+
+#endif /* GNUTLS_TESTS_TEST_CHAINS_H */
diff --git a/tests/utils.h b/tests/utils.h
index dda3ef47ad..e36e4f3b6b 100644
--- a/tests/utils.h
+++ b/tests/utils.h
@@ -20,8 +20,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
-#ifndef UTILS_H
-#define UTILS_H
+#ifndef GNUTLS_TESTS_UTILS_H
+#define GNUTLS_TESTS_UTILS_H
#include <stdio.h>
#include <stdlib.h>
@@ -174,4 +174,4 @@ inline static void check_wait_status_for_sig(int status)
_check_wait_status(status, 1);
}
-#endif /* UTILS_H */
+#endif /* GNUTLS_TESTS_UTILS_H */
diff --git a/tests/virt-time.h b/tests/virt-time.h
index 3bf6d4d2d7..0e7e213c53 100644
--- a/tests/virt-time.h
+++ b/tests/virt-time.h
@@ -19,8 +19,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>
*/
-#ifndef VIRT_TIME_H
-#define VIRT_TIME_H
+#ifndef GNUTLS_TESTS_VIRT_TIME_H
+#define GNUTLS_TESTS_VIRT_TIME_H
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -68,4 +68,4 @@ static void mygettime(struct timespec * t)
*t = _now_ts;
}
-#endif
+#endif /* GNUTLS_TESTS_VIRT_TIME_H */
diff --git a/tests/x509sign-verify-common.h b/tests/x509sign-verify-common.h
index d7f3b41cfa..80aea5cd63 100644
--- a/tests/x509sign-verify-common.h
+++ b/tests/x509sign-verify-common.h
@@ -1,3 +1,6 @@
+#ifndef GNUTLS_TESTS_X509SIGN_VERIFY_COMMON_H
+#define GNUTLS_TESTS_X509SIGN_VERIFY_COMMON_H
+
static void tls_log_func(int level, const char *str)
{
fprintf(stderr, "<%d> %s", level, str);
@@ -223,3 +226,5 @@ void test_sig(gnutls_pk_algorithm_t pk, unsigned hash, unsigned bits)
gnutls_pubkey_deinit(pubkey);
}
}
+
+#endif /* GNUTLS_TESTS_X509SIGN_VERIFY_COMMON_H */