71 lines
2.4 KiB
Diff
71 lines
2.4 KiB
Diff
diff -rupN --no-dereference openssl-3.0.7-hobbled/include/openssl/crypto.h.in openssl-3.0.7-hobbled-new/include/openssl/crypto.h.in
|
|
--- openssl-3.0.7-hobbled/include/openssl/crypto.h.in 2022-11-01 15:14:36.000000000 +0100
|
|
+++ openssl-3.0.7-hobbled-new/include/openssl/crypto.h.in 2022-11-28 16:00:18.471832472 +0100
|
|
@@ -38,6 +38,7 @@ use OpenSSL::stackhash qw(generate_stack
|
|
# include <openssl/opensslconf.h>
|
|
# include <openssl/cryptoerr.h>
|
|
# include <openssl/core.h>
|
|
+# include <openssl/fips.h>
|
|
|
|
# ifdef CHARSET_EBCDIC
|
|
# include <openssl/ebcdic.h>
|
|
diff -rupN --no-dereference openssl-3.0.7-hobbled/include/openssl/fips.h openssl-3.0.7-hobbled-new/include/openssl/fips.h
|
|
--- openssl-3.0.7-hobbled/include/openssl/fips.h 1970-01-01 01:00:00.000000000 +0100
|
|
+++ openssl-3.0.7-hobbled-new/include/openssl/fips.h 2022-11-28 16:00:18.472832479 +0100
|
|
@@ -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 <openssl/macros.h>
|
|
+
|
|
+# 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.7-hobbled/test/property_test.c openssl-3.0.7-hobbled-new/test/property_test.c
|
|
--- openssl-3.0.7-hobbled/test/property_test.c 2022-11-01 15:14:36.000000000 +0100
|
|
+++ openssl-3.0.7-hobbled-new/test/property_test.c 2022-11-28 16:00:18.472832479 +0100
|
|
@@ -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;
|
|
}
|