public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Michal Ruprich <mruprich@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/libnetconf2] openssl4-f45: Fixing FTBFS with new openssl
Date: Fri, 18 Sep 2026 06:35:18 GMT	[thread overview]
Message-ID: <178971331870.1.17621381417676690528.rpms-libnetconf2-92489ff5c68e@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/libnetconf2
Branch : openssl4-f45
Commit : 92489ff5c68e70faf51926524a97ce844fed4e70
Author : Michal Ruprich <mruprich@redhat.com>
Date   : 2026-09-18T08:34:55+02:00
Stats  : +69/-3 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/libnetconf2/c/92489ff5c68e70faf51926524a97ce844fed4e70?branch=openssl4-f45

Log:
Fixing FTBFS with new openssl

---
diff --git a/0001-openssl4-changes.patch b/0001-openssl4-changes.patch
new file mode 100644
index 0000000..df56d1e
--- /dev/null
+++ b/0001-openssl4-changes.patch
@@ -0,0 +1,61 @@
+From e2089fe7930ddb23b10602eaa67f049b7d21b7a4 Mon Sep 17 00:00:00 2001
+From: Michal Vasko <mvasko@cesnet.cz>
+Date: Thu, 30 Jul 2026 16:01:27 +0200
+Subject: [PATCH] session openssl UPDATE do not access ASN1_OCTET_STRING
+ directly
+
+Obsolete in OpenSSL 4.0.
+
+Fixes #612
+---
+ src/session_openssl.c | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/src/session_openssl.c b/src/session_openssl.c
+index 4543730c..77f49607 100644
+--- a/src/session_openssl.c
++++ b/src/session_openssl.c
+@@ -618,7 +618,8 @@ nc_tls_get_san_value_type_wrap(void *sans, int idx, char **san_value, NC_TLS_CTN
+ {
+     int ret = 0;
+     GENERAL_NAME *san;
+-    ASN1_OCTET_STRING *ip;
++    int ip_length;
++    const unsigned char *ip_data;
+ 
+     *san_value = NULL;
+     *san_type = NC_TLS_CTN_UNKNOWN;
+@@ -643,24 +644,25 @@ nc_tls_get_san_value_type_wrap(void *sans, int idx, char **san_value, NC_TLS_CTN
+         break;
+     case GEN_IPADD:
+         *san_type = NC_TLS_CTN_SAN_IP_ADDRESS;
+-        ip = san->d.iPAddress;
+-        if (ip->length == 4) {
+-            if (asprintf(san_value, "%d.%d.%d.%d", ip->data[0], ip->data[1], ip->data[2], ip->data[3]) == -1) {
++        ip_data = ASN1_STRING_get0_data(san->d.iPAddress);
++        ip_length = ASN1_STRING_length(san->d.iPAddress);
++        if (ip_length == 4) {
++            if (asprintf(san_value, "%d.%d.%d.%d", ip_data[0], ip_data[1], ip_data[2], ip_data[3]) == -1) {
+                 ERRMEM;
+                 *san_value = NULL;
+                 ret = -1;
+             }
+-        } else if (ip->length == 16) {
++        } else if (ip_length == 16) {
+             if (asprintf(san_value, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
+-                    ip->data[0], ip->data[1], ip->data[2], ip->data[3], ip->data[4], ip->data[5],
+-                    ip->data[6], ip->data[7], ip->data[8], ip->data[9], ip->data[10], ip->data[11],
+-                    ip->data[12], ip->data[13], ip->data[14], ip->data[15]) == -1) {
++                    ip_data[0], ip_data[1], ip_data[2], ip_data[3], ip_data[4], ip_data[5],
++                    ip_data[6], ip_data[7], ip_data[8], ip_data[9], ip_data[10], ip_data[11],
++                    ip_data[12], ip_data[13], ip_data[14], ip_data[15]) == -1) {
+                 ERRMEM;
+                 *san_value = NULL;
+                 ret = -1;
+             }
+         } else {
+-            WRN(NULL, "SAN IP address in an unknown format (length is %d).", ip->length);
++            WRN(NULL, "SAN IP address in an unknown format (length is %d).", ip_length);
+             ret = 1;
+         }
+         break;

diff --git a/libnetconf2.spec b/libnetconf2.spec
index 3d36839..d54ade3 100644
--- a/libnetconf2.spec
+++ b/libnetconf2.spec
@@ -1,6 +1,6 @@
 Name: libnetconf2
 Version: 3.7.10
-Release: 4%{?dist}
+Release: 5%{?dist}
 Summary: NETCONF protocol library
 Url: https://github.com/CESNET/libnetconf2
 Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
@@ -14,6 +14,9 @@ BuildRequires:  openssl-devel
 BuildRequires:  pam-devel
 BuildRequires:  pkgconfig(libyang) >= 2
 BuildRequires:  curl-devel
+BuildRequires:  git-core
+
+Patch1: 0001-openssl4-changes.patch
 
 %package devel
 Summary:    Headers of libnetconf2 library
@@ -28,9 +31,8 @@ Headers of libnetconf library.
 libnetconf2 is a NETCONF library in C intended for building NETCONF clients and
 servers. NETCONF is the NETwork CONFiguration protocol introduced by IETF.
 
-
 %prep
-%autosetup -p1
+%autosetup -p1 -S git
 
 %build
 %cmake -DCMAKE_BUILD_TYPE=RELWITHDEBINFO
@@ -57,6 +59,9 @@ servers. NETCONF is the NETwork CONFiguration protocol introduced by IETF.
 
 
 %changelog
+* Fri Sep 18 2026 Michal Ruprich <mruprich@redhat.com> - 3.7.10-5
+- Fixing FTBFS with new openssl
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.10-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

                 reply	other threads:[~2026-09-18  6: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=178971331870.1.17621381417676690528.rpms-libnetconf2-92489ff5c68e@fedoraproject.org \
    --to=mruprich@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