public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Filipe Rosset <rosset.filipe@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/bacula] f45: Fixes bacula build against Openssl4+
Date: Sun, 16 Aug 2026 01:09:49 GMT	[thread overview]
Message-ID: <178684258939.1.17205802574762884113.rpms-bacula-4b9e2e4f5232@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/bacula
            Branch : f45
            Commit : 4b9e2e4f52322bdc37aaf977a42629555b7d2678
            Author : Filipe Rosset <rosset.filipe@gmail.com>
            Date   : 2026-08-03T12:47:22-03:00
            Stats  : +137/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/bacula/c/4b9e2e4f52322bdc37aaf977a42629555b7d2678?branch=f45

            Log:
            Fixes bacula build against Openssl4+

Resolves: rhbz#2503783

2503783 - bacula: FTBFS in Fedora rawhide/f45

---
diff --git a/bacula-openssl4.patch b/bacula-openssl4.patch
new file mode 100644
index 0000000..e2395ef
--- /dev/null
+++ b/bacula-openssl4.patch
@@ -0,0 +1,133 @@
+From 5c15ca521e0c841ecfcc35a2d53013f19b4de8e1 Mon Sep 17 00:00:00 2001
+From: Finn Rayk Gaertner <finn.gartner@canonical.com>
+Date: Fri, 31 Jul 2026 04:25:48 +0200
+Subject: [PATCH] OpenSSL 4.0 compatibility
+
+---
+ bacula/src/lib/crypto.c |  6 +++---
+ bacula/src/lib/tls.c    | 27 +++++++++++++++------------
+ 2 files changed, 18 insertions(+), 15 deletions(-)
+
+diff --git a/src/lib/crypto.c b/src/lib/crypto.c
+index dd7a2f982..8913f695c 100644
+--- a/src/lib/crypto.c
++++ b/src/lib/crypto.c
+@@ -309,7 +309,7 @@ typedef struct PEM_CB_Context {
+  *          NULL on failure.
+  */
+ static ASN1_OCTET_STRING *openssl_cert_keyid(X509 *cert) {
+-   X509_EXTENSION *ext;
++   const X509_EXTENSION *ext;
+    const X509V3_EXT_METHOD *method;
+    ASN1_OCTET_STRING *keyid;
+    int i;
+@@ -327,11 +327,11 @@ static ASN1_OCTET_STRING *openssl_cert_keyid(X509 *cert) {
+    ext = X509_get_ext(cert, i);
+ 
+    /* Get x509 extension method structure */
+-   if (!(method = X509V3_EXT_get(ext))) {
++   if (!(method = X509V3_EXT_get((X509_EXTENSION *)ext))) {
+       return NULL;
+    }
+ 
+-   asn1_ext_val = X509_EXTENSION_get_data(ext);
++   asn1_ext_val = X509_EXTENSION_get_data((X509_EXTENSION *)ext);
+    ext_value_data = ASN1_STRING_get0_data(asn1_ext_val);
+ 
+    if (method->it) {
+diff --git a/src/lib/tls.c b/src/lib/tls.c
+index 398577997..77499434d 100644
+--- a/src/lib/tls.c
++++ b/src/lib/tls.c
+@@ -484,7 +484,7 @@ bool tls_postconnect_verify_cn(JCR *jcr, TLS_CONNECTION *tls, alist *verify_list
+ {
+    SSL *ssl = tls->openssl;
+    X509 *cert;
+-   X509_NAME *subject;
++   const X509_NAME *subject;
+    bool auth_success = false;
+    char data[256];
+ 
+@@ -523,15 +523,15 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+ {
+    SSL *ssl = tls->openssl;
+    X509 *cert;
+-   X509_NAME *subject;
++   const X509_NAME *subject;
+    bool auth_success = false;
+    int extensions;
+    int i, j;
+    const char *pval, *phost;
+ 
+    int cnLastPos = -1;
+-   X509_NAME_ENTRY *neCN;
+-   ASN1_STRING *asn1CN;
++   const X509_NAME_ENTRY *neCN;
++   const ASN1_STRING *asn1CN;
+ 
+    /* Check if peer provided a certificate */
+    if (!(cert = SSL_get_peer_certificate(ssl))) {
+@@ -544,11 +544,11 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+    /* Check subjectAltName extensions first */
+    if ((extensions = X509_get_ext_count(cert)) > 0) {
+       for (i = 0; i < extensions; i++) {
+-         X509_EXTENSION *ext;
++         const X509_EXTENSION *ext;
+          const char *extname;
+ 
+          ext = X509_get_ext(cert, i);
+-         extname = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext)));
++         extname = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object((X509_EXTENSION *)ext)));
+ 
+          if (strcmp(extname, "subjectAltName") == 0) {
+ #if (OPENSSL_VERSION_NUMBER >= 0x10000000L)
+@@ -563,11 +563,11 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+             const ASN1_STRING *asn1_ext_val;
+ 
+             /* Get x509 extension method structure */
+-            if (!(method = X509V3_EXT_get(ext))) {
++            if (!(method = X509V3_EXT_get((X509_EXTENSION *)ext))) {
+                break;
+             }
+ 
+-            asn1_ext_val = X509_EXTENSION_get_data(ext);
++            asn1_ext_val = X509_EXTENSION_get_data((X509_EXTENSION *)ext);
+             ext_value_data = ASN1_STRING_get0_data(asn1_ext_val);
+ 
+             if (method->it) {
+@@ -622,26 +622,29 @@ bool tls_postconnect_verify_host(JCR *jcr, TLS_CONNECTION *tls, const char *host
+       if ((subject = X509_get_subject_name(cert)) != NULL) {
+          /* Loop through all CNs */
+          for (;;) {
++            const char *cnval;
++
+             cnLastPos = X509_NAME_get_index_by_NID(subject, NID_commonName, cnLastPos);
+             if (cnLastPos == -1) {
+                break;
+             }
+             neCN = X509_NAME_get_entry(subject, cnLastPos);
+             asn1CN = X509_NAME_ENTRY_get_data(neCN);
+-            if (strncasecmp((const char*)asn1CN->data, "*.", 2) == 0) {
++            cnval = (const char *)ASN1_STRING_get0_data(asn1CN);
++            if (strncasecmp(cnval, "*.", 2) == 0) {
+                /* wildcard certificate */
+                Dmsg0(250, "Wildcard Certificate\n");
+-               pval = strstr((const char*)asn1CN->data, ".");
++               pval = strstr(cnval, ".");
+                phost = strstr(host, ".");
+                if (pval && phost && (strcasecmp(pval, phost) == 0)) {
+                   auth_success = true;
+                   goto success;
+                }
+-            } else if (strcasecmp((const char*)asn1CN->data, host) == 0) {
++            } else if (strcasecmp(cnval, host) == 0) {
+                auth_success = true;
+                break;
+             }
+-            Dmsg2(250, "No subject name match. Host=%s cert=%s\n", host, (const char*)asn1CN->data);
++            Dmsg2(250, "No subject name match. Host=%s cert=%s\n", host, cnval);
+          }
+       }
+    }
+-- 
+2.53.0

diff --git a/bacula.spec b/bacula.spec
index 471c5dc..72f4ef3 100644
--- a/bacula.spec
+++ b/bacula.spec
@@ -54,6 +54,10 @@ Patch8:             %{name}-docker-plugin.patch
 Patch9:             %{name}-autoconf.patch
 Patch10:            %{name}-scripts.patch
 
+# [PATCH] OpenSSL 4.0 compatibility - based on Debian / Ubuntu patches from:
+# https://gitlab.bacula.org/bacula-community-edition/bacula-community/-/issues/2771
+Patch11:            %{name}-openssl4.patch
+
 BuildRequires:      autoconf
 BuildRequires:      automake
 BuildRequires:      desktop-file-utils

                 reply	other threads:[~2026-08-16  1:09 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=178684258939.1.17205802574762884113.rpms-bacula-4b9e2e4f5232@fedoraproject.org \
    --to=rosset.filipe@gmail.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