summaryrefslogtreecommitdiff
path: root/test/libapt/hashsums_test.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-03-13 12:21:09 +0100
committerJulian Andres Klode <jak@debian.org>2016-03-13 13:01:14 +0100
commit51c04562559d0924aa52cc8c9b69901bc8a5c945 (patch)
treef31a91a41932f61a444c39374afadf43a3484bed /test/libapt/hashsums_test.cc
parente457c94165c9c4dfef8cea7c2f716700d1c84b3f (diff)
Do not consider SHA1 usable
SHA1 is not reasonably secure anymore, so we should not consider it usable anymore. The test suite is adjusted to account for this.
Diffstat (limited to 'test/libapt/hashsums_test.cc')
-rw-r--r--test/libapt/hashsums_test.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/libapt/hashsums_test.cc b/test/libapt/hashsums_test.cc
index 033493f84..705c0297d 100644
--- a/test/libapt/hashsums_test.cc
+++ b/test/libapt/hashsums_test.cc
@@ -328,11 +328,18 @@ TEST(HashSumsTest, HashStringList)
EXPECT_EQ(29, list.FileSize());
EXPECT_TRUE(NULL != list.find("MD5Sum"));
list.push_back(HashString("SHA1", "cacecbd74968bc90ea3342767e6b94f46ddbcafc"));
- EXPECT_TRUE(list.usable());
+ EXPECT_FALSE(list.usable());
EXPECT_EQ(3, list.size());
EXPECT_EQ(29, list.FileSize());
EXPECT_TRUE(NULL != list.find("MD5Sum"));
EXPECT_TRUE(NULL != list.find("SHA1"));
+ list.push_back(HashString("SHA256", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"));
+ EXPECT_TRUE(list.usable());
+ EXPECT_EQ(4, list.size());
+ EXPECT_EQ(29, list.FileSize());
+ EXPECT_TRUE(NULL != list.find("MD5Sum"));
+ EXPECT_TRUE(NULL != list.find("SHA1"));
+ EXPECT_TRUE(NULL != list.find("SHA256"));
Hashes hashes;
hashes.Add("The quick brown fox jumps over the lazy dog");