From f04f0853b2be8b46d1437e6636900165b3a89f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Thu, 14 Mar 2019 21:21:50 +0100 Subject: Add or clean header guards in lib/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Rühsen --- lib/abstract_int.h | 6 +++--- lib/algorithms.h | 6 +++--- lib/atfork.h | 6 +++--- lib/atomic.h | 6 +++--- lib/auth.h | 6 +++--- lib/buffers.h | 7 ++++--- lib/cert-cred.h | 5 +++++ lib/cipher.h | 5 +++++ lib/cipher_int.h | 6 +++--- lib/constate.h | 6 +++--- lib/crypto-api.h | 6 +++--- lib/crypto-backend.h | 6 +++--- lib/crypto.h | 6 +++--- lib/datum.h | 6 +++--- lib/db.h | 5 +++++ lib/debug.h | 5 +++++ lib/dh.h | 6 +++--- lib/dtls.h | 6 +++--- lib/ecc.h | 6 +++--- lib/errors.h | 6 +++--- lib/extv.h | 6 +++--- lib/file.h | 5 +++++ lib/fips.h | 6 +++--- lib/global.h | 6 +++--- lib/gnutls_int.h | 6 +++--- lib/gthreads.h | 5 +++++ lib/handshake.h | 6 +++--- lib/hash_int.h | 6 +++--- lib/hello_ext.h | 6 +++--- lib/hello_ext_lib.h | 6 +++--- lib/kx.h | 5 +++++ lib/locks.h | 6 +++--- lib/mbuffers.h | 6 +++--- lib/mem.h | 6 +++--- lib/mpi.h | 6 +++--- lib/num.h | 6 +++--- lib/pin.h | 6 +++--- lib/pk.h | 6 +++--- lib/pkcs11_int.h | 6 +++--- lib/pkcs11x.h | 6 +++--- lib/random.h | 6 +++--- lib/record.h | 6 +++--- lib/secrets.h | 7 ++++--- lib/session_pack.h | 5 +++++ lib/srp.h | 6 +++--- lib/sslv2_compat.h | 5 +++++ lib/state.h | 8 ++++---- lib/stek.h | 6 ++++++ lib/str.h | 6 +++--- lib/str_array.h | 6 +++--- lib/supplemental.h | 5 +++++ lib/system-keys.h | 6 +++--- lib/system.h | 6 +++--- lib/tls-sig.h | 6 +++--- lib/tls13-sig.h | 6 +++--- lib/urls.h | 5 +++++ lib/x509.h | 5 +++++ lib/x509_b64.h | 5 +++++ 58 files changed, 206 insertions(+), 133 deletions(-) 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 @@ -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 #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 @@ -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/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 * */ -#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 #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 #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 @@ -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 @@ -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 #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 @@ -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/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 #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 @@ -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 #include @@ -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 @@ -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 #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 @@ -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 @@ -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 #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 #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 @@ -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/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 */ -#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 */ -#ifndef PKCS11X_H -#define PKCS11X_H +#ifndef GNUTLS_LIB_PKCS11X_H +#define GNUTLS_LIB_PKCS11X_H #include -#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 #include @@ -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 #include @@ -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 @@ -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 * */ + +#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 #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 @@ -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 @@ -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/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 @@ -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_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 */ -- cgit v1.2.1