From ee5f5d257c6ad59c9b3ef8c55d61ffb293be847c Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 14 Jan 2013 06:31:51 +0100 Subject: ensure sha512 is really used when available (thanks to Tyler Hicks ) --- apt-pkg/acquire-item.cc | 2 +- cmdline/apt-get.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index a30e98858..a71886a87 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1730,7 +1730,7 @@ bool pkgAcqArchive::QueueNext() { if(stringcasecmp(ForceHash, "sha512") == 0) ExpectedHash = HashString("SHA512", Parse.SHA512Hash()); - if(stringcasecmp(ForceHash, "sha256") == 0) + else if(stringcasecmp(ForceHash, "sha256") == 0) ExpectedHash = HashString("SHA256", Parse.SHA256Hash()); else if (stringcasecmp(ForceHash, "sha1") == 0) ExpectedHash = HashString("SHA1", Parse.SHA1Hash()); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 1bb981b20..e3c74a099 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2395,7 +2395,7 @@ bool DoDownload(CommandLine &CmdL) HashString hash; if (rec.SHA512Hash() != "") hash = HashString("sha512", rec.SHA512Hash()); - if (rec.SHA256Hash() != "") + else if (rec.SHA256Hash() != "") hash = HashString("sha256", rec.SHA256Hash()); else if (rec.SHA1Hash() != "") hash = HashString("sha1", rec.SHA1Hash()); -- cgit v1.2.3 From 75247742b762d5e8dc311600b8b053533695f36d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 1 Mar 2013 12:12:05 +0100 Subject: add changelog --- debian/changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/changelog b/debian/changelog index c956f57d3..ef50ea423 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,7 @@ apt (0.9.7.8) UNRELEASED; urgency=low (potentially) used for non deb,dsc content that may contain spaces, thanks to Daniel Hartwig and Thomas Bushnell (LP: #1086997) + * use sha512 when available (LP: #1098752) -- Christian Perrier Mon, 24 Dec 2012 07:01:20 +0100 -- cgit v1.2.3