]> git.saurik.com Git - apt.git/commitdiff
ensure sha512 is really used when available (thanks to Tyler Hicks )
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 14 Jan 2013 05:31:51 +0000 (06:31 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 14 Jan 2013 05:31:51 +0000 (06:31 +0100)
apt-pkg/acquire-item.cc
cmdline/apt-get.cc

index a30e98858adf645763408442fc185ade9a1413e7..a71886a8759dca2c4141e45f7d75c71347872be3 100644 (file)
@@ -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());
index 1bb981b20566624355eebc21d6e95158ee1f37e4..e3c74a0994dd5a720eae1570bfc121699f418db8 100644 (file)
@@ -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());