diff -rupN --no-dereference openssl-3.0.5/include/openssl/crypto.h.in openssl-3.0.5-new/include/openssl/crypto.h.in --- openssl-3.0.5/include/openssl/crypto.h.in 2022-07-05 10:57:04.000000000 +0200 +++ openssl-3.0.5-new/include/openssl/crypto.h.in 2022-07-08 10:09:53.638097973 +0200 @@ -38,6 +38,7 @@ use OpenSSL::stackhash qw(generate_stack # include # include # include +# include # ifdef CHARSET_EBCDIC # include diff -rupN --no-dereference openssl-3.0.5/include/openssl/fips.h openssl-3.0.5-new/include/openssl/fips.h --- openssl-3.0.5/include/openssl/fips.h 1970-01-01 01:00:00.000000000 +0100 +++ openssl-3.0.5-new/include/openssl/fips.h 2022-07-08 10:09:53.638097973 +0200 @@ -0,0 +1,25 @@ +/* + * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OPENSSL_FIPS_H +# define OPENSSL_FIPS_H +# pragma once + +# include + +# ifdef __cplusplus +extern "C" { +# endif + +# define FIPS_mode() EVP_default_properties_is_fips_enabled(NULL) + +# ifdef __cplusplus +} +# endif +#endif diff -rupN --no-dereference openssl-3.0.5/test/property_test.c openssl-3.0.5-new/test/property_test.c --- openssl-3.0.5/test/property_test.c 2022-07-05 10:57:04.000000000 +0200 +++ openssl-3.0.5-new/test/property_test.c 2022-07-08 10:09:53.638097973 +0200 @@ -624,6 +624,18 @@ static int test_property_list_to_string( return ret; } +static int test_downstream_FIPS_mode(void) +{ + int ret = 0; + + ret = TEST_true(EVP_set_default_properties(NULL, "fips=yes")) + && TEST_true(FIPS_mode()) + && TEST_true(EVP_set_default_properties(NULL, "fips=no")) + && TEST_false(FIPS_mode()); + + return ret; +} + int setup_tests(void) { ADD_TEST(test_property_string); @@ -637,6 +649,7 @@ int setup_tests(void) ADD_TEST(test_property); ADD_TEST(test_query_cache_stochastic); ADD_TEST(test_fips_mode); + ADD_TEST(test_downstream_FIPS_mode); ADD_ALL_TESTS(test_property_list_to_string, OSSL_NELEM(to_string_tests)); return 1; }