diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-29 12:45:30 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-29 12:45:30 +0100 |
commit | 9abccf4a63b6c887b213678d940fe912233f04c3 (patch) | |
tree | 8a22c910a0c8258f29784614aca9c0ebd2cc32d6 /apt-pkg/contrib/hashes.cc | |
parent | c56c4b82dd77258da5640bf9f63a8db10424b59a (diff) | |
parent | 627e99b0328e05b13600134655253d36575f314d (diff) |
merge lp:~mvo/apt/abi-break
Diffstat (limited to 'apt-pkg/contrib/hashes.cc')
-rw-r--r-- | apt-pkg/contrib/hashes.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 985d89d90..66ae33146 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -23,7 +23,7 @@ const char* HashString::_SupportedHashes[] = { - "SHA256", "SHA1", "MD5Sum", NULL + "SHA512", "SHA256", "SHA1", "MD5Sum", NULL }; HashString::HashString() @@ -57,6 +57,7 @@ bool HashString::VerifyFile(string filename) const /*{{{*/ MD5Summation MD5; SHA1Summation SHA1; SHA256Summation SHA256; + SHA256Summation SHA512; string fileHash; FileFd Fd(filename, FileFd::ReadOnly); @@ -75,6 +76,11 @@ bool HashString::VerifyFile(string filename) const /*{{{*/ SHA256.AddFD(Fd.Fd(), Fd.Size()); fileHash = (string)SHA256.Result(); } + else if (Type == "SHA512") + { + SHA512.AddFD(Fd.Fd(), Fd.Size()); + fileHash = (string)SHA512.Result(); + } Fd.Close(); if(_config->FindB("Debug::Hashes",false) == true) @@ -119,6 +125,7 @@ bool Hashes::AddFD(int Fd,unsigned long Size) MD5.Add(Buf,Res); SHA1.Add(Buf,Res); SHA256.Add(Buf,Res); + SHA512.Add(Buf,Res); } return true; } |