summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-02-25 13:47:09 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-02-25 13:47:09 +0100
commitd9b9e9e2495fa4cfd9f555cd51a394bad2f98894 (patch)
tree99b415b32f88e35e3aae398d5ad1890f861a1097 /apt-pkg/acquire-item.cc
parent54ce88fd2669a729c89c940be3abc9456d19d542 (diff)
parent9a961efc5cedeb2b7439114df18e8d0201c83fcf (diff)
add sha512 support in the client now as well
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index d4df31e85..05e2f28a4 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1665,6 +1665,8 @@ bool pkgAcqArchive::QueueNext()
string PkgFile = Parse.FileName();
if (ForceHash.empty() == false)
{
+ if(stringcasecmp(ForceHash, "sha512") == 0)
+ ExpectedHash = HashString("SHA512", Parse.SHA512Hash());
if(stringcasecmp(ForceHash, "sha256") == 0)
ExpectedHash = HashString("SHA256", Parse.SHA256Hash());
else if (stringcasecmp(ForceHash, "sha1") == 0)
@@ -1675,7 +1677,9 @@ bool pkgAcqArchive::QueueNext()
else
{
string Hash;
- if ((Hash = Parse.SHA256Hash()).empty() == false)
+ if ((Hash = Parse.SHA512Hash()).empty() == false)
+ ExpectedHash = HashString("SHA512", Hash);
+ else if ((Hash = Parse.SHA256Hash()).empty() == false)
ExpectedHash = HashString("SHA256", Hash);
else if ((Hash = Parse.SHA1Hash()).empty() == false)
ExpectedHash = HashString("SHA1", Hash);