SHA256 checksum for rpm-md

Bug #331935 reported by Anders F Björklund
4
Affects Status Importance Assigned to Milestone
Smart Package Manager
Fix Released
Undecided
Unassigned

Bug Description

Recent versions of yum createrepo now use SHA256 instead of SHA1...
(the current <checksum type="sha"> is missing from the new repodata)

This requires the use of hashlib module, available in python 2.5 and later.

Tags: fedora

Related branches

Revision history for this message
Anders F Björklund (afb) wrote :

Adds SHA256, for rpm-md

Revision history for this message
Anders F Björklund (afb) wrote :

hashlib for python 2.3 and 2.4 is available from:
http://skvidal.fedorapeople.org/hashlib/

module is included with python 2.5 and python 2.6
(above implementation is a backport of the same)

Revision history for this message
Anders F Björklund (afb) wrote :

Fixes a typo in the previous

Changed in smart:
milestone: none → 1.2
Changed in smart:
milestone: 1.2 → 1.3
status: New → Confirmed
Revision history for this message
Anders F Björklund (afb) wrote :

Recent versions of APT-DEB are also using SHA
(both SHA1 and SHA256 checksums are available)

Revision history for this message
Axel Thimm (axel-thimm) wrote : Re: SHA256 checksum for rpm-md/apt-deb

The following patch on top of the patch in comment #3 seems to be needed:

--- smart/cache.py 2009-02-20 12:34:05 +0000
+++ smart/cache.py 2009-04-16 12:20:41.000000000 +0200
@@ -211,7 +211,7 @@
                     raise Error, _("Invalid MD5 (expected %s, got %s)") % \
                                  (filemd5, lfilemd5)
             else:
- filesha256 = item.getInfo(uncompprefix+"sha256")
+ filesha256 = self.getSHA256(url)
                 if filesha256:
                     try:
                         from hashlib import sha256
@@ -225,7 +225,6 @@
                         if lfilesha256 != filesha256:
                            raise Error, _("Invalid SHA256 (expected %s, got %s)") % \
                                          (filesha256, lfilesha256)
- return
                     except ImportError:
                         pass
                 filesha = self.getSHA(url)
--- smart/fetcher.py 2009-02-20 13:26:02 +0000
+++ smart/fetcher.py 2009-04-16 12:20:26.000000000 +0200
@@ -398,7 +398,6 @@
                         if lfilesha256 != filesha256:
                            raise Error, _("Invalid SHA256 (expected %s, got %s)") % \
                                          (filesha256, lfilesha256)
- return
                     except ImportError:
                         pass
                 filesha = item.getInfo(uncompprefix+"sha")

The resulting patch against 1.2 looks like the attached one.

Revision history for this message
Anders F Björklund (afb) wrote :

Pushed the fix for the inherited bug (see http://bazaar.launchpad.net/~afb/smart/sha256/revision/847) to the branch, thanks...

tags: added: fedora
summary: - SHA256 checksum for rpm-md/apt-deb
+ SHA256 checksum for rpm-md
Changed in smart:
milestone: 1.3 → 1.2.1
Changed in smart:
status: Confirmed → Fix Committed
Changed in smart:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.