public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Schmidt <mschmidt@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mstflint] f43: use the system CA trust store instead of a private bundle
Date: Mon, 02 Nov 2026 23:40:01 GMT [thread overview]
Message-ID: <179366280190.1.144496711689354149.rpms-mstflint-176fa8a7d960@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/mstflint
Branch : f43
Commit : 176fa8a7d96044249b455f4b4a9ec169b2769af8
Author : Michal Schmidt <mschmidt@redhat.com>
Date : 2026-11-03T00:13:44+01:00
Stats : +258/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/mstflint/c/176fa8a7d96044249b455f4b4a9ec169b2769af8?branch=f43
Log:
use the system CA trust store instead of a private bundle
mstfwmanager verified TLS peers of www.mellanox.com against a private
copy of the Mozilla root store shipped as /etc/mstflint/ca-bundle.crt -
a July 2021 snapshot that still trusted roots since removed or
distrusted, including the ones involved in the eMudhra intermediate CA
compromise. Use libcurl's default CA bundle (the system trust store,
maintained by ca-certificates) instead and stop shipping the file.
--ssl-certificate still allows passing a custom CA bundle.
Backport of https://github.com/Mellanox/mstflint/pull/2090 (the second
patch is a cosmetic variable rename from the same PR).
Resolves: rhbz#2563465
Assisted-by: OpenCode:rits/zai-org/glm-5-3
(cherry picked from commit 80e422031d75a55a2ff6b8b3142265c3b09e573c)
---
diff --git a/0020-mlxfwupdate-use-the-system-trust-store-instead-of-a-.patch b/0020-mlxfwupdate-use-the-system-trust-store-instead-of-a-.patch
new file mode 100644
index 0000000..30da330
--- /dev/null
+++ b/0020-mlxfwupdate-use-the-system-trust-store-instead-of-a-.patch
@@ -0,0 +1,162 @@
+From 36558cedb727fc89f2405696df170b727e775bcf Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt@redhat.com>
+Date: Mon, 2 Nov 2026 17:59:15 +0100
+Subject: [PATCH 1/2] mlxfwupdate: use the system trust store instead of a
+ private CA bundle
+
+mstfwmanager verified the TLS peers of the online firmware
+query/download service (www.mellanox.com) against a private CA bundle
+installed to /etc/mstflint/ca-bundle.crt - a copy of the Mozilla root
+store that only changes when someone manually refreshes it as part of
+an mstflint release. It goes stale in between: the previous snapshot
+was from July 2021 and still trusted roots that have since been
+removed or distrusted, including the roots involved in the eMudhra
+intermediate CA compromise (Mellanox/mstflint#2075).
+
+The bundle has recently been refreshed on master_devel (df328a2759e0,
+"Refresh ca-bundle.crt to current Mozilla roots"), which addresses the
+currently known distrust issues. But this is only the third bundle
+update since 2017 (2017, 2021, 2026) - the copy inevitably goes stale
+for years at a time and every CA distrust event would require a new
+mstflint release to catch up.
+
+Rely on libcurl's default CA bundle, the system trust store maintained
+by the distribution (e.g. the ca-certificates package), which is
+updated independently of mstflint releases. --ssl-certificate can still
+be used to pass a custom CA bundle. On Windows the lookup of
+ca-bundle.crt next to the executable is unchanged.
+
+This also fixes the online features on FreeBSD, where the bundle is not
+packaged at all: it installs to the absolute path /etc/mstflint, which
+is outside the ports PREFIX, so mstfwmanager failed with "Can't find
+Certificate" unless --ssl-certificate was given. libcurl's default CA
+path there (/etc/ssl/certs, populated by certctl(8) and the ca_root_nss
+package) works out of the box. The FreeBSD behavior was deduced from
+the ports collection sources, not tested.
+
+Stop installing the bundle (the /etc/mstflint directory contained
+nothing else). No new runtime dependency is needed on distributions
+whose OpenSSL library already requires the CA certificates package
+(such as Fedora and RHEL); other distributions may want to add an
+explicit Requires for their CA certificates package instead.
+
+Assisted-by: OpenCode:rits/zai-org/glm-5-3
+---
+ man/mstfwmanager.md | 2 +-
+ mlxfwupdate/Makefile.am | 7 +++++--
+ mlxfwupdate/cmd_line_params.cpp | 5 ++++-
+ mlxfwupdate/mlxfwmanager.cpp | 5 ++++-
+ mlxfwupdate/server_request.cpp | 14 ++++++++++++--
+ mstflint.spec.in | 1 -
+ 6 files changed, 26 insertions(+), 8 deletions(-)
+
+diff --git a/man/mstfwmanager.md b/man/mstfwmanager.md
+index c64fc26287c6..b0c35de9d408 100644
+--- a/man/mstfwmanager.md
++++ b/man/mstfwmanager.md
+@@ -127,7 +127,7 @@ OPTIONS
+ : MFA | self\_extractor - default All
+
+ - **-\-ssl-certificate** Certificate
+- : SSL certificate For secure connection
++ : CA bundle for TLS peer verification, overriding the default system trust store
+
+ # EXAMPLES
+
+diff --git a/mlxfwupdate/Makefile.am b/mlxfwupdate/Makefile.am
+index a86a58afd1d7..43ee02e86e8e 100755
+--- a/mlxfwupdate/Makefile.am
++++ b/mlxfwupdate/Makefile.am
+@@ -30,8 +30,11 @@
+
+ # Makefile.am -- Process this file with automake to produce Makefile.in
+
+-docdir = $(INSTALL_BASEDIR)/etc/mstflint
+-dist_doc_DATA = certificate/ca-bundle.crt
++# Note: certificate/ca-bundle.crt is not installed anymore. mstfwmanager uses
++# libcurl's default CA bundle (the system trust store) unless --ssl-certificate
++# is given. The file is kept for Windows builds, which look for it next to the
++# executable.
++EXTRA_DIST = certificate/ca-bundle.crt
+
+ AM_CPPFLAGS = \
+ -I$(srcdir) \
+diff --git a/mlxfwupdate/cmd_line_params.cpp b/mlxfwupdate/cmd_line_params.cpp
+index d5bf37d05ade..b98a2f189ade 100644
+--- a/mlxfwupdate/cmd_line_params.cpp
++++ b/mlxfwupdate/cmd_line_params.cpp
+@@ -94,7 +94,10 @@ CmdLineParams::CmdLineParams()
+
+ #else
+ #ifdef MSTFLINT
+- certificate = (string)ROOT_PATH + "etc/mstflint/ca-bundle.crt";
++ // An empty certificate makes libcurl use its default CA bundle, which
++ // is the system trust store maintained by the distribution (e.g. the
++ // ca-certificates package). It can be overridden with --ssl-certificate.
++ certificate = "";
+ #else
+ certificate = (string)ROOT_PATH + "etc/mft/ca-bundle.crt";
+ #endif
+diff --git a/mlxfwupdate/mlxfwmanager.cpp b/mlxfwupdate/mlxfwmanager.cpp
+index 2de01b216148..da92ad38348b 100644
+--- a/mlxfwupdate/mlxfwmanager.cpp
++++ b/mlxfwupdate/mlxfwmanager.cpp
+@@ -1371,7 +1371,10 @@ bool checkCmdParams(CmdLineParams& cmd_params, config_t& config)
+ return false;
+ }
+ }
+- if (cmd_params.onlineQueryPsids.length() || cmd_params.download || cmd_params.update_online)
++ // An empty certificate means libcurl's default CA bundle (the system
++ // trust store) is used - there is nothing to validate then.
++ if (!cmd_params.certificate.empty() &&
++ (cmd_params.onlineQueryPsids.length() || cmd_params.download || cmd_params.update_online))
+ {
+ cmd_params.certificate = adjustRelPath(cmd_params.certificate, config.adjuster_path);
+ Filesystem::path p(cmd_params.certificate);
+diff --git a/mlxfwupdate/server_request.cpp b/mlxfwupdate/server_request.cpp
+index 9ab439053894..66ca601a1418 100644
+--- a/mlxfwupdate/server_request.cpp
++++ b/mlxfwupdate/server_request.cpp
+@@ -494,7 +494,12 @@ int ServerRequest::curl_request(const char* url, const char* data, const char* d
+ curl_easy_setopt(_curl, CURLOPT_URL, url);
+ curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, write_data);
+ curl_easy_setopt(_curl, CURLOPT_WRITEDATA, fp);
+- curl_easy_setopt(_curl, CURLOPT_CAINFO, _ceritifcate.c_str());
++ if (!_ceritifcate.empty())
++ {
++ // Use the CA bundle given via --ssl-certificate. Otherwise fall back
++ // to libcurl's default CA bundle (the system trust store).
++ curl_easy_setopt(_curl, CURLOPT_CAINFO, _ceritifcate.c_str());
++ }
+ if (_show_progress)
+ {
+ // Internal CURL progressmeter must be disabled if we provide our own callback
+@@ -592,7 +597,12 @@ int ServerRequest::curl_request_str(const char* url, const char* data, string& r
+ curl_easy_setopt(_curl, CURLOPT_URL, url);
+ curl_easy_setopt(_curl, CURLOPT_WRITEDATA, &response);
+ curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, writebuf_data);
+- curl_easy_setopt(_curl, CURLOPT_CAINFO, _ceritifcate.c_str());
++ if (!_ceritifcate.empty())
++ {
++ // Use the CA bundle given via --ssl-certificate. Otherwise fall back
++ // to libcurl's default CA bundle (the system trust store).
++ curl_easy_setopt(_curl, CURLOPT_CAINFO, _ceritifcate.c_str());
++ }
+
+ _headers = curl_slist_append(_headers, "Accept: application/json");
+ _headers = curl_slist_append(_headers, "Content-Type: application/json");
+diff --git a/mstflint.spec.in b/mstflint.spec.in
+index 7c173a07b1cc..0d290caccae0 100644
+--- a/mstflint.spec.in
++++ b/mstflint.spec.in
+@@ -203,7 +203,6 @@ rm -rf $RPM_BUILD_ROOT
+ %if %{enablefwmgr}
+ %{_bindir}/mstfwmanager
+ %{_bindir}/mstarchive
+-%{CONF_DIR}/ca-bundle.crt
+ %endif
+ %if %{enabledpa}
+ %{_bindir}/mstdpa
+--
+2.56.0
+
diff --git a/0021-mlxfwupdate-rename-_ceritifcate-to-_caBundlePath.patch b/0021-mlxfwupdate-rename-_ceritifcate-to-_caBundlePath.patch
new file mode 100644
index 0000000..31af813
--- /dev/null
+++ b/0021-mlxfwupdate-rename-_ceritifcate-to-_caBundlePath.patch
@@ -0,0 +1,92 @@
+From 928cb31a457e0d98ae544be8aac3582b806cb3b6 Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt@redhat.com>
+Date: Mon, 2 Nov 2026 18:40:31 +0100
+Subject: [PATCH 2/2] mlxfwupdate: rename _ceritifcate to _caBundlePath
+
+The ServerRequest member holds the path to a CA bundle file that is
+passed to libcurl as CURLOPT_CAINFO for TLS peer verification. The old
+name was misspelled and also inaccurate - it is not a certificate, but
+a path to a bundle of CA certificates. Rename it, and the constructor
+parameter it is initialized from, accordingly.
+
+Assisted-by: OpenCode:rits/zai-org/glm-5-3
+---
+ mlxfwupdate/server_request.cpp | 12 ++++++------
+ mlxfwupdate/server_request.h | 4 ++--
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/mlxfwupdate/server_request.cpp b/mlxfwupdate/server_request.cpp
+index 66ca601a1418..23d2ebb5e09b 100644
+--- a/mlxfwupdate/server_request.cpp
++++ b/mlxfwupdate/server_request.cpp
+@@ -55,7 +55,7 @@ ServerRequest::ServerRequest(const char* url,
+ int compare_ffv,
+ bool show_progress,
+ string key,
+- string certificate,
++ string caBundlePath,
+ unsigned int numberOfRetrials) :
+ _LastErrorNo(0)
+ {
+@@ -64,7 +64,7 @@ ServerRequest::ServerRequest(const char* url,
+ _WebService = _Url + "/downloads/firmware/mlx_fw_online_query.php";
+ _compare_ffv = compare_ffv;
+ _show_progress = show_progress;
+- _ceritifcate = certificate;
++ _caBundlePath = caBundlePath;
+ _numberOfRetrials = numberOfRetrials;
+ _headers = NULL;
+ if (proxy != NULL)
+@@ -494,11 +494,11 @@ int ServerRequest::curl_request(const char* url, const char* data, const char* d
+ curl_easy_setopt(_curl, CURLOPT_URL, url);
+ curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, write_data);
+ curl_easy_setopt(_curl, CURLOPT_WRITEDATA, fp);
+- if (!_ceritifcate.empty())
++ if (!_caBundlePath.empty())
+ {
+ // Use the CA bundle given via --ssl-certificate. Otherwise fall back
+ // to libcurl's default CA bundle (the system trust store).
+- curl_easy_setopt(_curl, CURLOPT_CAINFO, _ceritifcate.c_str());
++ curl_easy_setopt(_curl, CURLOPT_CAINFO, _caBundlePath.c_str());
+ }
+ if (_show_progress)
+ {
+@@ -597,11 +597,11 @@ int ServerRequest::curl_request_str(const char* url, const char* data, string& r
+ curl_easy_setopt(_curl, CURLOPT_URL, url);
+ curl_easy_setopt(_curl, CURLOPT_WRITEDATA, &response);
+ curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, writebuf_data);
+- if (!_ceritifcate.empty())
++ if (!_caBundlePath.empty())
+ {
+ // Use the CA bundle given via --ssl-certificate. Otherwise fall back
+ // to libcurl's default CA bundle (the system trust store).
+- curl_easy_setopt(_curl, CURLOPT_CAINFO, _ceritifcate.c_str());
++ curl_easy_setopt(_curl, CURLOPT_CAINFO, _caBundlePath.c_str());
+ }
+
+ _headers = curl_slist_append(_headers, "Accept: application/json");
+diff --git a/mlxfwupdate/server_request.h b/mlxfwupdate/server_request.h
+index 3b443e31855f..970345a70e40 100644
+--- a/mlxfwupdate/server_request.h
++++ b/mlxfwupdate/server_request.h
+@@ -76,7 +76,7 @@ public:
+ int compare_ffv,
+ bool show_progress,
+ string key,
+- string certificate,
++ string caBundlePath,
+ unsigned int numberOfRetrials);
+ ~ServerRequest();
+ int updateMFAsRequest(vector<string>& psid_list,
+@@ -112,7 +112,7 @@ private:
+ int _compare_ffv;
+ bool _show_progress;
+ string _key;
+- string _ceritifcate;
++ string _caBundlePath;
+ unsigned int _numberOfRetrials;
+ #ifdef USE_CURL
+ static CURL* _curl;
+--
+2.56.0
+
diff --git a/mstflint.spec b/mstflint.spec
index 55ed2cd..67e2054 100644
--- a/mstflint.spec
+++ b/mstflint.spec
@@ -75,6 +75,10 @@ Requires: python3
# fix build with system libraries, https://github.com/Mellanox/mstflint/pull/1848
0010-mlxconfig-don-t-include-sqlite3.h-via-hardcoded-ext_.patch
0011-configure.ac-use-pkg-config-to-detect-libraries.patch
+# use the system CA trust store instead of a private stale bundle
+# https://github.com/Mellanox/mstflint/pull/2090
+0020-mlxfwupdate-use-the-system-trust-store-instead-of-a-.patch
+0021-mlxfwupdate-rename-_ceritifcate-to-_caBundlePath.patch
%description
This package contains firmware update tool, vpd dump and register dump tools
@@ -114,7 +118,6 @@ chmod +x %{buildroot}/%{_libdir}/mstflint/{python_tools,sdk}/*.so
%files
%doc README
%_bindir/*
-%{_sysconfdir}/mstflint
%{_libdir}/mstflint
%{_datadir}/mstflint
reply other threads:[~2026-11-02 23:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179366280190.1.144496711689354149.rpms-mstflint-176fa8a7d960@fedoraproject.org \
--to=mschmidt@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox