public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Dmitri Smirnov <dmitri@smirnov.ee>
To: git-commits@fedoraproject.org
Subject: [rpms/qdigidoc] main: OpenSSL 4 build fixes
Date: Wed, 14 Oct 2026 17:35:08 GMT	[thread overview]
Message-ID: <179199930830.1.12482545903193147893.rpms-qdigidoc-e746817275c5@fedoraproject.org> (raw)

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

                 reply	other threads:[~2026-10-14 17:35 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=179199930830.1.12482545903193147893.rpms-qdigidoc-e746817275c5@fedoraproject.org \
    --to=dmitri@smirnov.ee \
    --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