From e1b703522865e8996212ffc767bc616d3a7bc7b0 Mon Sep 17 00:00:00 2001 From: kenjiro <> Date: Fri, 31 Jul 2026 00:50:52 +0000 Subject: Add missing internal header includes Include the relevant internal headers in implementation files that define internal functions. Also make asn1_local.h and pkcs12_local.h self-contained by including their corresponding public headers. ok tb beck --- src/lib/libcrypto/aes/aes.c | 3 ++- src/lib/libcrypto/asn1/a_int.c | 3 ++- src/lib/libcrypto/asn1/a_time_posix.c | 3 ++- src/lib/libcrypto/asn1/a_time_tm.c | 3 ++- src/lib/libcrypto/asn1/asn1_lib.c | 3 ++- src/lib/libcrypto/asn1/asn1_local.h | 4 +++- src/lib/libcrypto/asn1/asn1_types.c | 4 +++- src/lib/libcrypto/asn1/bio_asn1.c | 3 ++- src/lib/libcrypto/asn1/tasn_typ.c | 4 +++- src/lib/libcrypto/asn1/tasn_utl.c | 3 ++- src/lib/libcrypto/bn/bn_const.c | 4 +++- src/lib/libcrypto/conf/conf_mod.c | 3 ++- src/lib/libcrypto/ct/ct_x509v3.c | 3 ++- src/lib/libcrypto/ec/ec_ameth.c | 3 ++- src/lib/libcrypto/err/err.c | 5 ++++- src/lib/libcrypto/pkcs12/p12_decr.c | 3 ++- src/lib/libcrypto/pkcs12/pkcs12_local.h | 4 +++- src/lib/libcrypto/pkcs7/pk7_doit.c | 4 +++- src/lib/libcrypto/rsa/rsa_x931.c | 3 ++- src/lib/libcrypto/x509/x509_ia5.c | 3 ++- src/lib/libcrypto/x509/x509_info.c | 3 ++- src/lib/libcrypto/x509/x509_int.c | 4 +++- src/lib/libcrypto/x509/x509_ocsp.c | 3 ++- src/lib/libcrypto/x509/x509_pku.c | 4 +++- src/lib/libcrypto/x509/x509_utl.c | 3 ++- 25 files changed, 60 insertions(+), 25 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/aes/aes.c b/src/lib/libcrypto/aes/aes.c index 9cffe6b7cd..027cb84064 100644 --- a/src/lib/libcrypto/aes/aes.c +++ b/src/lib/libcrypto/aes/aes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes.c,v 1.17 2025/09/15 07:36:12 tb Exp $ */ +/* $OpenBSD: aes.c,v 1.18 2026/07/31 00:50:52 kenjiro Exp $ */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * @@ -55,6 +55,7 @@ #include #include +#include "aes_local.h" #include "crypto_arch.h" #include "crypto_internal.h" #include "modes_local.h" diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c index f171e330f6..5d05c2022c 100644 --- a/src/lib/libcrypto/asn1/a_int.c +++ b/src/lib/libcrypto/asn1/a_int.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_int.c,v 1.49 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: a_int.c,v 1.50 2026/07/31 00:50:52 kenjiro Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -65,6 +65,7 @@ #include #include +#include "asn1_local.h" #include "bytestring.h" #include "err_local.h" diff --git a/src/lib/libcrypto/asn1/a_time_posix.c b/src/lib/libcrypto/asn1/a_time_posix.c index d4439b4701..da21ae7cbc 100644 --- a/src/lib/libcrypto/asn1/a_time_posix.c +++ b/src/lib/libcrypto/asn1/a_time_posix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_time_posix.c,v 1.5 2024/02/18 16:28:38 tb Exp $ */ +/* $OpenBSD: a_time_posix.c,v 1.6 2026/07/31 00:50:52 kenjiro Exp $ */ /* * Copyright (c) 2022, Google Inc. * Copyright (c) 2022, Bob Beck @@ -30,6 +30,7 @@ #include #include +#include "asn1_local.h" #include "crypto_internal.h" #define SECS_PER_HOUR (int64_t)(60 * 60) diff --git a/src/lib/libcrypto/asn1/a_time_tm.c b/src/lib/libcrypto/asn1/a_time_tm.c index dd2893167f..b5210641a6 100644 --- a/src/lib/libcrypto/asn1/a_time_tm.c +++ b/src/lib/libcrypto/asn1/a_time_tm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: a_time_tm.c,v 1.43 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: a_time_tm.c,v 1.44 2026/07/31 00:50:52 kenjiro Exp $ */ /* * Copyright (c) 2015 Bob Beck * @@ -26,6 +26,7 @@ #include "asn1_local.h" #include "bytestring.h" #include "err_local.h" +#include "x509_internal.h" #define RFC5280 0 #define GENTIME_LENGTH 15 diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c index ac8da0e61d..6d65dc9d68 100644 --- a/src/lib/libcrypto/asn1/asn1_lib.c +++ b/src/lib/libcrypto/asn1/asn1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_lib.c,v 1.54 2022/05/05 19:18:56 jsing Exp $ */ +/* $OpenBSD: asn1_lib.c,v 1.55 2026/07/31 00:50:52 kenjiro Exp $ */ /* * Copyright (c) 2021 Joel Sing * @@ -18,6 +18,7 @@ #include #include +#include "asn1_local.h" #include "bytestring.h" int diff --git a/src/lib/libcrypto/asn1/asn1_local.h b/src/lib/libcrypto/asn1/asn1_local.h index d61cfaa7b9..723c6574df 100644 --- a/src/lib/libcrypto/asn1/asn1_local.h +++ b/src/lib/libcrypto/asn1/asn1_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_local.h,v 1.11 2025/11/26 10:19:57 tb Exp $ */ +/* $OpenBSD: asn1_local.h,v 1.12 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -59,6 +59,8 @@ #ifndef HEADER_ASN1_LOCAL_H #define HEADER_ASN1_LOCAL_H +#include + #include "bytestring.h" __BEGIN_HIDDEN_DECLS diff --git a/src/lib/libcrypto/asn1/asn1_types.c b/src/lib/libcrypto/asn1/asn1_types.c index 5f9644a718..712c2297fb 100644 --- a/src/lib/libcrypto/asn1/asn1_types.c +++ b/src/lib/libcrypto/asn1/asn1_types.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_types.c,v 1.3 2023/07/05 21:23:36 beck Exp $ */ +/* $OpenBSD: asn1_types.c,v 1.4 2026/07/31 00:50:52 kenjiro Exp $ */ /* * Copyright (c) 2021 Joel Sing * @@ -19,6 +19,8 @@ #include +#include "asn1_local.h" + #define ASN1_ENCODING_CONSTRUCTED_ONLY 1 #define ASN1_ENCODING_PRIMITIVE_ONLY 2 diff --git a/src/lib/libcrypto/asn1/bio_asn1.c b/src/lib/libcrypto/asn1/bio_asn1.c index b9f54cd4ef..acd0f4f146 100644 --- a/src/lib/libcrypto/asn1/bio_asn1.c +++ b/src/lib/libcrypto/asn1/bio_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_asn1.c,v 1.23 2023/07/28 09:58:30 tb Exp $ */ +/* $OpenBSD: bio_asn1.c,v 1.24 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -67,6 +67,7 @@ #include #include +#include "asn1_local.h" #include "bio_local.h" #define BIO_C_SET_PREFIX 149 diff --git a/src/lib/libcrypto/asn1/tasn_typ.c b/src/lib/libcrypto/asn1/tasn_typ.c index 64faad7240..a30a06918d 100644 --- a/src/lib/libcrypto/asn1/tasn_typ.c +++ b/src/lib/libcrypto/asn1/tasn_typ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_typ.c,v 1.21 2025/08/22 14:07:34 tb Exp $ */ +/* $OpenBSD: tasn_typ.c,v 1.22 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -59,6 +59,8 @@ #include #include +#include "asn1_local.h" + /* Declarations for string types */ const ASN1_ITEM ASN1_NULL_it = { diff --git a/src/lib/libcrypto/asn1/tasn_utl.c b/src/lib/libcrypto/asn1/tasn_utl.c index 178a364c89..69b2187357 100644 --- a/src/lib/libcrypto/asn1/tasn_utl.c +++ b/src/lib/libcrypto/asn1/tasn_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_utl.c,v 1.19 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: tasn_utl.c,v 1.20 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -64,6 +64,7 @@ #include #include +#include "asn1_local.h" #include "bytestring.h" #include "err_local.h" diff --git a/src/lib/libcrypto/bn/bn_const.c b/src/lib/libcrypto/bn/bn_const.c index 389e95ca15..746e1f269a 100644 --- a/src/lib/libcrypto/bn/bn_const.c +++ b/src/lib/libcrypto/bn/bn_const.c @@ -1,8 +1,10 @@ -/* $OpenBSD: bn_const.c,v 1.9 2026/01/23 08:29:04 tb Exp $ */ +/* $OpenBSD: bn_const.c,v 1.10 2026/07/31 00:50:52 kenjiro Exp $ */ /* Insert boilerplate */ #include +#include "bn_local.h" + /* * "First Oakley Default Group" from RFC2409, section 6.1. * diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c index 6e697cc478..f90cf0f729 100644 --- a/src/lib/libcrypto/conf/conf_mod.c +++ b/src/lib/libcrypto/conf/conf_mod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf_mod.c,v 1.41 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: conf_mod.c,v 1.42 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Stephen Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -65,6 +65,7 @@ #include #include +#include "conf_local.h" #include "err_local.h" /* This structure contains data about supported modules. */ diff --git a/src/lib/libcrypto/ct/ct_x509v3.c b/src/lib/libcrypto/ct/ct_x509v3.c index b14ffc9532..c4cf9b823d 100644 --- a/src/lib/libcrypto/ct/ct_x509v3.c +++ b/src/lib/libcrypto/ct/ct_x509v3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ct_x509v3.c,v 1.7 2024/07/13 15:08:58 tb Exp $ */ +/* $OpenBSD: ct_x509v3.c,v 1.8 2026/07/31 00:50:52 kenjiro Exp $ */ /* * Written by Rob Stradling (rob@comodo.com) and Stephen Henson * (steve@openssl.org) for the OpenSSL project 2014. @@ -64,6 +64,7 @@ #include #include "ct_local.h" +#include "x509_local.h" static char * i2s_poison(const X509V3_EXT_METHOD *method, void *val) diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index ddc8adea1e..d1654d4041 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_ameth.c,v 1.74 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.75 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -73,6 +73,7 @@ #include "asn1_local.h" #include "bn_local.h" +#include "ec_local.h" #include "err_local.h" #include "evp_local.h" #include "x509_local.h" diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c index a60769fc2a..5bfdf66aee 100644 --- a/src/lib/libcrypto/err/err.c +++ b/src/lib/libcrypto/err/err.c @@ -1,4 +1,4 @@ -/* $OpenBSD: err.c,v 1.78 2025/06/10 08:53:37 tb Exp $ */ +/* $OpenBSD: err.c,v 1.79 2026/07/31 00:50:52 kenjiro Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -122,6 +122,9 @@ #include #include +#include "constant_time.h" +#include "err_local.h" + DECLARE_LHASH_OF(ERR_STRING_DATA); DECLARE_LHASH_OF(ERR_STATE); diff --git a/src/lib/libcrypto/pkcs12/p12_decr.c b/src/lib/libcrypto/pkcs12/p12_decr.c index 3090781eba..b4d8c4e7f8 100644 --- a/src/lib/libcrypto/pkcs12/p12_decr.c +++ b/src/lib/libcrypto/pkcs12/p12_decr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_decr.c,v 1.28 2026/01/27 14:03:01 tb Exp $ */ +/* $OpenBSD: p12_decr.c,v 1.29 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -63,6 +63,7 @@ #include "err_local.h" #include "evp_local.h" +#include "pkcs12_local.h" /* Encrypt/Decrypt a buffer based on password and algor, result in a * malloc'ed buffer diff --git a/src/lib/libcrypto/pkcs12/pkcs12_local.h b/src/lib/libcrypto/pkcs12/pkcs12_local.h index 4a3ce4b3f0..b076784d89 100644 --- a/src/lib/libcrypto/pkcs12/pkcs12_local.h +++ b/src/lib/libcrypto/pkcs12/pkcs12_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pkcs12_local.h,v 1.6 2025/03/09 15:45:52 tb Exp $ */ +/* $OpenBSD: pkcs12_local.h,v 1.7 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -59,6 +59,8 @@ #ifndef HEADER_PKCS12_LOCAL_H #define HEADER_PKCS12_LOCAL_H +#include + __BEGIN_HIDDEN_DECLS struct PKCS12_MAC_DATA_st { diff --git a/src/lib/libcrypto/pkcs7/pk7_doit.c b/src/lib/libcrypto/pkcs7/pk7_doit.c index c191329b56..0377c33cde 100644 --- a/src/lib/libcrypto/pkcs7/pk7_doit.c +++ b/src/lib/libcrypto/pkcs7/pk7_doit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pk7_doit.c,v 1.68 2026/04/26 04:19:11 tb Exp $ */ +/* $OpenBSD: pk7_doit.c,v 1.69 2026/07/31 00:50:52 kenjiro Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -66,6 +66,8 @@ #include "err_local.h" #include "evp_local.h" +/* XXX - for PKCS7_get_octet_string(), which belongs in pkcs7_local.h. */ +#include "pkcs12_local.h" #include "x509_local.h" static int diff --git a/src/lib/libcrypto/rsa/rsa_x931.c b/src/lib/libcrypto/rsa/rsa_x931.c index 8a0190d7fe..c4b4179f7b 100644 --- a/src/lib/libcrypto/rsa/rsa_x931.c +++ b/src/lib/libcrypto/rsa/rsa_x931.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rsa_x931.c,v 1.13 2025/05/10 05:54:38 tb Exp $ */ +/* $OpenBSD: rsa_x931.c,v 1.14 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2005. */ @@ -64,6 +64,7 @@ #include #include "err_local.h" +#include "rsa_local.h" int RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from, diff --git a/src/lib/libcrypto/x509/x509_ia5.c b/src/lib/libcrypto/x509/x509_ia5.c index b8886c6cb8..712ce5c702 100644 --- a/src/lib/libcrypto/x509/x509_ia5.c +++ b/src/lib/libcrypto/x509/x509_ia5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_ia5.c,v 1.3 2025/05/10 05:54:39 tb Exp $ */ +/* $OpenBSD: x509_ia5.c,v 1.4 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -64,6 +64,7 @@ #include #include "err_local.h" +#include "x509_local.h" static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5); static ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, diff --git a/src/lib/libcrypto/x509/x509_info.c b/src/lib/libcrypto/x509/x509_info.c index c91642a02e..4b2ee10d28 100644 --- a/src/lib/libcrypto/x509/x509_info.c +++ b/src/lib/libcrypto/x509/x509_info.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_info.c,v 1.6 2025/05/10 05:54:39 tb Exp $ */ +/* $OpenBSD: x509_info.c,v 1.7 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -65,6 +65,7 @@ #include #include "err_local.h" +#include "x509_local.h" static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS( X509V3_EXT_METHOD *method, AUTHORITY_INFO_ACCESS *ainfo, diff --git a/src/lib/libcrypto/x509/x509_int.c b/src/lib/libcrypto/x509/x509_int.c index 2236bfe4c4..76979f79b0 100644 --- a/src/lib/libcrypto/x509/x509_int.c +++ b/src/lib/libcrypto/x509/x509_int.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_int.c,v 1.2 2024/07/13 15:08:58 tb Exp $ */ +/* $OpenBSD: x509_int.c,v 1.3 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -60,6 +60,8 @@ #include +#include "x509_local.h" + static const X509V3_EXT_METHOD x509v3_ext_crl_number = { .ext_nid = NID_crl_number, .ext_flags = 0, diff --git a/src/lib/libcrypto/x509/x509_ocsp.c b/src/lib/libcrypto/x509/x509_ocsp.c index d0a0d49890..54a04ea8fa 100644 --- a/src/lib/libcrypto/x509/x509_ocsp.c +++ b/src/lib/libcrypto/x509/x509_ocsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_ocsp.c,v 1.5 2025/05/10 05:54:39 tb Exp $ */ +/* $OpenBSD: x509_ocsp.c,v 1.6 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -70,6 +70,7 @@ #include "err_local.h" #include "ocsp_local.h" +#include "x509_local.h" /* OCSP extensions and a couple of CRL entry extensions */ diff --git a/src/lib/libcrypto/x509/x509_pku.c b/src/lib/libcrypto/x509/x509_pku.c index 6753f0f733..75cf5e6763 100644 --- a/src/lib/libcrypto/x509/x509_pku.c +++ b/src/lib/libcrypto/x509/x509_pku.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_pku.c,v 1.5 2024/07/13 15:08:58 tb Exp $ */ +/* $OpenBSD: x509_pku.c,v 1.6 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -62,6 +62,8 @@ #include #include +#include "x509_local.h" + static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method, PKEY_USAGE_PERIOD *usage, BIO *out, int indent); diff --git a/src/lib/libcrypto/x509/x509_utl.c b/src/lib/libcrypto/x509/x509_utl.c index 2e60834edf..20c58dd8c5 100644 --- a/src/lib/libcrypto/x509/x509_utl.c +++ b/src/lib/libcrypto/x509/x509_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_utl.c,v 1.28 2026/01/12 22:08:34 tb Exp $ */ +/* $OpenBSD: x509_utl.c,v 1.29 2026/07/31 00:50:52 kenjiro Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -69,6 +69,7 @@ #include "bytestring.h" #include "conf_local.h" #include "err_local.h" +#include "x509_local.h" /* * Match reference identifiers starting with "." to any sub-domain. This -- cgit v1.2.3-55-g6feb