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

Unified Diff: net/http/http_mac_signature_unittest.cc

Issue 6969050: MAC Cookies (patch 4 of N) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months 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 | « net/http/http_mac_signature.cc ('k') | net/http/http_request_headers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_mac_signature_unittest.cc
===================================================================
--- net/http/http_mac_signature_unittest.cc (revision 85283)
+++ net/http/http_mac_signature_unittest.cc (working copy)
@@ -11,23 +11,15 @@
HttpMacSignature signature;
EXPECT_FALSE(signature.AddStateInfo("exciting-id",
"the-mac-key",
- "bogus-hmac-algorithm",
- "the-issuer"));
+ "bogus-hmac-algorithm"));
EXPECT_FALSE(signature.AddStateInfo("",
"the-mac-key",
- "hmac-sha-1",
- "the-issuer"));
+ "hmac-sha-1"));
EXPECT_FALSE(signature.AddStateInfo("exciting-id",
"",
- "hmac-sha-1",
- "the-issuer"));
+ "hmac-sha-1"));
EXPECT_FALSE(signature.AddStateInfo("exciting-id",
"the-mac-key",
- "",
- "the-issuer"));
- EXPECT_FALSE(signature.AddStateInfo("exciting-id",
- "the-mac-key",
- "hmac-sha-1",
""));
}
@@ -45,8 +37,7 @@
HttpMacSignature signature;
EXPECT_TRUE(signature.AddStateInfo("dfoi30j0qnf",
"adiMf03j0f3nOenc003r",
- "hmac-sha-1",
- "login.eXampLe.com:443"));
+ "hmac-sha-1"));
EXPECT_TRUE(signature.AddHttpInfo("GeT",
"/pAth?to=%22enlightenment%22&dest=magic",
"eXaMple.com",
@@ -56,10 +47,8 @@
std::string nonce = "mn4302j0n+32r2/f3r=";
EXPECT_EQ("MAC id=\"dfoi30j0qnf\", "
- "issuer=\"login.eXampLe.com:443\", "
- "timestamp=\"239034\", "
- "nonce=\"mn4302j0n+32r2/f3r=\", "
- "mac=\"zQWLNI5eHOfY5/wCJ6yzZ8bXDw==\"",
+ "nonce=\"239034:mn4302j0n+32r2/f3r=\", "
+ "mac=\"GrkHtPKzB1m1dCHfa7OCWOw6EQ==\"",
signature.GenerateHeaderString(timestamp, nonce));
}
@@ -68,8 +57,7 @@
HttpMacSignature signature;
EXPECT_TRUE(signature.AddStateInfo("dfoi30j0qnf",
"adiMf03j0f3nOenc003r",
- "hmac-sha-1",
- "login.eXampLe.com:443"));
+ "hmac-sha-1"));
EXPECT_TRUE(signature.AddHttpInfo("GeT",
"/pAth?to=%22enlightenment%22&dest=magic",
"eXaMple.com",
@@ -78,14 +66,13 @@
std::string timestamp = "239034";
std::string nonce = "mn4302j0n+32r2/f3r=";
- EXPECT_EQ("dfoi30j0qnf\n"
- "login.eXampLe.com:443\n"
- "239034\n"
- "mn4302j0n+32r2/f3r=\n"
+ EXPECT_EQ("239034:mn4302j0n+32r2/f3r=\n"
"GET\n"
"/pAth?to=%22enlightenment%22&dest=magic\n"
"example.com\n"
- "80\n",
+ "80\n"
+ "\n"
+ "\n",
signature.GenerateNormalizedRequest(timestamp, nonce));
}
@@ -93,8 +80,7 @@
HttpMacSignature signature;
EXPECT_TRUE(signature.AddStateInfo("dfoi30j0qnf",
"adiMf03j0f3nOenc003r",
- "hmac-sha-1",
- "login.eXampLe.com:443"));
+ "hmac-sha-1"));
EXPECT_TRUE(signature.AddHttpInfo("GeT",
"/pAth?to=%22enlightenment%22&dest=magic",
"eXaMple.com",
@@ -103,7 +89,7 @@
std::string timestamp = "239034";
std::string nonce = "mn4302j0n+32r2/f3r=";
- EXPECT_EQ("zQWLNI5eHOfY5/wCJ6yzZ8bXDw==",
+ EXPECT_EQ("GrkHtPKzB1m1dCHfa7OCWOw6EQ==",
signature.GenerateMAC(timestamp, nonce));
}
}
« no previous file with comments | « net/http/http_mac_signature.cc ('k') | net/http/http_request_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698