Skip to content

Commit 687924a

Browse files
Add OpenSSL FIPS provider (#15153)
This adds a new package named openssl-fips-provider which will install the OpenSSL 3.1.2 FIPS provider and associated config file. This package has a mutual conflict with the SymCrypt-OpenSSL package. This change also updates the OpenSSL provider loading patch to allow loading one or the other of the FIPS-certified providers. Co-authored-by: Tobias Brick <tobiasb@microsoft.com>
1 parent ab626c9 commit 687924a

File tree

45 files changed

+6794
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6794
-39
lines changed

LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSES-AND-NOTICES/SPECS/data/licenses.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,6 +1076,7 @@
10761076
"opensm",
10771077
"opensp",
10781078
"openssl",
1079+
"openssl-fips-provider",
10791080
"openssl-ibmpkcs11",
10801081
"openssl-pkcs11",
10811082
"openwsman",
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
From c8978b7be6dbe388596fb899ab41a29e414ea5dc Mon Sep 17 00:00:00 2001
2+
From: Daniel Mihai <Daniel.Mihai@microsoft.com>
3+
Date: Wed, 28 Jul 2021 14:55:12 -0700
4+
Subject: [PATCH] Replacing deprecated functions with NULL or highest
5+
supported.
6+
7+
This is a workaround until OpenSSL issue #7048 is officially resolved.
8+
Issue link: https://github.com/openssl/openssl/issues/7048.
9+
10+
The main purpose of the change is to prevent breaking applications
11+
as they dynamically link to 'libssl.so' where APIs for some
12+
deprecated protocols are no longer present. With this change
13+
OpenSSL's build time configuration may skip the 'no-<prot>-method'
14+
switch, while still not supporting the deprecated protocols disabled
15+
through the 'no-<prot>' switch.
16+
17+
For deprecated DTLS protocol versions behind the scenes we're calling
18+
into 'DTLS_(client_|server_)?method()' set of methods, which
19+
automatically negotiate the highest supported protocol.
20+
21+
For SSLv3 methods we're returning a NULL pointer as there are no
22+
more supported methods for the SSL protocol.
23+
---
24+
ssl/methods.c | 18 +++++++++++++++---
25+
1 file changed, 15 insertions(+), 3 deletions(-)
26+
27+
diff --git a/ssl/methods.c b/ssl/methods.c
28+
index c846143277..a7ae074bfd 100644
29+
--- a/ssl/methods.c
30+
+++ b/ssl/methods.c
31+
@@ -215,17 +215,29 @@ const SSL_METHOD *TLSv1_client_method(void)
32+
# ifndef OPENSSL_NO_SSL3_METHOD
33+
const SSL_METHOD *SSLv3_method(void)
34+
{
35+
+# ifdef OPENSSL_NO_SSL3
36+
+ return NULL;
37+
+# else
38+
return sslv3_method();
39+
+# endif
40+
}
41+
42+
const SSL_METHOD *SSLv3_server_method(void)
43+
{
44+
+# ifdef OPENSSL_NO_SSL3
45+
+ return NULL;
46+
+# else
47+
return sslv3_server_method();
48+
+# endif
49+
}
50+
51+
const SSL_METHOD *SSLv3_client_method(void)
52+
{
53+
+# ifdef OPENSSL_NO_SSL3
54+
+ return NULL;
55+
+# else
56+
return sslv3_client_method();
57+
+# endif
58+
}
59+
# endif
60+
61+
@@ -249,17 +261,17 @@ const SSL_METHOD *DTLSv1_2_client_method(void)
62+
# ifndef OPENSSL_NO_DTLS1_METHOD
63+
const SSL_METHOD *DTLSv1_method(void)
64+
{
65+
- return dtlsv1_method();
66+
+ return DTLS_method();
67+
}
68+
69+
const SSL_METHOD *DTLSv1_server_method(void)
70+
{
71+
- return dtlsv1_server_method();
72+
+ return DTLS_server_method();
73+
}
74+
75+
const SSL_METHOD *DTLSv1_client_method(void)
76+
{
77+
- return dtlsv1_client_method();
78+
+ return DTLS_client_method();
79+
}
80+
# endif
81+
82+
--
83+
2.25.1
84+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
From 41df9ae215cee9574e17e6f887c96a7c97d588f5 Mon Sep 17 00:00:00 2001
2+
From: Tomas Mraz <tmraz@fedoraproject.org>
3+
Date: Thu, 24 Sep 2020 09:03:40 +0200
4+
Subject: Use more general default values in openssl.cnf
5+
6+
Also set sha256 as default hash, although that should not be
7+
necessary anymore.
8+
9+
(was openssl-1.1.1-defaults.patch)
10+
---
11+
apps/openssl.cnf | 12 +++++++-----
12+
1 file changed, 7 insertions(+), 5 deletions(-)
13+
14+
diff --git a/apps/openssl.cnf b/apps/openssl.cnf
15+
index 97567a67be..eb25a0ac48 100644
16+
--- a/apps/openssl.cnf
17+
+++ b/apps/openssl.cnf
18+
@@ -104,7 +104,7 @@ cert_opt = ca_default # Certificate field options
19+
20+
default_days = 365 # how long to certify for
21+
default_crl_days= 30 # how long before next CRL
22+
-default_md = default # use public key default MD
23+
+default_md = sha256 # use SHA-256 by default
24+
preserve = no # keep passed DN ordering
25+
26+
# A few difference way of specifying how similar the request should look
27+
@@ -136,6 +136,7 @@ emailAddress = optional
28+
####################################################################
29+
[ req ]
30+
default_bits = 2048
31+
+default_md = sha256
32+
default_keyfile = privkey.pem
33+
distinguished_name = req_distinguished_name
34+
attributes = req_attributes
35+
@@ -158,17 +159,18 @@ string_mask = utf8only
36+
37+
[ req_distinguished_name ]
38+
countryName = Country Name (2 letter code)
39+
-countryName_default = AU
40+
+countryName_default = XX
41+
countryName_min = 2
42+
countryName_max = 2
43+
44+
stateOrProvinceName = State or Province Name (full name)
45+
-stateOrProvinceName_default = Some-State
46+
+#stateOrProvinceName_default = Default Province
47+
48+
localityName = Locality Name (eg, city)
49+
+localityName_default = Default City
50+
51+
0.organizationName = Organization Name (eg, company)
52+
-0.organizationName_default = Internet Widgits Pty Ltd
53+
+0.organizationName_default = Default Company Ltd
54+
55+
# we can do this but it is not needed normally :-)
56+
#1.organizationName = Second Organization Name (eg, company)
57+
@@ -177,7 +179,7 @@ localityName = Locality Name (eg, city)
58+
organizationalUnitName = Organizational Unit Name (eg, section)
59+
#organizationalUnitName_default =
60+
61+
-commonName = Common Name (e.g. server FQDN or YOUR name)
62+
+commonName = Common Name (eg, your name or your server\'s hostname)
63+
commonName_max = 64
64+
65+
emailAddress = Email Address
66+
--
67+
2.26.2
68+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 3a175899a03d7d74ab5b6af0a0c056924afea04c Mon Sep 17 00:00:00 2001
2+
From: Tobias Brick <tobiasb@microsoft.com>
3+
Date: Wed, 17 Apr 2024 20:41:39 +0000
4+
Subject: [PATCH] Do not install html docs
5+
6+
---
7+
Configurations/unix-Makefile.tmpl | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
11+
index 17e194f..77e8b53 100644
12+
--- a/Configurations/unix-Makefile.tmpl
13+
+++ b/Configurations/unix-Makefile.tmpl
14+
@@ -611,7 +611,7 @@ install_sw: install_dev install_engines install_modules install_runtime
15+
16+
uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
17+
18+
-install_docs: install_man_docs install_html_docs
19+
+install_docs: install_man_docs ## Install manpages but not HTML documentation
20+
21+
uninstall_docs: uninstall_man_docs uninstall_html_docs
22+
$(RM) -r $(DESTDIR)$(DOCDIR)
23+
--
24+
2.45.4
25+
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
From 7a65ee33793fa8a28c0dfc94e6872ce92f408b15 Mon Sep 17 00:00:00 2001
2+
From: rpm-build <rpm-build>
3+
Date: Mon, 31 Jul 2023 09:41:27 +0200
4+
Subject: [PATCH 04/35]
5+
0004-Override-default-paths-for-the-CA-directory-tree.patch
6+
7+
Patch-name: 0004-Override-default-paths-for-the-CA-directory-tree.patch
8+
Patch-id: 4
9+
Patch-status: |
10+
# Override default paths for the CA directory tree
11+
From-dist-git-commit: 9409bc7044cf4b5773639cce20f51399888c45fd
12+
---
13+
apps/CA.pl.in | 2 +-
14+
apps/openssl.cnf | 13 +++++++++++--
15+
2 files changed, 12 insertions(+), 3 deletions(-)
16+
17+
diff --git a/apps/CA.pl.in b/apps/CA.pl.in
18+
index f029470005..729f104a7e 100644
19+
--- a/apps/CA.pl.in
20+
+++ b/apps/CA.pl.in
21+
@@ -29,7 +29,7 @@ my $X509 = "$openssl x509";
22+
my $PKCS12 = "$openssl pkcs12";
23+
24+
# Default values for various configuration settings.
25+
-my $CATOP = "./demoCA";
26+
+my $CATOP = "/etc/pki/CA";
27+
my $CAKEY = "cakey.pem";
28+
my $CAREQ = "careq.pem";
29+
my $CACERT = "cacert.pem";
30+
diff --git a/apps/openssl.cnf b/apps/openssl.cnf
31+
index 8141ab20cd..3956235fda 100644
32+
--- a/apps/openssl.cnf
33+
+++ b/apps/openssl.cnf
34+
@@ -52,6 +52,8 @@ tsa_policy3 = 1.2.3.4.5.7
35+
36+
[openssl_init]
37+
providers = provider_sect
38+
+# Load default TLS policy configuration
39+
+ssl_conf = ssl_module
40+
41+
# List of providers to load
42+
[provider_sect]
43+
@@ -71,6 +73,13 @@ default = default_sect
44+
[default_sect]
45+
# activate = 1
46+
47+
+[ ssl_module ]
48+
+
49+
+system_default = crypto_policy
50+
+
51+
+[ crypto_policy ]
52+
+
53+
+.include = /etc/crypto-policies/back-ends/opensslcnf.config
54+
55+
####################################################################
56+
[ ca ]
57+
@@ -79,7 +88,7 @@ default_ca = CA_default # The default ca section
58+
####################################################################
59+
[ CA_default ]
60+
61+
-dir = ./demoCA # Where everything is kept
62+
+dir = /etc/pki/CA # Where everything is kept
63+
certs = $dir/certs # Where the issued certs are kept
64+
crl_dir = $dir/crl # Where the issued crl are kept
65+
database = $dir/index.txt # database index file.
66+
@@ -311,7 +320,7 @@ default_tsa = tsa_config1 # the default TSA section
67+
[ tsa_config1 ]
68+
69+
# These are used by the TSA reply generation only.
70+
-dir = ./demoCA # TSA root directory
71+
+dir = /etc/pki/CA # TSA root directory
72+
serial = $dir/tsaserial # The current serial number (mandatory)
73+
crypto_device = builtin # OpenSSL engine to use for signing
74+
signer_cert = $dir/tsacert.pem # The TSA signing certificate
75+
--
76+
2.41.0
77+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 3d8fa9859501b07e02b76b5577e2915d5851e927 Mon Sep 17 00:00:00 2001
2+
From: Tomas Mraz <tmraz@fedoraproject.org>
3+
Date: Thu, 24 Sep 2020 09:27:18 +0200
4+
Subject: apps/ca: fix md option help text
5+
6+
upstreamable
7+
8+
(was openssl-1.1.1-apps-dgst.patch)
9+
---
10+
apps/ca.c | 2 +-
11+
1 file changed, 1 insertion(+), 1 deletion(-)
12+
13+
diff --git a/apps/ca.c b/apps/ca.c
14+
index 0f21b4fa1c..3d4b2c1673 100755
15+
--- a/apps/ca.c
16+
+++ b/apps/ca.c
17+
@@ -209,7 +209,7 @@ const OPTIONS ca_options[] = {
18+
{"noemailDN", OPT_NOEMAILDN, '-', "Don't add the EMAIL field to the DN"},
19+
20+
OPT_SECTION("Signing"),
21+
- {"md", OPT_MD, 's', "Digest to use, such as sha256"},
22+
+ {"md", OPT_MD, 's', "Digest to use, such as sha256; see openssl help for list"},
23+
{"keyfile", OPT_KEYFILE, 's', "The CA private key"},
24+
{"keyform", OPT_KEYFORM, 'f',
25+
"Private key file format (ENGINE, other values ignored)"},
26+
--
27+
2.26.2
28+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 3f9deff30ae6efbfe979043b00cdf649b39793c0 Mon Sep 17 00:00:00 2001
2+
From: Tomas Mraz <tmraz@fedoraproject.org>
3+
Date: Thu, 24 Sep 2020 09:51:34 +0200
4+
Subject: Disable signature verification with totally unsafe hash algorithms
5+
6+
(was openssl-1.1.1-no-weak-verify.patch)
7+
---
8+
crypto/asn1/a_verify.c | 5 +++++
9+
1 file changed, 5 insertions(+)
10+
11+
diff --git a/crypto/asn1/a_verify.c b/crypto/asn1/a_verify.c
12+
index b7eed914b0..af62f0ef08 100644
13+
--- a/crypto/asn1/a_verify.c
14+
+++ b/crypto/asn1/a_verify.c
15+
@@ -152,6 +152,11 @@ int ASN1_item_verify_ctx(const ASN1_ITEM *it, const X509_ALGOR *alg,
16+
ERR_raise(ERR_LIB_ASN1, ERR_R_EVP_LIB);
17+
if (ret <= 1)
18+
goto err;
19+
+ } else if ((mdnid == NID_md5
20+
+ && ossl_safe_getenv("OPENSSL_ENABLE_MD5_VERIFY") == NULL) ||
21+
+ mdnid == NID_md4 || mdnid == NID_md2 || mdnid == NID_sha) {
22+
+ ERR_raise(ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
23+
+ goto err;
24+
} else {
25+
const EVP_MD *type = NULL;
26+
27+
--
28+
2.26.2
29+

0 commit comments

Comments
 (0)