X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/dd5e47ff5069e3859bd76d5fc8f6887121710556..107d054ba954d05965f793f560468c6c453cc2a5:/apt-pkg/contrib/md5.cc?ds=sidebyside diff --git a/apt-pkg/contrib/md5.cc b/apt-pkg/contrib/md5.cc index 6820d3951..b487a96f9 100644 --- a/apt-pkg/contrib/md5.cc +++ b/apt-pkg/contrib/md5.cc @@ -35,15 +35,12 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include -#include -#include +#include #include -#include -#include // For htonl -#include -#include /*}}}*/ // byteSwap - Swap bytes in a buffer /*{{{*/ @@ -186,7 +183,7 @@ MD5Summation::MD5Summation() // MD5Summation::Add - 'Add' a data set to the hash /*{{{*/ // --------------------------------------------------------------------- /* */ -bool MD5Summation::Add(const unsigned char *data,unsigned long len) +bool MD5Summation::Add(const unsigned char *data,unsigned long long len) { if (Done == true) return false; @@ -231,29 +228,6 @@ bool MD5Summation::Add(const unsigned char *data,unsigned long len) return true; } /*}}}*/ -// MD5Summation::AddFD - Add the contents of a FD to the hash /*{{{*/ -// --------------------------------------------------------------------- -/* */ -bool MD5Summation::AddFD(int Fd,unsigned long Size) -{ - unsigned char Buf[64*64]; - int Res = 0; - int ToEOF = (Size == 0); - while (Size != 0 || ToEOF) - { - unsigned n = sizeof(Buf); - if (!ToEOF) n = min(Size,(unsigned long)n); - Res = read(Fd,Buf,n); - if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read - return false; - if (ToEOF && Res == 0) // EOF - break; - Size -= Res; - Add(Buf,Res); - } - return true; -} - /*}}}*/ // MD5Summation::Result - Returns the value of the sum /*{{{*/ // --------------------------------------------------------------------- /* Because this must add in the last bytes of the series it prevents anyone