public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Evan Goode <mail@evangoo.de>
To: git-commits@fedoraproject.org
Subject: [rpms/libsolv] f43: Patch: Use TAG_SHA256HEADER if no TAG_SHA1HEADER
Date: Mon, 26 Oct 2026 11:20:07 GMT	[thread overview]
Message-ID: <179301360704.1.13827425278511286852.rpms-libsolv-68690b09d3ff@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/libsolv
Branch : f43
Commit : 68690b09d3ff452e285273d6a5c026f4afe395d5
Author : Evan Goode <mail@evangoo.de>
Date   : 2026-10-26T12:19:19+01:00
Stats  : +63/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/libsolv/c/68690b09d3ff452e285273d6a5c026f4afe395d5?branch=f43

Log:
Patch: Use TAG_SHA256HEADER if no TAG_SHA1HEADER

---
diff --git a/0005-repo_rpmdb.c-Use-TAG_SHA256HEADER-if-no-TAG_SHA1HEAD.patch b/0005-repo_rpmdb.c-Use-TAG_SHA256HEADER-if-no-TAG_SHA1HEAD.patch
new file mode 100644
index 0000000..df4c015
--- /dev/null
+++ b/0005-repo_rpmdb.c-Use-TAG_SHA256HEADER-if-no-TAG_SHA1HEAD.patch
@@ -0,0 +1,56 @@
+From 840b8dcdd68efc90ebc43d0798372f83cd5eb48e Mon Sep 17 00:00:00 2001
+From: Evan Goode <mail@evangoo.de>
+Date: Fri, 9 Oct 2026 16:52:15 -0400
+Subject: [PATCH] repo_rpmdb.c: Use TAG_SHA256HEADER if no TAG_SHA1HEADER
+
+Unlike RPM's V4 package format [1], RPM's V6 format [2] does not
+guarantee the presence of the SHA1 tag. Only SHA256 and SHA3_256 are
+guaranteed.
+
+If there is no SHA1 header, libsolv should fall back to reading the
+SHA256 header in rpmhead2solv and repo_add_rpm. This way, we do not
+change behavior for existing RPM V4 packages which may contain both a
+SHA1 and SHA256 header.
+
+[1] https://rpm-software-management.github.io/rpm/manual/format_v4.html
+[2] https://rpm-software-management.github.io/rpm/manual/format_v6.html
+---
+ ext/repo_rpmdb.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c
+index 28b6e94d..8e3e35bb 100644
+--- a/ext/repo_rpmdb.c
++++ b/ext/repo_rpmdb.c
+@@ -1246,6 +1246,12 @@ rpmhead2solv(Pool *pool, Repo *repo, Repodata *data, Solvable *s, RpmHead *rpmhe
+ 	    repodata_set_checksum(data, handle, SOLVABLE_HDRID, REPOKEY_TYPE_SHA1, str);
+ 	  else if (str && strlen(str) == 64)
+ 	    repodata_set_checksum(data, handle, SOLVABLE_HDRID, REPOKEY_TYPE_SHA256, str);
++	  else
++	    {
++	      str = headstring(rpmhead, TAG_SHA256HEADER);
++	      if (str && strlen(str) == 64)
++	        repodata_set_checksum(data, handle, SOLVABLE_HDRID, REPOKEY_TYPE_SHA256, str);
++	    }
+ 	}
+       u32 = headint32(rpmhead, TAG_BUILDTIME);
+       if (u32)
+@@ -2064,6 +2070,15 @@ repo_add_rpm(Repo *repo, const char *rpm, int flags)
+ 	      if (solv_hex2bin(&str, hdrid, 32) == 32)
+ 	        hdridtype = REPOKEY_TYPE_SHA256;
+ 	    }
++	  else
++	    {
++	      str = headstring(state.rpmhead, TAG_SHA256HEADER);
++	      if (str && strlen(str) == 64)
++	        {
++	          if (solv_hex2bin(&str, hdrid, 32) == 32)
++	            hdridtype = REPOKEY_TYPE_SHA256;
++	        }
++	    }
+ 	}
+     }
+   else
+-- 
+2.55.0
+

diff --git a/libsolv.spec b/libsolv.spec
index 4c3c29d..c6e68b0 100644
--- a/libsolv.spec
+++ b/libsolv.spec
@@ -29,7 +29,7 @@
 
 Name:           lib%{libname}
 Version:        0.7.40
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Package dependency solver
 
 # LICENSE.BSD:      BSD-3-Clause text
@@ -66,6 +66,9 @@ Patch:          0003-Fix-a-buffer-overflow-when-decompressing-solv-pages.patch
 # Compute hashes with OpenSSL, proposed upstream,
 # <https://github.com/openSUSE/libsolv/pull/627>.
 Patch:          0004-Add-support-for-computing-hashes-using-OpenSSL-3.1.0.patch
+# Use TAG_SHA256HEADER if no TAG_SHA1HEADER, merged upstream,
+# <https://github.com/openSUSE/libsolv/pull/636>.
+Patch:          0005-repo_rpmdb.c-Use-TAG_SHA256HEADER-if-no-TAG_SHA1HEAD.patch
 
 BuildRequires:  cmake >= 3.5
 BuildRequires:  gcc-c++
@@ -317,6 +320,9 @@ export LD_LIBRARY_PATH=%{buildroot}%{_libdir}
 %endif
 
 %changelog
+* Mon Oct 12 2026 Evan Goode <egoode@redhat.com> - 0.7.40-2
+- Patch: Use TAG_SHA256HEADER if no TAG_SHA1HEADER
+
 * Tue Sep 22 2026 Petr Pisar <ppisar@redhat.com> - 0.7.40-1
 - 0.7.40 bump
 

                 reply	other threads:[~2026-10-26 11:20 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=179301360704.1.13827425278511286852.rpms-libsolv-68690b09d3ff@fedoraproject.org \
    --to=mail@evangoo.de \
    --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