Skip to content

Commit df800a5

Browse files
committed
Changed all rhel-based packages to use vendored openssl
Previous issues with libpam modules linking to a different openssl version/api are no longer an issue. Ticket: ENT-13750 Changelog: title (cherry picked from commit 0e1f4e3) Conflicts: README.md ci/cfengine-build-host-setup.cf ci/fix-buildhost.sh Adjusted as needed ^^^
1 parent fefe30c commit df800a5

9 files changed

Lines changed: 5 additions & 72 deletions

File tree

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ File `install-dependencies` and the relevant subdirectories in `deps-packaging`
139139
| [libyaml](https://pyyaml.org/wiki/LibYAML) | 0.2.5 | 0.2.5 | 0.2.5 | |
140140
| [LMDB](https://github.com/LMDB/lmdb/) | 0.9.33 | 0.9.33 | 0.9.33 | |
141141
| [OpenLDAP](https://www.openldap.org/software/download/OpenLDAP/openldap-release/) | 2.6.10 | 2.6.10 | 2.6.10 | Enterprise agent only |
142-
| [OpenSSL](https://openssl.org/) | 3.0.18 | 3.6.0 | 3.6.0 | See **note** below |
142+
| [OpenSSL](https://openssl.org/) | 3.0.18 | 3.6.0 | 3.6.0 | |
143143
| [PCRE](https://www.pcre.org/) | 8.45 | - | - | |
144144
| [PCRE2](https://github.com/PCRE2Project/pcre2/releases/) | - | 10.47 | 10.47 | |
145145
| [pthreads-w32](https://sourceware.org/pub/pthreads-win32/) | 2-9-1 | 2-9-1 | 2-9-1 | Windows Enterprise agent |
@@ -148,8 +148,6 @@ File `install-dependencies` and the relevant subdirectories in `deps-packaging`
148148
| [librsync](https://github.com/librsync/librsync/releases) | - | - | 2.3.4 | |
149149
| [leech](https://github.com/larsewi/leech/releases) | - | - | 0.2.0 | |
150150

151-
**Note:** We don't package OpenSSL for RHEL >= 8 and SuSE >= 15.
152-
We use the systems bundled SSL for these platforms.
153151

154152
### Enterprise Hub dependencies
155153

build-scripts/compile-options

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export PROJECT
3232
# It's a flag: if it's set to 1 - then we use system OpenSSL.
3333
# Otherwise, we build it.
3434
if [ -z "$SYSTEM_SSL" ]; then
35-
# We don't bundle OpenSSL on some redhat-derived systems due to incompatability with libpam and our openssl.
36-
if [ "$OS" = "rhel" ] && [ "$OS_VERSION_MAJOR" -ge "8" ]; then
37-
SYSTEM_SSL=1
38-
fi
3935
if [ "$OS" = "opensuse" ] || [ "$OS" = "sles" ]; then
4036
if [ "$OS_VERSION_MAJOR" -ge "15" ]; then
4137
SYSTEM_SSL=1
@@ -126,7 +122,6 @@ solaris | aix)
126122
;;
127123
esac
128124

129-
# We use system bundled SSL on RHEL >= 8
130125
if [ "$SYSTEM_SSL" != 1 ]; then
131126
# zlib is a compression library which is a dependency of OpenSSL.
132127
# TODO: can we remove zlib dependency? (CFE-4013)

build-scripts/package

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,6 @@ rpm | lpp)
195195
exit 1
196196
fi
197197
log_debug "SELinux policy version: $SELINUX_POLICY_VERSION"
198-
# Get OpenSSL version to ensure compatibility
199-
OPENSSL_VERSION=$(rpm -q --provides openssl-libs | grep OPENSSL_ | sed 's/^.*_\([0-9.]*\).*$/\1/' | sort -n | tail -1)
200-
if [ -z "$OPENSSL_VERSION" ]; then
201-
log_error "Unable to determine OpenSSL package version"
202-
exit 1
203-
fi
204-
log_debug "OpenSSL version: $OPENSSL_VERSION"
205198
fi
206199

207200
# Generate RPM spec file from template, substituting version info and scripts
@@ -210,7 +203,6 @@ rpm | lpp)
210203
-e "s/@@VERSION@@/$RPM_VERSION/g" \
211204
-e "s/@@RELEASE@@/$safe_prefix$RPM_RELEASE/g" \
212205
-e "s/@@SELINUX_POLICY_VERSION@@/$SELINUX_POLICY_VERSION/g" \
213-
-e "s/@@OPENSSL_VERSION@@/$OPENSSL_VERSION/g" \
214206
-e "/^%pre\$/r $PREINSTALL" \
215207
-e "/^%post\$/r $POSTINSTALL" \
216208
-e "/^%preun\$/r $PREREMOVE" \

ci/fix-buildhost.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ if [ "$(uname)" = "HP-UX" ] || [ "$(uname)" = "SunOS" ]; then
1515
fi
1616
fi
1717

18-
# while ENT-13750 is in progress we need to ensure that OTHER builds include openssl devel packages on redhat-based platforms
18+
# ENT-13750 we return to vendored openssl on rpm platforms so remove possibly installed development packages
1919
if command -v zypper >/dev/null 2>/dev/null; then
20-
sudo zypper install -y libopenssl-devel || true
20+
sudo zypper remove -y libopenssl-devel || true
2121
fi
2222
if command -v yum >/dev/null 2>/dev/null; then
23-
sudo yum install -y openssl-devel || true
23+
sudo yum erase -y openssl-devel || true
2424
fi

deps-packaging/libcurl-hub/cfbuild-libcurl-hub.spec

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@ AutoReqProv: no
1818
mkdir -p %{_builddir}
1919
%setup -q -n curl-%{curl_version}
2020

21-
# we don't bundle OpenSSL on RHEL 8 (and newer in the future)
22-
%if %{?rhel}%{!?rhel:0} > 7
23-
%define ssl_prefix /usr
24-
%else
2521
%define ssl_prefix %{prefix}
26-
%endif
2722

2823
./configure \
2924
--with-sysroot=%{prefix} \

deps-packaging/libcurl/cfbuild-libcurl.spec

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ AutoReqProv: no
1818
mkdir -p %{_builddir}
1919
%setup -q -n curl-%{curl_version}
2020

21-
# we don't bundle OpenSSL on RHEL 8 & SUSE 15 (and newer in the future)
22-
%if %{?rhel}%{!?rhel:0} > 7 || %{?suse_version}%{!?suse_version:0} >= 1500
21+
%if 0%{?SYSTEM_SSL}
2322
%define ssl_prefix /usr
2423
%else
2524
%define ssl_prefix %{prefix}

deps-packaging/openldap/cfbuild-openldap.spec

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ mkdir -p %{_builddir}
2121

2222
%patch0 -p0
2323

24-
# we don't bundle OpenSSL on RHEL 8 (and newer in the future)
25-
%if %{?rhel}%{!?rhel:0} > 7
26-
CPPFLAGS=-I%{buildprefix}/include:/usr/include
27-
%else
2824
CPPFLAGS=-I%{buildprefix}/include
29-
%endif
3025

3126
#
3227
# glibc-2.8 errorneously hides peercred(3) under #ifdef __USE_GNU.

packaging/cfengine-nova-hub/cfengine-nova-hub.spec.in

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,6 @@ Requires(post): /usr/sbin/usermod, /bin/sed
3131
Requires: selinux-policy >= @@SELINUX_POLICY_VERSION@@
3232
%endif
3333

34-
# we don't bundle OpenSSL on RHEL 8 (and newer in the future)
35-
%if %{?rhel}%{!?rhel:0} == 8
36-
Requires: libssl.so.1.1()(64bit) libssl.so.1.1(OPENSSL_1_1_0)(64bit) libssl.so.1.1(OPENSSL_1_1_1)(64bit)
37-
Requires: libcrypto.so.1.1()(64bit) libcrypto.so.1.1(OPENSSL_1_1_0)(64bit)
38-
Requires: openssl
39-
%endif
40-
41-
# We build against systems with the latest available dependencies such as OpenSSL.
42-
# We use rpm -q --provides to determine the highest API present in OpenSSL and then use that as a Requires.
43-
# OPENSSL_VERSION is determined in build-scripts/package script.
44-
# This should ensure that when packages are installed with yum/dnf any required OpenSSL package upgrades will be performed or the installation will fail.
45-
%if %{?rhel}%{!?rhel:0} > 8
46-
Requires: libcrypto.so.3()(64bit) libcrypto.so.3(OPENSSL_@@OPENSSL_VERSION@@)(64bit)
47-
Requires: libssl.so.3()(64bit) libssl.so.3(OPENSSL_@@OPENSSL_VERSION@@)(64bit)
48-
Requires: openssl
49-
%endif
50-
5134
# cfbs/Build requires Python 3.5+ (not available on RHEL 6)
5235
%if %{?rhel}%{!?rhel:0} == 7
5336
Requires: python3 >= 3.5
@@ -106,10 +89,6 @@ rm -f %{prefix}/ssl/misc/tsget
10689
rm -f %{prefix}/ssl/openssl.cnf.dist
10790
rm -f %{prefix}/ssl/misc/tsget.pl
10891

109-
# Add an openssl symlink if openssl binary doesn't exist
110-
if ! [ -f $RPM_BUILD_ROOT%{prefix}/bin/openssl ]; then
111-
ln -s `which openssl` $RPM_BUILD_ROOT%{prefix}/bin/openssl
112-
fi
11392

11493
# Hub does not need cf-upgrade, it is only present in host packages
11594
rm -f $RPM_BUILD_ROOT%{prefix}/bin/cf-upgrade
@@ -253,16 +232,11 @@ exit 0
253232
# init.d script enterprise part
254233
%{prefix}/bin/cfengine3-nova-hub-init-d.sh
255234

256-
# OpenSSL tools (we don't bundle OpenSSL on RHEL 8)
257-
# Note that prefix/bin/openssl is outside of `if`, since
258-
# on RHEL8 it's a symlink to a system-wide openssl binary
259235
%{prefix}/bin/openssl
260-
%if %{?rhel}%{!?rhel:0} <= 7
261236
%dir %{prefix}/ssl
262237
%{prefix}/ssl/openssl.cnf
263238
%{prefix}/ssl/ct_log_list.cnf
264239
%{prefix}/ssl/ct_log_list.cnf.dist
265-
%endif
266240

267241
%prefix/bin/git
268242
%prefix/bin/gitk

packaging/cfengine-nova/cfengine-nova.spec.in

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,6 @@ Recommends: gzip
2323
Requires: selinux-policy >= @@SELINUX_POLICY_VERSION@@
2424
%endif
2525

26-
# We don't bundle OpenSSL on RHEL >= 8 and SuSE >= 15
27-
%if 0%{?SYSTEM_SSL}
28-
Requires: libssl.so.1.1()(64bit) libssl.so.1.1(OPENSSL_1_1_0)(64bit) libssl.so.1.1(OPENSSL_1_1_1)(64bit)
29-
Requires: libcrypto.so.1.1()(64bit) libcrypto.so.1.1(OPENSSL_1_1_0)(64bit)
30-
%endif
31-
32-
# We build against systems with the latest available dependencies such as OpenSSL.
33-
# We use rpm -q --provides to determine the highest API present in OpenSSL and then use that as a Requires.
34-
# OPENSSL_VERSION is determined in build-scripts/package script.
35-
# This should ensure that when packages are installed with yum/dnf any required OpenSSL package upgrades will be performed or the installation will fail.
36-
%if %{?rhel}%{!?rhel:0} > 8
37-
Requires: libcrypto.so.3()(64bit) libcrypto.so.3(OPENSSL_@@OPENSSL_VERSION@@)(64bit)
38-
Requires: libssl.so.3()(64bit) libssl.so.3(OPENSSL_@@OPENSSL_VERSION@@)(64bit)
39-
%endif
40-
4126
AutoReqProv: no
4227

4328
%if %{?with_debugsym}%{!?with_debugsym:0}

0 commit comments

Comments
 (0)