diff --git a/crypto/s2n_drbg.c b/crypto/s2n_drbg.c index 99e4c682e2d..869591b6671 100644 --- a/crypto/s2n_drbg.c +++ b/crypto/s2n_drbg.c @@ -18,6 +18,7 @@ #include #include +#include "crypto/s2n_openssl.h" #include "utils/s2n_blob.h" #include "utils/s2n_random.h" #include "utils/s2n_safety.h" diff --git a/crypto/s2n_ecdsa.c b/crypto/s2n_ecdsa.c index 36558f75345..cefd76af232 100644 --- a/crypto/s2n_ecdsa.c +++ b/crypto/s2n_ecdsa.c @@ -22,7 +22,6 @@ #include "crypto/s2n_ecc_evp.h" #include "crypto/s2n_evp_signing.h" #include "crypto/s2n_hash.h" -#include "crypto/s2n_openssl.h" #include "crypto/s2n_pkey.h" #include "error/s2n_errno.h" #include "stuffer/s2n_stuffer.h" diff --git a/crypto/s2n_fips.c b/crypto/s2n_fips.c index 85b03ca955e..fd2e03057ad 100644 --- a/crypto/s2n_fips.c +++ b/crypto/s2n_fips.c @@ -17,6 +17,8 @@ #include +#include "crypto/s2n_libcrypto.h" +#include "crypto/s2n_openssl.h" #include "utils/s2n_init.h" #include "utils/s2n_safety.h" diff --git a/crypto/s2n_hash.c b/crypto/s2n_hash.c index 8bd57ba563b..001c3bc547d 100644 --- a/crypto/s2n_hash.c +++ b/crypto/s2n_hash.c @@ -17,7 +17,6 @@ #include "crypto/s2n_fips.h" #include "crypto/s2n_hmac.h" -#include "crypto/s2n_openssl.h" #include "error/s2n_errno.h" #include "utils/s2n_safety.h" diff --git a/crypto/s2n_libcrypto.h b/crypto/s2n_libcrypto.h index c2232b9bead..2ac736a3ad4 100644 --- a/crypto/s2n_libcrypto.h +++ b/crypto/s2n_libcrypto.h @@ -17,7 +17,14 @@ #include "utils/s2n_result.h" +bool s2n_libcrypto_is_openssl(void); +bool s2n_libcrypto_is_openssl_fips(void); +bool s2n_libcrypto_is_awslc(void); +bool s2n_libcrypto_is_awslc_fips(void); +bool s2n_libcrypto_is_boringssl(void); +bool s2n_libcrypto_is_libressl(void); + uint64_t s2n_libcrypto_awslc_api_version(void); S2N_RESULT s2n_libcrypto_validate_runtime(void); const char *s2n_libcrypto_get_version_name(void); -bool s2n_libcrypto_supports_flag_no_check_time(); +bool s2n_libcrypto_supports_flag_no_check_time(void); diff --git a/crypto/s2n_openssl.h b/crypto/s2n_openssl.h index cd2763a8fe2..7d05bed132b 100644 --- a/crypto/s2n_openssl.h +++ b/crypto/s2n_openssl.h @@ -15,8 +15,6 @@ #pragma once -#include - /** * openssl with OPENSSL_VERSION_NUMBER < 0x10100003L made data type details unavailable * libressl use openssl with data type details available, but mandatorily set @@ -49,10 +47,3 @@ #define s2n_evp_ctx_init(ctx) EVP_CIPHER_CTX_init(ctx) #define RESULT_EVP_CTX_INIT(ctx) EVP_CIPHER_CTX_init(ctx) #endif - -bool s2n_libcrypto_is_openssl(void); -bool s2n_libcrypto_is_openssl_fips(void); -bool s2n_libcrypto_is_awslc(); -bool s2n_libcrypto_is_awslc_fips(void); -bool s2n_libcrypto_is_boringssl(); -bool s2n_libcrypto_is_libressl(); diff --git a/crypto/s2n_pq.c b/crypto/s2n_pq.c index cb9795311a3..d7bfc238a5e 100644 --- a/crypto/s2n_pq.c +++ b/crypto/s2n_pq.c @@ -15,8 +15,6 @@ #include "s2n_pq.h" -#include "crypto/s2n_openssl.h" - bool s2n_libcrypto_supports_evp_kem() { /* S2N_LIBCRYPTO_SUPPORTS_EVP_KEM will be auto-detected and #defined if diff --git a/crypto/s2n_rsa.c b/crypto/s2n_rsa.c index a89b59612b7..76cd277d6c9 100644 --- a/crypto/s2n_rsa.c +++ b/crypto/s2n_rsa.c @@ -22,6 +22,7 @@ #include "crypto/s2n_drbg.h" #include "crypto/s2n_evp_signing.h" #include "crypto/s2n_hash.h" +#include "crypto/s2n_openssl.h" #include "crypto/s2n_pkey.h" #include "crypto/s2n_rsa_signing.h" #include "error/s2n_errno.h" diff --git a/crypto/s2n_rsa_pss.c b/crypto/s2n_rsa_pss.c index e99da354473..528656d234c 100644 --- a/crypto/s2n_rsa_pss.c +++ b/crypto/s2n_rsa_pss.c @@ -21,7 +21,6 @@ #include "crypto/s2n_evp_signing.h" #include "crypto/s2n_hash.h" -#include "crypto/s2n_openssl.h" #include "crypto/s2n_pkey.h" #include "crypto/s2n_rsa.h" #include "crypto/s2n_rsa_signing.h" diff --git a/crypto/s2n_rsa_signing.h b/crypto/s2n_rsa_signing.h index dd56d7b576a..e9cc74c5609 100644 --- a/crypto/s2n_rsa_signing.h +++ b/crypto/s2n_rsa_signing.h @@ -16,7 +16,6 @@ #pragma once #include "api/s2n.h" -#include "crypto/s2n_openssl.h" #include "crypto/s2n_rsa.h" #include "utils/s2n_blob.h" diff --git a/tests/cbmc/include/cbmc_proof/make_common_datastructures.h b/tests/cbmc/include/cbmc_proof/make_common_datastructures.h index 1e310caa434..f60ee2b0401 100644 --- a/tests/cbmc/include/cbmc_proof/make_common_datastructures.h +++ b/tests/cbmc/include/cbmc_proof/make_common_datastructures.h @@ -23,6 +23,7 @@ #include "crypto/s2n_evp.h" #include "crypto/s2n_hash.h" #include "crypto/s2n_hmac.h" +#include "crypto/s2n_libcrypto.h" #include "stuffer/s2n_stuffer.h" #include "tls/s2n_config.h" #include "tls/s2n_connection.h" diff --git a/tests/cbmc/stubs/s2n_libcrypto_is_awslc.c b/tests/cbmc/stubs/s2n_libcrypto_is_awslc.c index 6e74ecf193f..216bea4dc45 100644 --- a/tests/cbmc/stubs/s2n_libcrypto_is_awslc.c +++ b/tests/cbmc/stubs/s2n_libcrypto_is_awslc.c @@ -16,7 +16,6 @@ #include #include -#include "crypto/s2n_openssl.h" static int flag = 0; static bool s2n_awslc_flag = 0; diff --git a/tests/unit/s2n_build_test.c b/tests/unit/s2n_build_test.c index 7c161e7b4dd..7a2355c7630 100644 --- a/tests/unit/s2n_build_test.c +++ b/tests/unit/s2n_build_test.c @@ -26,7 +26,7 @@ #include #include -#include "crypto/s2n_openssl.h" +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" #define MAX_LIBCRYPTO_NAME_LEN 100 diff --git a/tests/unit/s2n_cert_authorities_test.c b/tests/unit/s2n_cert_authorities_test.c index 1cae4570acb..79f46264c42 100644 --- a/tests/unit/s2n_cert_authorities_test.c +++ b/tests/unit/s2n_cert_authorities_test.c @@ -15,6 +15,7 @@ #include "tls/extensions/s2n_cert_authorities.h" +#include "crypto/s2n_libcrypto.h" #include "crypto/s2n_rsa_pss.h" #include "s2n_test.h" #include "testlib/s2n_testlib.h" diff --git a/tests/unit/s2n_config_test.c b/tests/unit/s2n_config_test.c index 03e97581efa..14776188967 100644 --- a/tests/unit/s2n_config_test.c +++ b/tests/unit/s2n_config_test.c @@ -20,6 +20,8 @@ #include "api/s2n.h" #include "crypto/s2n_fips.h" +#include "crypto/s2n_libcrypto.h" +#include "crypto/s2n_openssl.h" #include "crypto/s2n_pq.h" #include "s2n_test.h" #include "testlib/s2n_testlib.h" diff --git a/tests/unit/s2n_evp_signing_test.c b/tests/unit/s2n_evp_signing_test.c index 375be90afd0..0085ed8bd23 100644 --- a/tests/unit/s2n_evp_signing_test.c +++ b/tests/unit/s2n_evp_signing_test.c @@ -17,6 +17,7 @@ #include "crypto/s2n_ecdsa.h" #include "crypto/s2n_fips.h" +#include "crypto/s2n_libcrypto.h" #include "crypto/s2n_rsa_pss.h" #include "crypto/s2n_rsa_signing.h" #include "s2n_test.h" diff --git a/tests/unit/s2n_fips_test.c b/tests/unit/s2n_fips_test.c index 31274231d1b..37509855a31 100644 --- a/tests/unit/s2n_fips_test.c +++ b/tests/unit/s2n_fips_test.c @@ -16,6 +16,7 @@ #include "crypto/s2n_fips.h" #include "api/s2n.h" +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" int main() diff --git a/tests/unit/s2n_hash_test.c b/tests/unit/s2n_hash_test.c index 929108a2c40..1ee7aa10339 100644 --- a/tests/unit/s2n_hash_test.c +++ b/tests/unit/s2n_hash_test.c @@ -18,6 +18,7 @@ #include #include "crypto/s2n_fips.h" +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" #include "stuffer/s2n_stuffer.h" #include "testlib/s2n_testlib.h" diff --git a/tests/unit/s2n_hkdf_test.c b/tests/unit/s2n_hkdf_test.c index 0a095c5fe36..21418006c21 100644 --- a/tests/unit/s2n_hkdf_test.c +++ b/tests/unit/s2n_hkdf_test.c @@ -19,6 +19,7 @@ #include "crypto/s2n_fips.h" #include "crypto/s2n_hmac.h" +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" #include "stuffer/s2n_stuffer.h" #include "testlib/s2n_testlib.h" diff --git a/tests/unit/s2n_openssl_test.c b/tests/unit/s2n_libcrypto_test.c similarity index 98% rename from tests/unit/s2n_openssl_test.c rename to tests/unit/s2n_libcrypto_test.c index e2f8d61183d..a8e2962bbcb 100644 --- a/tests/unit/s2n_openssl_test.c +++ b/tests/unit/s2n_libcrypto_test.c @@ -13,7 +13,7 @@ * permissions and limitations under the License. */ -#include "crypto/s2n_openssl.h" +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" #include "utils/s2n_random.h" diff --git a/tests/unit/s2n_locking_test.c b/tests/unit/s2n_locking_test.c index 4ae66ed6114..88f4b558015 100644 --- a/tests/unit/s2n_locking_test.c +++ b/tests/unit/s2n_locking_test.c @@ -17,6 +17,7 @@ #include +#include "crypto/s2n_openssl.h" #include "s2n_test.h" #define LOCK_N 1 diff --git a/tests/unit/s2n_pq_mlkem_test.c b/tests/unit/s2n_pq_mlkem_test.c index 1bec449a960..7a43e9a837a 100644 --- a/tests/unit/s2n_pq_mlkem_test.c +++ b/tests/unit/s2n_pq_mlkem_test.c @@ -15,7 +15,6 @@ #include "api/s2n.h" #include "crypto/s2n_libcrypto.h" -#include "crypto/s2n_openssl.h" #include "crypto/s2n_pq.h" #include "s2n_test.h" #include "testlib/s2n_testlib.h" diff --git a/tests/unit/s2n_random_test.c b/tests/unit/s2n_random_test.c index 0fbbfb823e8..80577f485f4 100644 --- a/tests/unit/s2n_random_test.c +++ b/tests/unit/s2n_random_test.c @@ -32,6 +32,7 @@ #include "api/s2n.h" #include "crypto/s2n_fips.h" +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" #include "utils/s2n_fork_detection.h" diff --git a/tests/unit/s2n_tls13_secrets_rfc8448_test.c b/tests/unit/s2n_tls13_secrets_rfc8448_test.c index a98a3243563..f81e3e9cfc9 100644 --- a/tests/unit/s2n_tls13_secrets_rfc8448_test.c +++ b/tests/unit/s2n_tls13_secrets_rfc8448_test.c @@ -16,6 +16,7 @@ /* Needed to set up X25519 key shares */ #include +#include "crypto/s2n_openssl.h" #include "s2n_test.h" #include "testlib/s2n_testlib.h" #include "tls/s2n_cipher_suites.h" diff --git a/tests/unit/s2n_tls_prf_test.c b/tests/unit/s2n_tls_prf_test.c index 7c1ce076b8c..faca2f3b543 100644 --- a/tests/unit/s2n_tls_prf_test.c +++ b/tests/unit/s2n_tls_prf_test.c @@ -17,7 +17,7 @@ #include #include "api/s2n.h" -#include "crypto/s2n_openssl.h" +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" #include "stuffer/s2n_stuffer.h" #include "testlib/s2n_testlib.h" diff --git a/tests/unit/s2n_x509_validator_certificate_signatures_test.c b/tests/unit/s2n_x509_validator_certificate_signatures_test.c index 06bbf4f8093..f5c3309e710 100644 --- a/tests/unit/s2n_x509_validator_certificate_signatures_test.c +++ b/tests/unit/s2n_x509_validator_certificate_signatures_test.c @@ -19,7 +19,6 @@ #include #include "api/s2n.h" -#include "crypto/s2n_openssl.h" #include "crypto/s2n_openssl_x509.h" #include "error/s2n_errno.h" #include "s2n_test.h" diff --git a/tests/unit/s2n_x509_validator_test.c b/tests/unit/s2n_x509_validator_test.c index 9439abd99f5..3da8d8a5805 100644 --- a/tests/unit/s2n_x509_validator_test.c +++ b/tests/unit/s2n_x509_validator_test.c @@ -13,6 +13,8 @@ * permissions and limitations under the License. */ +#include "crypto/s2n_libcrypto.h" +#include "crypto/s2n_openssl.h" #include "crypto/s2n_openssl_x509.h" #include "s2n_test.h" #include "testlib/s2n_testlib.h" diff --git a/tests/unit/s2n_x509_validator_time_verification_test.c b/tests/unit/s2n_x509_validator_time_verification_test.c index e5bf7317447..fd9d0ded442 100644 --- a/tests/unit/s2n_x509_validator_time_verification_test.c +++ b/tests/unit/s2n_x509_validator_time_verification_test.c @@ -13,6 +13,7 @@ * permissions and limitations under the License. */ +#include "crypto/s2n_libcrypto.h" #include "s2n_test.h" #include "testlib/s2n_testlib.h" diff --git a/tls/s2n_prf.c b/tls/s2n_prf.c index 168cd06379e..763c8058f2e 100644 --- a/tls/s2n_prf.c +++ b/tls/s2n_prf.c @@ -24,7 +24,6 @@ #include "crypto/s2n_fips.h" #include "crypto/s2n_hash.h" #include "crypto/s2n_hmac.h" -#include "crypto/s2n_openssl.h" #include "error/s2n_errno.h" #include "stuffer/s2n_stuffer.h" #include "tls/s2n_cipher_suites.h" diff --git a/tls/s2n_prf.h b/tls/s2n_prf.h index 2db2db5e2e3..4b3b99d3702 100644 --- a/tls/s2n_prf.h +++ b/tls/s2n_prf.h @@ -19,7 +19,6 @@ #include "crypto/s2n_hash.h" #include "crypto/s2n_hmac.h" -#include "crypto/s2n_openssl.h" #include "utils/s2n_blob.h" /* Enough to support TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, 2*SHA384_DIGEST_LEN + 2*AES256_KEY_SIZE */ diff --git a/tls/s2n_x509_validator.c b/tls/s2n_x509_validator.c index 4de3c03b1ff..ad9ac61a3fd 100644 --- a/tls/s2n_x509_validator.c +++ b/tls/s2n_x509_validator.c @@ -20,7 +20,6 @@ #include #include "crypto/s2n_libcrypto.h" -#include "crypto/s2n_openssl.h" #include "crypto/s2n_openssl_x509.h" #include "crypto/s2n_pkey.h" #include "tls/extensions/s2n_extension_list.h" diff --git a/utils/s2n_random.c b/utils/s2n_random.c index bb7280f74dd..bcb69ec6f81 100644 --- a/utils/s2n_random.c +++ b/utils/s2n_random.c @@ -71,6 +71,7 @@ #include "api/s2n.h" #include "crypto/s2n_drbg.h" #include "crypto/s2n_fips.h" +#include "crypto/s2n_libcrypto.h" #include "error/s2n_errno.h" #include "s2n_io.h" #include "stuffer/s2n_stuffer.h"