X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/0b7d641cf12761c3dcc5edb4031adfc9709963e4..15e1ed52a741ff82deb0a4cd6150cf10e23b7368:/apt-pkg/contrib/sha1.cc diff --git a/apt-pkg/contrib/sha1.cc b/apt-pkg/contrib/sha1.cc index 5b9db202d..298a7799b 100644 --- a/apt-pkg/contrib/sha1.cc +++ b/apt-pkg/contrib/sha1.cc @@ -29,14 +29,12 @@ */ /*}}} */ // Include Files /*{{{*/ +#include + #include -#include -#include +#include #include -#include -#include -#include /*}}}*/ // SHA1Transform - Alters an existing SHA-1 hash /*{{{*/ @@ -241,10 +239,12 @@ SHA1SumValue SHA1Summation::Result() // SHA1Summation::Add - Adds content of buffer into the checksum /*{{{*/ // --------------------------------------------------------------------- /* May not be called after Result() is called */ -bool SHA1Summation::Add(const unsigned char *data,unsigned long len) +bool SHA1Summation::Add(const unsigned char *data,unsigned long long len) { if (Done) return false; + if (len == 0) + return true; uint32_t *state = (uint32_t *)State; uint32_t *count = (uint32_t *)Count;