Skip to content

Commit ae4186b

Browse files
committed
Fix header file include guard names
Make the include guards consistent by renaming them systematically according to the naming conventions below For the public header files (in the 'include/openssl' directory), the guard names try to match the path specified in the include directives, with all letters converted to upper case and '/' and '.' replaced by '_'. For the private header files files, an extra 'OSSL_' is added as prefix. Reviewed-by: Richard Levitte <[email protected]> (Merged from openssl#9333)
1 parent 8c78f0e commit ae4186b

File tree

215 files changed

+481
-481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

215 files changed

+481
-481
lines changed

apps/include/apps.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_APPS_H
11-
# define HEADER_APPS_H
10+
#ifndef OSSL_APPS_H
11+
# define OSSL_APPS_H
1212

1313
# include "e_os.h" /* struct timeval for DTLS */
1414
# include "internal/nelem.h"

apps/include/apps_ui.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_APPS_UI_H
11-
# define HEADER_APPS_UI_H
10+
#ifndef OSSL_APPS_UI_H
11+
# define OSSL_APPS_UI_H
1212

1313

1414
# define PW_MIN_LENGTH 4

apps/include/fmt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* shared fields have been moved into this file.
1515
*/
1616

17-
#ifndef HEADER_FMT_H
18-
#define HEADER_FMT_H
17+
#ifndef OSSL_APPS_FMT_H
18+
#define OSSL_APPS_FMT_H
1919

2020
/* On some platforms, it's important to distinguish between text and binary
2121
* files. On some, there might even be specific file formats for different
@@ -41,4 +41,4 @@
4141

4242
int FMT_istext(int format);
4343

44-
#endif /* HEADER_FMT_H_ */
44+
#endif /* OSSL_APPS_FMT_H_ */

apps/include/function.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef APPS_FUNCTION_H
11-
# define APPS_FUNCTION_H
10+
#ifndef OSSL_APPS_FUNCTION_H
11+
# define OSSL_APPS_FUNCTION_H
1212

1313
# include <openssl/lhash.h>
1414
# include "opt.h"

apps/include/opt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* in the file LICENSE in the source distribution or at
77
* https://www.openssl.org/source/license.html
88
*/
9-
#ifndef HEADER_OPT_H
10-
#define HEADER_OPT_H
9+
#ifndef OSSL_APPS_OPT_H
10+
#define OSSL_APPS_OPT_H
1111

1212
#include <sys/types.h>
1313
#include <openssl/e_os2.h>
@@ -347,4 +347,4 @@ int opt_format_error(const char *s, unsigned long flags);
347347
int opt_isdir(const char *name);
348348
int opt_printf_stderr(const char *fmt, ...);
349349

350-
#endif /* HEADER_OPT_H */
350+
#endif /* OSSL_APPS_OPT_H */

apps/include/platform.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_PLATFORM_H
11-
# define HEADER_PLATFORM_H
10+
#ifndef OSSL_APPS_PLATFORM_H
11+
# define OSSL_APPS_PLATFORM_H
1212

1313
# include <openssl/e_os2.h>
1414

apps/include/vms_term_sock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* https://www.openssl.org/source/license.html
99
*/
1010

11-
#ifndef TERM_SOCK_H
12-
# define TERM_SOCK_H
11+
#ifndef OSSL_APPS_VMS_TERM_SOCK_H
12+
# define OSSL_APPS_VMS_TERM_SOCK_H
1313

1414
/*
1515
** Terminal Socket Function Codes

apps/timeouts.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef INCLUDED_TIMEOUTS_H
11-
# define INCLUDED_TIMEOUTS_H
10+
#ifndef OSSL_APPS_TIMEOUTS_H
11+
# define OSSL_APPS_TIMEOUTS_H
1212

1313
/* numbers in us */
1414
# define DGRAM_RCV_TIMEOUT 250000
1515
# define DGRAM_SND_TIMEOUT 250000
1616

17-
#endif /* ! INCLUDED_TIMEOUTS_H */
17+
#endif /* ! OSSL_APPS_TIMEOUTS_H */

crypto/aes/aes_local.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_AES_LOCL_H
11-
# define HEADER_AES_LOCL_H
10+
#ifndef OSSL_CRYPTO_AES_LOCAL_H
11+
# define OSSL_CRYPTO_AES_LOCAL_H
1212

1313
# include <openssl/e_os2.h>
1414
# include <stdio.h>
@@ -39,4 +39,4 @@ typedef unsigned char u8;
3939
/* This controls loop-unrolling in aes_core.c */
4040
# undef FULL_UNROLL
4141

42-
#endif /* !HEADER_AES_LOCL_H */
42+
#endif /* !OSSL_CRYPTO_AES_LOCAL_H */

crypto/arm_arch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef __ARM_ARCH_H__
11-
# define __ARM_ARCH_H__
10+
#ifndef OSSL_CRYPTO_ARM_ARCH_H
11+
# define OSSL_CRYPTO_ARM_ARCH_H
1212

1313
# if !defined(__ARM_ARCH__)
1414
# if defined(__CC_ARM)

crypto/async/arch/async_posix.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H
11-
#define OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H
10+
#ifndef OSSL_CRYPTO_ASYNC_POSIX_H
11+
#define OSSL_CRYPTO_ASYNC_POSIX_H
1212
#include <openssl/e_os2.h>
1313

1414
#if defined(OPENSSL_SYS_UNIX) \
@@ -55,4 +55,4 @@ void async_fibre_free(async_fibre *fibre);
5555

5656
# endif
5757
#endif
58-
#endif /* OPENSSL_ASYNC_ARCH_ASYNC_POSIX_H */
58+
#endif /* OSSL_CRYPTO_ASYNC_POSIX_H */

crypto/bf/bf_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_BF_LOCL_H
11-
# define HEADER_BF_LOCL_H
10+
#ifndef OSSL_CRYPTO_BF_LOCAL_H
11+
# define OSSL_CRYPTO_BF_LOCAL_H
1212
# include <openssl/opensslconf.h>
1313

1414
/* NOTE - c is not incremented as per n2l */

crypto/bio/bio_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
* For clarity, we check for internal/cryptlib.h since it's a common header
2828
* that also includes bio.h.
2929
*/
30-
# ifdef HEADER_CRYPTLIB_H
30+
# ifdef OSSL_INTERNAL_CRYPTLIB_H
3131
# error internal/cryptlib.h included before bio_local.h
3232
# endif
33-
# ifdef HEADER_BIO_H
33+
# ifdef OPENSSL_BIO_H
3434
# error openssl/bio.h included before bio_local.h
3535
# endif
3636

crypto/bn/bn_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_BN_LCL_H
11-
# define HEADER_BN_LCL_H
10+
#ifndef OSSL_CRYPTO_BN_LOCAL_H
11+
# define OSSL_CRYPTO_BN_LOCAL_H
1212

1313
/*
1414
* The EDK2 build doesn't use bn_conf.h; it sets THIRTY_TWO_BIT or

crypto/bn/rsaz_exp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* (2) University of Haifa, Israel
1313
*/
1414

15-
#ifndef RSAZ_EXP_H
16-
# define RSAZ_EXP_H
15+
#ifndef OSSL_CRYPTO_BN_RSAZ_EXP_H
16+
# define OSSL_CRYPTO_BN_RSAZ_EXP_H
1717

1818
# undef RSAZ_ENABLED
1919
# if defined(OPENSSL_BN_ASM_MONT) && \

crypto/camellia/cmll_local.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* to the OpenSSL project.
2323
*/
2424

25-
#ifndef HEADER_CAMELLIA_LOCL_H
26-
# define HEADER_CAMELLIA_LOCL_H
25+
#ifndef OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H
26+
# define OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H
2727

2828
typedef unsigned int u32;
2929
typedef unsigned char u8;
@@ -40,4 +40,4 @@ void Camellia_EncryptBlock(int keyBitLength, const u8 plaintext[],
4040
const KEY_TABLE_TYPE keyTable, u8 ciphertext[]);
4141
void Camellia_DecryptBlock(int keyBitLength, const u8 ciphertext[],
4242
const KEY_TABLE_TYPE keyTable, u8 plaintext[]);
43-
#endif /* #ifndef HEADER_CAMELLIA_LOCL_H */
43+
#endif /* #ifndef OSSL_CRYPTO_CAMELLIA_CMLL_LOCAL_H */

crypto/cmp/cmp_local.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* https://www.openssl.org/source/license.html
1010
*/
1111

12-
#ifndef OSSL_HEADER_CMP_INT_H
13-
# define OSSL_HEADER_CMP_INT_H
12+
#ifndef OSSL_CRYPTO_CMP_LOCAL_H
13+
# define OSSL_CRYPTO_CMP_LOCAL_H
1414

1515
# include "internal/cryptlib.h"
1616

@@ -722,4 +722,4 @@ int ossl_cmp_ctx_set1_recipNonce(OSSL_CMP_CTX *ctx,
722722

723723
# define OSSL_CMP_TRANSACTIONID_LENGTH 16
724724

725-
#endif /* !defined OSSL_HEADER_CMP_INT_H */
725+
#endif /* !defined OSSL_CRYPTO_CMP_LOCAL_H */

crypto/cms/cms_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_CMS_LCL_H
11-
# define HEADER_CMS_LCL_H
10+
#ifndef OSSL_CRYPTO_CMS_LOCAL_H
11+
# define OSSL_CRYPTO_CMS_LOCAL_H
1212

1313
# include <openssl/x509.h>
1414

crypto/crmf/crmf_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
* CRMF implementation by Martin Peylo, Miikka Viljanen, and David von Oheimb.
1212
*/
1313

14-
#ifndef OSSL_HEADER_CRMF_INT_H
15-
# define OSSL_HEADER_CRMF_INT_H
14+
#ifndef OSSL_CRYPTO_CRMF_LOCAL_H
15+
# define OSSL_CRYPTO_CRMF_LOCAL_H
1616

1717
# include <openssl/crmf.h>
1818
# include <openssl/err.h>

crypto/des/des_local.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* https://www.openssl.org/source/license.html
88
*/
99

10-
#ifndef HEADER_DES_LOCL_H
11-
# define HEADER_DES_LOCL_H
10+
#ifndef OSSL_CRYPTO_DES_LOCAL_H
11+
# define OSSL_CRYPTO_DES_LOCAL_H
1212

1313
# include <openssl/e_os2.h>
1414

crypto/ec/curve448/arch_32/arch_intrinsics.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Originally written by Mike Hamburg
1111
*/
1212

13-
#ifndef HEADER_ARCH_32_ARCH_INTRINSICS_H
14-
# define HEADER_ARCH_32_ARCH_INTRINSICS_H
13+
#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H
14+
# define OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H
1515

1616
#include "internal/constant_time.h"
1717

@@ -24,4 +24,4 @@ static ossl_inline uint64_t widemul(uint32_t a, uint32_t b)
2424
return ((uint64_t)a) * b;
2525
}
2626

27-
#endif /* HEADER_ARCH_32_ARCH_INTRINSICS_H */
27+
#endif /* OSSL_CRYPTO_EC_CURVE448_ARCH_32_INTRINSICS_H */

crypto/ec/curve448/arch_32/f_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Originally written by Mike Hamburg
1111
*/
1212

13-
#ifndef HEADER_ARCH_32_F_IMPL_H
14-
# define HEADER_ARCH_32_F_IMPL_H
13+
#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H
14+
# define OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H
1515

1616
# define GF_HEADROOM 2
1717
# define LIMB(x) ((x) & ((1 << 28) - 1)), ((x) >> 28)
@@ -57,4 +57,4 @@ void gf_weak_reduce(gf a)
5757
a->limb[0] = (a->limb[0] & mask) + tmp;
5858
}
5959

60-
#endif /* HEADER_ARCH_32_F_IMPL_H */
60+
#endif /* OSSL_CRYPTO_EC_CURVE448_ARCH_32_F_IMPL_H */

crypto/ec/curve448/curve448_local.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* in the file LICENSE in the source distribution or at
77
* https://www.openssl.org/source/license.html
88
*/
9-
#ifndef HEADER_CURVE448_LCL_H
10-
# define HEADER_CURVE448_LCL_H
9+
#ifndef OSSL_CRYPTO_EC_CURVE448_LOCAL_H
10+
# define OSSL_CRYPTO_EC_CURVE448_LOCAL_H
1111
# include "curve448utils.h"
1212

1313
int X448(uint8_t out_shared_key[56], const uint8_t private_key[56],
@@ -36,4 +36,4 @@ int ED448ph_verify(OPENSSL_CTX *ctx, const uint8_t hash[64],
3636
int ED448_public_from_private(OPENSSL_CTX *ctx, uint8_t out_public_key[57],
3737
const uint8_t private_key[57]);
3838

39-
#endif /* HEADER_CURVE448_LCL_H */
39+
#endif /* OSSL_CRYPTO_EC_CURVE448_LOCAL_H */

crypto/ec/curve448/curve448utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Originally written by Mike Hamburg
1111
*/
1212

13-
#ifndef HEADER_CURVE448UTILS_H
14-
# define HEADER_CURVE448UTILS_H
13+
#ifndef OSSL_CRYPTO_EC_CURVE448UTILS_H
14+
# define OSSL_CRYPTO_EC_CURVE448UTILS_H
1515

1616
# include <openssl/e_os2.h>
1717

crypto/ec/curve448/ed448.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Originally written by Mike Hamburg
1111
*/
1212

13-
#ifndef HEADER_ED448_H
14-
# define HEADER_ED448_H
13+
#ifndef OSSL_CRYPTO_EC_CURVE448_ED448_H
14+
# define OSSL_CRYPTO_EC_CURVE448_ED448_H
1515

1616
# include "point_448.h"
1717

@@ -198,4 +198,4 @@ c448_error_t c448_ed448_convert_private_key_to_x448(
198198
uint8_t x[X448_PRIVATE_BYTES],
199199
const uint8_t ed[EDDSA_448_PRIVATE_BYTES]);
200200

201-
#endif /* HEADER_ED448_H */
201+
#endif /* OSSL_CRYPTO_EC_CURVE448_ED448_H */

crypto/ec/curve448/field.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Originally written by Mike Hamburg
1111
*/
1212

13-
#ifndef HEADER_FIELD_H
14-
# define HEADER_FIELD_H
13+
#ifndef OSSL_CRYPTO_EC_CURVE448_FIELD_H
14+
# define OSSL_CRYPTO_EC_CURVE448_FIELD_H
1515

1616
# include "internal/constant_time.h"
1717
# include <string.h>
@@ -165,4 +165,4 @@ static ossl_inline void gf_cond_swap(gf x, gf_s * RESTRICT y, mask_t swap)
165165
}
166166
}
167167

