summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2025-11-26 10:19:57 +0000
committertb <>2025-11-26 10:19:57 +0000
commit4879f73ba340a5a6a1e4b5812f046c92cf362d95 (patch)
treef4e49dade531b065882e4b3f1a67e3ecb0647b36 /src
parentc1cd9b31174d2c148f5a1dedde49f456a97398d4 (diff)
downloadopenbsd-4879f73ba340a5a6a1e4b5812f046c92cf362d95.tar.gz
openbsd-4879f73ba340a5a6a1e4b5812f046c92cf362d95.tar.bz2
openbsd-4879f73ba340a5a6a1e4b5812f046c92cf362d95.zip
libcrypto: add header guards to *_local.h
An upcoming change requires the inclusion of asn1_local.h in x509_local.h which doesn't work due to missing header guards. Add guards to all local headers that don't have them, although reacharounds and multiple inclusions are unlikely to occur for most of those. ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/asn1/asn1_local.h7
-rw-r--r--src/lib/libcrypto/cast/cast_local.h7
-rw-r--r--src/lib/libcrypto/ct/ct_local.h7
-rw-r--r--src/lib/libcrypto/dsa/dsa_local.h7
-rw-r--r--src/lib/libcrypto/ec/ec_local.h7
-rw-r--r--src/lib/libcrypto/idea/idea_local.h7
-rw-r--r--src/lib/libcrypto/modes/modes_local.h7
-rw-r--r--src/lib/libcrypto/rc2/rc2_local.h7
-rw-r--r--src/lib/libcrypto/rsa/rsa_local.h7
9 files changed, 54 insertions, 9 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_local.h b/src/lib/libcrypto/asn1/asn1_local.h
index 19de978772..d61cfaa7b9 100644
--- a/src/lib/libcrypto/asn1/asn1_local.h
+++ b/src/lib/libcrypto/asn1/asn1_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_local.h,v 1.10 2024/03/02 09:10:42 tb Exp $ */ 1/* $OpenBSD: asn1_local.h,v 1.11 2025/11/26 10:19:57 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -56,6 +56,9 @@
56 * 56 *
57 */ 57 */
58 58
59#ifndef HEADER_ASN1_LOCAL_H
60#define HEADER_ASN1_LOCAL_H
61
59#include "bytestring.h" 62#include "bytestring.h"
60 63
61__BEGIN_HIDDEN_DECLS 64__BEGIN_HIDDEN_DECLS
@@ -191,3 +194,5 @@ int ASN1_time_parse(const char *_bytes, size_t _len, struct tm *_tm, int _mode);
191int ASN1_time_tm_cmp(struct tm *_tm1, struct tm *_tm2); 194int ASN1_time_tm_cmp(struct tm *_tm1, struct tm *_tm2);
192 195
193__END_HIDDEN_DECLS 196__END_HIDDEN_DECLS
197
198#endif /* HEADER_ASN1_LOCAL_H */
diff --git a/src/lib/libcrypto/cast/cast_local.h b/src/lib/libcrypto/cast/cast_local.h
index 5fb9911105..c8b89071c5 100644
--- a/src/lib/libcrypto/cast/cast_local.h
+++ b/src/lib/libcrypto/cast/cast_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: cast_local.h,v 1.2 2023/07/08 07:25:43 jsing Exp $ */ 1/* $OpenBSD: cast_local.h,v 1.3 2025/11/26 10:19:57 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -56,6 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef HEADER_CAST_LOCAL_H
60#define HEADER_CAST_LOCAL_H
61
59#undef c2l 62#undef c2l
60#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \ 63#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
61 l|=((unsigned long)(*((c)++)))<< 8L, \ 64 l|=((unsigned long)(*((c)++)))<< 8L, \
@@ -214,3 +217,5 @@ extern const CAST_LONG CAST_S_table4[256];
214extern const CAST_LONG CAST_S_table5[256]; 217extern const CAST_LONG CAST_S_table5[256];
215extern const CAST_LONG CAST_S_table6[256]; 218extern const CAST_LONG CAST_S_table6[256];
216extern const CAST_LONG CAST_S_table7[256]; 219extern const CAST_LONG CAST_S_table7[256];
220
221#endif /* HEADER_CAST_LOCAL_H */
diff --git a/src/lib/libcrypto/ct/ct_local.h b/src/lib/libcrypto/ct/ct_local.h
index cd19ed096a..152ab9d8c4 100644
--- a/src/lib/libcrypto/ct/ct_local.h
+++ b/src/lib/libcrypto/ct/ct_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ct_local.h,v 1.8 2021/12/20 17:19:19 jsing Exp $ */ 1/* $OpenBSD: ct_local.h,v 1.9 2025/11/26 10:19:57 tb Exp $ */
2/* 2/*
3 * Written by Rob Percival (robpercival@google.com) for the OpenSSL project. 3 * Written by Rob Percival (robpercival@google.com) for the OpenSSL project.
4 */ 4 */
@@ -51,6 +51,9 @@
51 * ==================================================================== 51 * ====================================================================
52 */ 52 */
53 53
54#ifndef HEADER_CT_LOCAL_H
55#define HEADER_CT_LOCAL_H
56
54#include <stddef.h> 57#include <stddef.h>
55 58
56#include <openssl/ct.h> 59#include <openssl/ct.h>
@@ -258,3 +261,5 @@ int o2i_SCT_signature(SCT *sct, CBS *cbs);
258 * Handlers for Certificate Transparency X509v3/OCSP extensions 261 * Handlers for Certificate Transparency X509v3/OCSP extensions
259 */ 262 */
260extern const X509V3_EXT_METHOD v3_ct_scts[3]; 263extern const X509V3_EXT_METHOD v3_ct_scts[3];
264
265#endif /* HEADER_CT_LOCAL_H */
diff --git a/src/lib/libcrypto/dsa/dsa_local.h b/src/lib/libcrypto/dsa/dsa_local.h
index fc77c09fcb..3d32e5e547 100644
--- a/src/lib/libcrypto/dsa/dsa_local.h
+++ b/src/lib/libcrypto/dsa/dsa_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_local.h,v 1.5 2024/11/29 07:42:35 tb Exp $ */ 1/* $OpenBSD: dsa_local.h,v 1.6 2025/11/26 10:19:57 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2007 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2007 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -53,6 +53,9 @@
53 * 53 *
54 */ 54 */
55 55
56#ifndef HEADER_DSA_LOCAL_H
57#define HEADER_DSA_LOCAL_H
58
56#include <openssl/dsa.h> 59#include <openssl/dsa.h>
57 60
58__BEGIN_HIDDEN_DECLS 61__BEGIN_HIDDEN_DECLS
@@ -102,3 +105,5 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits,
102int dsa_check_key(const DSA *dsa); 105int dsa_check_key(const DSA *dsa);
103 106
104__END_HIDDEN_DECLS 107__END_HIDDEN_DECLS
108
109#endif /* HEADER_DSA_LOCAL_H */
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h
index eac9e6d26c..48a7d929ea 100644
--- a/src/lib/libcrypto/ec/ec_local.h
+++ b/src/lib/libcrypto/ec/ec_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_local.h,v 1.70 2025/08/03 15:07:57 jsing Exp $ */ 1/* $OpenBSD: ec_local.h,v 1.71 2025/11/26 10:19:57 tb Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -69,6 +69,9 @@
69 * 69 *
70 */ 70 */
71 71
72#ifndef HEADER_EC_LOCAL_H
73#define HEADER_EC_LOCAL_H
74
72#include <stdlib.h> 75#include <stdlib.h>
73 76
74#include <openssl/bn.h> 77#include <openssl/bn.h>
@@ -265,3 +268,5 @@ int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z,
265 size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md); 268 size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md);
266 269
267__END_HIDDEN_DECLS 270__END_HIDDEN_DECLS
271
272#endif /* HEADER_EC_LOCAL_H */
diff --git a/src/lib/libcrypto/idea/idea_local.h b/src/lib/libcrypto/idea/idea_local.h
index c7fd3271a7..c0a592ab1c 100644
--- a/src/lib/libcrypto/idea/idea_local.h
+++ b/src/lib/libcrypto/idea/idea_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: idea_local.h,v 1.2 2023/07/07 12:51:58 beck Exp $ */ 1/* $OpenBSD: idea_local.h,v 1.3 2025/11/26 10:19:57 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -56,6 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef HEADER_IDEA_LOCAL_H
60#define HEADER_IDEA_LOCAL_H
61
59/* The new form of this macro (check if the a*b == 0) was suggested by 62/* The new form of this macro (check if the a*b == 0) was suggested by
60 * Colin Plumb <colin@nyx10.cs.du.edu> */ 63 * Colin Plumb <colin@nyx10.cs.du.edu> */
61/* Removal of the inner if from from Wei Dai 24/4/96 */ 64/* Removal of the inner if from from Wei Dai 24/4/96 */
@@ -147,3 +150,5 @@ else \
147 ul=x2^t0; /* do the swap to x3 */ \ 150 ul=x2^t0; /* do the swap to x3 */ \
148 x2=x3^t1; \ 151 x2=x3^t1; \
149 x3=ul; 152 x3=ul;
153
154#endif /* HEADER_IDEA_LOCAL_H */
diff --git a/src/lib/libcrypto/modes/modes_local.h b/src/lib/libcrypto/modes/modes_local.h
index 5c1acfc25f..df699d3e4c 100644
--- a/src/lib/libcrypto/modes/modes_local.h
+++ b/src/lib/libcrypto/modes/modes_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: modes_local.h,v 1.7 2025/07/13 06:01:33 jsing Exp $ */ 1/* $OpenBSD: modes_local.h,v 1.8 2025/11/26 10:19:57 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2010 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -6,6 +6,9 @@
6 * ==================================================================== 6 * ====================================================================
7 */ 7 */
8 8
9#ifndef HEADER_MODES_LOCAL_H
10#define HEADER_MODES_LOCAL_H
11
9#include <endian.h> 12#include <endian.h>
10 13
11#include <openssl/opensslconf.h> 14#include <openssl/opensslconf.h>
@@ -61,3 +64,5 @@ struct ccm128_context {
61}; 64};
62 65
63__END_HIDDEN_DECLS 66__END_HIDDEN_DECLS
67
68#endif /* HEADER_MODES_LOCAL_H */
diff --git a/src/lib/libcrypto/rc2/rc2_local.h b/src/lib/libcrypto/rc2/rc2_local.h
index dd5598760e..885b17aa5e 100644
--- a/src/lib/libcrypto/rc2/rc2_local.h
+++ b/src/lib/libcrypto/rc2/rc2_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: rc2_local.h,v 1.3 2024/03/29 05:03:48 jsing Exp $ */ 1/* $OpenBSD: rc2_local.h,v 1.4 2025/11/26 10:19:57 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -56,6 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef HEADER_RC2_LOCAL_H
60#define HEADER_RC2_LOCAL_H
61
59#undef c2l 62#undef c2l
60#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \ 63#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
61 l|=((unsigned long)(*((c)++)))<< 8L, \ 64 l|=((unsigned long)(*((c)++)))<< 8L, \
@@ -110,3 +113,5 @@
110 x2=(t<<3)|(t>>13); \ 113 x2=(t<<3)|(t>>13); \
111 t=(x3+(x0& ~x2)+(x1&x2)+ *(p0++))&0xffff; \ 114 t=(x3+(x0& ~x2)+(x1&x2)+ *(p0++))&0xffff; \
112 x3=(t<<5)|(t>>11); 115 x3=(t<<5)|(t>>11);
116
117#endif /* HEADER_RC2_LOCAL_H */
diff --git a/src/lib/libcrypto/rsa/rsa_local.h b/src/lib/libcrypto/rsa/rsa_local.h
index 3f88b952a2..a026a488b6 100644
--- a/src/lib/libcrypto/rsa/rsa_local.h
+++ b/src/lib/libcrypto/rsa/rsa_local.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_local.h,v 1.10 2025/01/05 15:39:12 tb Exp $ */ 1/* $OpenBSD: rsa_local.h,v 1.11 2025/11/26 10:19:57 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -56,6 +56,9 @@
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59#ifndef HEADER_RSA_LOCAL_H
60#define HEADER_RSA_LOCAL_H
61
59__BEGIN_HIDDEN_DECLS 62__BEGIN_HIDDEN_DECLS
60 63
61#define RSA_MIN_MODULUS_BITS 512 64#define RSA_MIN_MODULUS_BITS 512
@@ -152,3 +155,5 @@ int BN_BLINDING_is_local(BN_BLINDING *b);
152BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx); 155BN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);
153 156
154__END_HIDDEN_DECLS 157__END_HIDDEN_DECLS
158
159#endif /* HEADER_RSA_LOCAL_H */