public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Simo Sorce <simo@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/librhsm] f44: OpenSSL 4.0 build fixes
Date: Fri, 19 Jun 2026 08:48:55 GMT	[thread overview]
Message-ID: <178185893522.1.17392266817366883872.rpms-librhsm-d8c1e3fdce3b@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/librhsm
            Branch : f44
            Commit : d8c1e3fdce3b58a289db316639b785be946675a5
            Author : Simo Sorce <simo@redhat.com>
            Date   : 2026-04-27T18:53:40-04:00
            Stats  : +49/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/librhsm/c/d8c1e3fdce3b58a289db316639b785be946675a5?branch=f44

            Log:
            OpenSSL 4.0 build fixes

Signed-off-by: Simo Sorce <simo@redhat.com>

---
diff --git a/0001-Use-OpenSSL-accessors-for-ASN1-structures.patch b/0001-Use-OpenSSL-accessors-for-ASN1-structures.patch
new file mode 100644
index 0000000..4cfe34e
--- /dev/null
+++ b/0001-Use-OpenSSL-accessors-for-ASN1-structures.patch
@@ -0,0 +1,42 @@
+From e8b6048a252f149778525ef87f9500b16cad194e Mon Sep 17 00:00:00 2001
+From: Simo Sorce <simo@redhat.com>
+Date: Mon, 27 Apr 2026 18:51:30 -0400
+Subject: [PATCH] Use OpenSSL accessors for ASN1 structures
+
+Replace direct field access of ASN1_OCTET_STRING with the
+ASN1_STRING_get0_data and ASN1_STRING_length accessor functions. The
+X509_EXTENSION pointer is also marked as const. This ensures compatibility
+with newer OpenSSL versions (4.0+) where these structures are opaque.
+
+Co-authored-by: Gemini <gemini@google.com>
+Signed-off-by: Simo Sorce <simo@redhat.com>
+---
+ rhsm/rhsm-product-certificate.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/rhsm/rhsm-product-certificate.c b/rhsm/rhsm-product-certificate.c
+index e24e2ab..06ac3c0 100644
+--- a/rhsm/rhsm-product-certificate.c
++++ b/rhsm/rhsm-product-certificate.c
+@@ -109,15 +109,15 @@ x509_get_ext_data_by_oid (X509         *cert,
+       return NULL;
+     }
+ 
+-  X509_EXTENSION *ext = X509_get_ext (cert, loc);
++  const X509_EXTENSION *ext = X509_get_ext (cert, loc);
+   ASN1_OCTET_STRING *octet_str = X509_EXTENSION_get_data (ext);
+   if (octet_str == NULL)
+     return NULL;
+ 
+-  const unsigned char *data = octet_str->data;
++  const unsigned char *data = ASN1_STRING_get0_data (octet_str);
+   long len;
+   int tag, xclass;
+-  int ret = ASN1_get_object (&data, &len, &tag, &xclass, octet_str->length);
++  int ret = ASN1_get_object (&data, &len, &tag, &xclass, ASN1_STRING_length (octet_str));
+   /* FIXME: is it proper way of handling error of ASN1_get_object() ? */
+   if (ret & 0x80)
+     {
+-- 
+2.53.0
+

diff --git a/librhsm.spec b/librhsm.spec
index 7a0684c..d2da95b 100644
--- a/librhsm.spec
+++ b/librhsm.spec
@@ -1,6 +1,6 @@
 Name:           librhsm
 Version:        0.0.4
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Red Hat Subscription Manager library
 License:        LGPL-2.1-or-later
 URL:            https://github.com/rpm-software-management/librhsm
@@ -9,6 +9,9 @@ Source1:        %{url}/releases/download/v%{version}/%{name}-%{version}.tar.gz.a
 # Key exported from Petr Pisar's keyring
 Source2:        gpgkey-E3F42FCE156830A80358E6E94FD1AEC3365AF7BF.gpg
 
+#OpenSSL 4.0 build fixes
+Patch1:         0001-Use-OpenSSL-accessors-for-ASN1-structures.patch
+
 BuildRequires:  gnupg2
 BuildRequires:  meson >= 0.37.0
 BuildRequires:  gcc
@@ -50,6 +53,9 @@ Requires:       %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
 %{_libdir}/pkgconfig/%{name}.pc
 
 %changelog
+* Mon Apr 27 2026 Simo Sorce <simo@redhat.com> - 0.0.4-3
+- OpenSSL 4.0 build fixes
+
 * Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
 

                 reply	other threads:[~2026-06-19  8:48 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=178185893522.1.17392266817366883872.rpms-librhsm-d8c1e3fdce3b@fedoraproject.org \
    --to=simo@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