168-
#endif /* HEADER_FIELD_H */
168+
#endif /* OSSL_CRYPTO_EC_CURVE448_FIELD_H */

crypto/ec/curve448/point_448.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Originally written by Mike Hamburg
1111
*/
1212

13-
#ifndef HEADER_POINT_448_H
14-
# define HEADER_POINT_448_H
13+
#ifndef OSSL_CRYPTO_EC_CURVE448_POINT_448_H
14+
# define OSSL_CRYPTO_EC_CURVE448_POINT_448_H
1515

1616
# include "curve448utils.h"
1717
# include "field.h"
@@ -298,4 +298,4 @@ void curve448_scalar_destroy(curve448_scalar_t scalar);
298298
/* Overwrite point with zeros. */
299299
void curve448_point_destroy(curve448_point_t point);
300300

301-
#endif /* HEADER_POINT_448_H */
301+
#endif /* OSSL_CRYPTO_EC_CURVE448_POINT_448_H */

crypto/ec/curve448/word.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* Originally written by Mike Hamburg
1111
*/
1212

13-
#ifndef HEADER_WORD_H
14-
# define HEADER_WORD_H
13+
#ifndef OSSL_CRYPTO_EC_CURVE448_WORD_H
14+
# define OSSL_CRYPTO_EC_CURVE448_WORD_H
1515

1616
# include <string.h>
1717
# include <assert.h>
@@ -78,4 +78,4 @@ static ossl_inline mask_t bool_to_mask(c448_bool_t m)
7878
return ret;
7979
}
8080

81-
#endif /* HEADER_WORD_H */
81+
#endif /* OSSL_CRYPTO_EC_CURVE448_WORD_H */

0 commit comments

Comments
 (0)