public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/qdigidoc] main: OpenSSL 4 build fixes
@ 2026-10-14 17:35 Dmitri Smirnov
  0 siblings, 0 replies; only message in thread
From: Dmitri Smirnov @ 2026-10-14 17:35 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/qdigidoc
Branch : main
Commit : e746817275c57d5a2bcf868a4206669f50fcfcfe
Author : Dmitri Smirnov <dmitri@smirnov.ee>
Date   : 2026-10-14T19:34:52+02:00
Stats  : +51/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/qdigidoc/c/e746817275c57d5a2bcf868a4206669f50fcfcfe?branch=main

Log:
OpenSSL 4 build fixes

---
diff --git a/openssl4-compat.patch b/openssl4-compat.patch
new file mode 100644
index 0000000..e0da7ec
--- /dev/null
+++ b/openssl4-compat.patch
@@ -0,0 +1,45 @@
+Subject: [PATCH] Fix certificate access with OpenSSL 4
+
+OpenSSL 4 returns const pointers from X509_get_subject_name and
+X509_NAME_get_entry. These objects are only read here; const pointers
+also work with OpenSSL 3.
+
+Upstream patch: https://github.com/open-eid/libcdoc/pull/143
+
+Use ASN1_STRING accessors instead of fields, as OpenSSL 4 makes the
+structure opaque. Use std::to_address to support both raw and unique
+pointers while preserving the existing template, call sites, and byte copy.
+
+Upstream patch: https://github.com/open-eid/DigiDoc4-Client/pull/1478
+
+--- a/client/libcdoc/cdoc/Certificate.cpp
++++ b/client/libcdoc/cdoc/Certificate.cpp
+@@ -35,13 +35,13 @@
+     std::string cn;
+     if(!cert)
+         return cn;
+-    X509_NAME *name = X509_get_subject_name(cert.get());
++    const X509_NAME *name = X509_get_subject_name(cert.get());
+     if(!name)
+         return cn;
+     int pos = X509_NAME_get_index_by_NID(name, NID, -1);
+     if(pos == -1)
+         return cn;
+-    X509_NAME_ENTRY *e = X509_NAME_get_entry(name, pos);
++    const X509_NAME_ENTRY *e = X509_NAME_get_entry(name, pos);
+     if(!e)
+         return cn;
+     char *data = nullptr;
+--- a/client/SslCertificate.cpp
++++ b/client/SslCertificate.cpp
+@@ -69,7 +69,9 @@
+ template<class T>
+ static auto toQByteArray(T &x)
+ {
+-	return QByteArray((const char*)x->data, x->length);
++	const auto *str = std::to_address(x);
++	return QByteArray((const char*)ASN1_STRING_get0_data(str),
++	                 ASN1_STRING_length(str));
+ }
+ 
+ template <auto Func, typename Arg>

diff --git a/qdigidoc.spec b/qdigidoc.spec
index 0d2f127..5755fec 100644
--- a/qdigidoc.spec
+++ b/qdigidoc.spec
@@ -9,7 +9,7 @@
 
 Name:           qdigidoc
 Version:        4.11.1
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Estonian digital signature and encryption application
 # Automatically converted from old format: LGPLv2+ - review is highly recommended.
 License:        LicenseRef-Callaway-LGPLv2+
@@ -17,6 +17,7 @@ URL:            https://github.com/open-eid/DigiDoc4-Client
 Source0:        %{url}/releases/download/v%{version}/%{upstream_name}-%{version}.tar.gz
 Patch0:         sandbox.patch
 Patch1:         cmake.patch
+Patch2:         openssl4-compat.patch
 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
 # Dependency flatbuffers already not available on x86
 ExcludeArch:    %{ix86}
@@ -95,8 +96,12 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/ee.ria.qdigidoc4.des
 %{_datadir}/nautilus-python/extensions/*
 
 %changelog
+* Wed Oct 14 2026 Dmitri Smirnov <dmitri@smirnov.ee> - 4.11.1-2
+- Add a patch to fix build against openssl 4 (upstream patches submitted)
+
 * Tue Oct 13 2026 Dmitri Smirnov <dmitri@smirnov.ee> - 4.11.1-1
 - Upstream release 4.11.1
+- Fix certificate access and bundled libcdoc compilation with OpenSSL 4
 
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.0-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-14 17:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 17:35 [rpms/qdigidoc] main: OpenSSL 4 build fixes Dmitri Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox