Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: crypto/p224_spake_unittest.cc

Issue 8903001: Simplify SPAKE2 implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crypto/p224_spake.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/p224_spake_unittest.cc
diff --git a/crypto/p224_spake_unittest.cc b/crypto/p224_spake_unittest.cc
index e45ec82fb349f0fe53ce7f8aa5851d3375514b32..bcd448c9341a0b21b5fe8361f4ef822c0e7714e8 100644
--- a/crypto/p224_spake_unittest.cc
+++ b/crypto/p224_spake_unittest.cc
@@ -43,37 +43,24 @@ bool RunExchange(P224EncryptedKeyExchange* client,
}
static const char kPassword[] = "foo";
-static const char kSession[] = "bar";
TEST(MutualAuth, CorrectAuth) {
P224EncryptedKeyExchange client(
- P224EncryptedKeyExchange::kPeerTypeClient,
- kPassword, kSession);
+ P224EncryptedKeyExchange::kPeerTypeClient, kPassword);
P224EncryptedKeyExchange server(
- P224EncryptedKeyExchange::kPeerTypeServer,
- kPassword, kSession);
+ P224EncryptedKeyExchange::kPeerTypeServer, kPassword);
EXPECT_TRUE(RunExchange(&client, &server));
+ EXPECT_EQ(client.GetKey(), server.GetKey());
}
TEST(MutualAuth, IncorrectPassword) {
P224EncryptedKeyExchange client(
P224EncryptedKeyExchange::kPeerTypeClient,
- kPassword, kSession);
- P224EncryptedKeyExchange server(
- P224EncryptedKeyExchange::kPeerTypeServer,
- "wrongpassword", kSession);
-
- EXPECT_FALSE(RunExchange(&client, &server));
-}
-
-TEST(MutualAuth, IncorrectSession) {
- P224EncryptedKeyExchange client(
- P224EncryptedKeyExchange::kPeerTypeClient,
- kPassword, kSession);
+ kPassword);
P224EncryptedKeyExchange server(
P224EncryptedKeyExchange::kPeerTypeServer,
- kPassword, "wrongsession");
+ "wrongpassword");
EXPECT_FALSE(RunExchange(&client, &server));
}
@@ -83,11 +70,9 @@ TEST(MutualAuth, Fuzz) {
for (unsigned i = 0; i < kIterations; i++) {
P224EncryptedKeyExchange client(
- P224EncryptedKeyExchange::kPeerTypeClient,
- kPassword, kSession);
+ P224EncryptedKeyExchange::kPeerTypeClient, kPassword);
P224EncryptedKeyExchange server(
- P224EncryptedKeyExchange::kPeerTypeServer,
- kPassword, kSession);
+ P224EncryptedKeyExchange::kPeerTypeServer, kPassword);
// We'll only be testing small values of i, but we don't want that to bias
// the test coverage. So we disperse the value of i by multiplying by the
« no previous file with comments | « crypto/p224_spake.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698