summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/contrib/sha256.cc8
-rw-r--r--debian/changelog42
-rw-r--r--ftparchive/cachedb.cc13
-rw-r--r--test/hash.cc7
4 files changed, 43 insertions, 27 deletions
diff --git a/apt-pkg/contrib/sha256.cc b/apt-pkg/contrib/sha256.cc
index ad2ddb2d3..b75ce8a84 100644
--- a/apt-pkg/contrib/sha256.cc
+++ b/apt-pkg/contrib/sha256.cc
@@ -61,10 +61,10 @@ static inline u32 Maj(u32 x, u32 y, u32 z)
static inline void LOAD_OP(int I, u32 *W, const u8 *input)
{
- W[I] = ( ((u32) input[I + 0] << 24)
- | ((u32) input[I + 1] << 16)
- | ((u32) input[I + 2] << 8)
- | ((u32) input[I + 3]));
+ W[I] = ( ((u32) input[I * 4 + 0] << 24)
+ | ((u32) input[I * 4 + 1] << 16)
+ | ((u32) input[I * 4 + 2] << 8)
+ | ((u32) input[I * 4 + 3]));
}
static inline void BLEND_OP(int I, u32 *W)
diff --git a/debian/changelog b/debian/changelog
index 56e4c35f4..a9214c515 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,20 +1,30 @@
-apt (0.6.44.2) unstable; urgency=low
+apt (0.6.45) unstable; urgency=low
- * apt-pkg/depcache.cc:
- - added Debug::pkgDepCache::AutoInstall (thanks to infinity)
- * apt-pkg/acquire-item.cc:
- - fix missing chmod() in the new aquire code
- (thanks to Bastian Blank, Closes: #367425)
- * merged from
- http://www.perrier.eu.org/debian/packages/d-i/level4/apt-main:
- * sk.po: Completed to 512t
- * eu.po: Completed to 512t
- * fr.po: Completed to 512t
- * sv.po: Completed to 512t
- * Update all PO and the POT. Gives 506t6f for formerly
- complete translations
-
- -- Michael Vogt <mvo@debian.org> Wed, 14 Jun 2006 12:00:57 +0200
+ * apt-pkg/contrib/sha256.cc:
+ - fixed the sha256 generation (closes: #378183)
+ * ftparchive/cachedb.cc:
+ - applied patch from ajt to fix Clean() function
+ (closes: #379576)
+
+ --
+
+apt (0.6.44.2) unstable; urgency=low
+
+ * apt-pkg/depcache.cc:
+ - added Debug::pkgDepCache::AutoInstall (thanks to infinity)
+ * apt-pkg/acquire-item.cc:
+ - fix missing chmod() in the new aquire code
+ (thanks to Bastian Blank, Closes: #367425)
+ * merged from
+ http://www.perrier.eu.org/debian/packages/d-i/level4/apt-main:
+ * sk.po: Completed to 512t
+ * eu.po: Completed to 512t
+ * fr.po: Completed to 512t
+ * sv.po: Completed to 512t
+ * Update all PO and the POT. Gives 506t6f for formerly
+ complete translations
+
+ -- Michael Vogt <mvo@debian.org> Wed, 14 Jun 2006 12:00:57 +0200
apt (0.6.44.1-0.1) unstable; urgency=low
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc
index 0e6078642..8a4ca0236 100644
--- a/ftparchive/cachedb.cc
+++ b/ftparchive/cachedb.cc
@@ -453,15 +453,14 @@ bool CacheDB::Clean()
memset(&Data,0,sizeof(Data));
while ((errno = Cursor->c_get(Cursor,&Key,&Data,DB_NEXT)) == 0)
{
- const char *Colon = (char *)Key.data;
- for (; Colon != (char *)Key.data+Key.size && *Colon != ':'; Colon++);
- if ((char *)Key.data+Key.size - Colon > 2)
+ const char *Colon = (char*)memrchr(Key.data, ':', Key.size);
+ if (Colon)
{
- if (stringcmp((char *)Key.data,Colon,"st") == 0 ||
- stringcmp((char *)Key.data,Colon,"cn") == 0 ||
- stringcmp((char *)Key.data,Colon,"cl") == 0)
+ if (stringcmp(Colon + 1, (char *)Key.data+Key.size,"st") == 0 ||
+ stringcmp(Colon + 1, (char *)Key.data+Key.size,"cl") == 0 ||
+ stringcmp(Colon + 1, (char *)Key.data+Key.size,"cn") == 0)
{
- if (FileExists(string(Colon+1,(const char *)Key.data+Key.size)) == true)
+ if (FileExists(string((const char *)Key.data,Colon)) == true)
continue;
}
}
diff --git a/test/hash.cc b/test/hash.cc
index 5334c0331..cfdb4ea9d 100644
--- a/test/hash.cc
+++ b/test/hash.cc
@@ -1,5 +1,6 @@
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
+#include <apt-pkg/sha256.h>
#include <apt-pkg/strutl.h>
#include <iostream>
@@ -57,6 +58,12 @@ int main()
"d174ab98d277d9f5a5611c2c9f419d9f");
Test<MD5Summation>("12345678901234567890123456789012345678901234567890123456789012345678901234567890",
"57edf4a22be3c955ac49da2e2107b67a");
+
+ // SHA-256, From FIPS 180-2
+ Test<SHA256Summation>("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
+ "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1");
+
+
return 0;
}