Skip to content

Commit

Permalink
Enable safe browsing tests exercising VerifyMAC. Reorder libraries to…
Browse files Browse the repository at this point in the history
… match the dependency order required on Posix.

Patch from Pawel Hajdan Jr.
Review URL: http://codereview.chromium.org/3143

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2361 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
deanm@chromium.org committed Sep 18, 2008
1 parent ed6fc35 commit 89892f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
7 changes: 5 additions & 2 deletions chrome/SConscript.unit_tests
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@ env_test.Prepend(
'CHROME_PNG_WRITE_SUPPORT',
'UNIT_TEST',
],

# On Linux, dependencies must come after the libraries that depend on it.
# base must come after net, bzip2 must come before base, etc.
LIBS = [
'net',
'bzip2',
'base',
'base_gfx',
'bzip2',
'googleurl',
'gtest',
'icuuc',
Expand All @@ -42,7 +46,6 @@ env_test.Prepend(
'libxml',
'libxslt',
'modp_b64',
'net',
'skia',
'v8',
'zlib',
Expand Down
7 changes: 0 additions & 7 deletions chrome/browser/safe_browsing/protocol_parser_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ TEST(SafeBrowsingProtocolParsingTest, TestGetHash) {
EXPECT_EQ(full_hashes[2].list_name, "goog-malware-shavar");
}

// TODO(port): Enable when we have ported VerifyMAC in safe_browsing_util.cc.
#if defined(OS_WIN)
TEST(SafeBrowsingProtocolParsingTest, TestGetHashWithMac) {
const unsigned char get_hash[] = {
0x32, 0x56, 0x74, 0x6f, 0x6b, 0x36, 0x64, 0x41,
Expand Down Expand Up @@ -492,8 +490,6 @@ TEST(SafeBrowsingProtocolParsingTest, TestGetHashWithMac) {
EXPECT_EQ(full_hashes.size(), static_cast<size_t>(1));
EXPECT_EQ(memcmp(hash_result, &full_hashes[0].hash, sizeof(SBFullHash)), 0);
}
#endif // defined(OS_WIN)


TEST(SafeBrowsingProtocolParsingTest, TestFormatHash) {
SafeBrowsingProtocolParser parser;
Expand Down Expand Up @@ -555,8 +551,6 @@ TEST(SafeBrowsingProtocolParsingTest, TestReset) {
EXPECT_TRUE(reset);
}

// TODO(port): Enable when we have ported VerifyMAC in safe_browsing_util.cc.
#if defined(OS_WIN)
TEST(SafeBrowsingProtocolParsingTest, TestVerifyUpdateMac) {
SafeBrowsingProtocolParser parser;

Expand Down Expand Up @@ -615,4 +609,3 @@ TEST(SafeBrowsingProtocolParsingTest, TestVerifyChunkMac) {

safe_browsing_util::FreeChunks(&chunks);
}
#endif // defined(OS_WIN)
5 changes: 0 additions & 5 deletions chrome/browser/safe_browsing/safe_browsing_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,6 @@ static void DecodeWebSafe(std::string* decoded) {

bool VerifyMAC(const std::string& key, const std::string& mac,
const char* data, int data_length) {
#if !defined(OS_WIN)
// TODO(port): Remove #defines when linking issue with modp_b64 is resolved.
NOTIMPLEMENTED();
return false;
#endif
std::string key_copy = key;
DecodeWebSafe(&key_copy);
std::string decoded_key;
Expand Down

0 comments on commit 89892f4

Please sign in to comment.