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

Unified Diff: net/quic/crypto/channel_id_test.cc

Issue 300223007: Break ChannelIDSigner into two classes: ChannelIDKey and ChannelIDSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes build on C++03 Created 6 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/quic/crypto/channel_id.h ('k') | net/quic/crypto/quic_crypto_client_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/channel_id_test.cc
diff --git a/net/quic/crypto/channel_id_test.cc b/net/quic/crypto/channel_id_test.cc
index 48319ec334b4e0a27b2272447c05bd45add70ccc..f95ec30544e6d197eac99549dfee67186bd0df56 100644
--- a/net/quic/crypto/channel_id_test.cc
+++ b/net/quic/crypto/channel_id_test.cc
@@ -220,16 +220,18 @@ TEST(ChannelIDTest, VerifyKnownAnswerTest) {
}
TEST(ChannelIDTest, SignAndVerify) {
- scoped_ptr<ChannelIDSigner> signer(
- CryptoTestUtils::ChannelIDSignerForTesting());
+ scoped_ptr<ChannelIDSource> source(
+ CryptoTestUtils::ChannelIDSourceForTesting());
const string signed_data = "signed data";
const string hostname = "foo.example.com";
- string key, signature;
- ASSERT_TRUE(signer->Sign(hostname, signed_data, &key, &signature));
+ scoped_ptr<ChannelIDKey> channel_id_key;
+ ASSERT_TRUE(source->GetChannelIDKey(hostname, &channel_id_key));
- EXPECT_EQ(key, signer->GetKeyForHostname(hostname));
+ string signature;
+ ASSERT_TRUE(channel_id_key->Sign(signed_data, &signature));
+ string key = channel_id_key->SerializeKey();
EXPECT_TRUE(ChannelIDVerifier::Verify(key, signed_data, signature));
EXPECT_FALSE(ChannelIDVerifier::Verify("a" + key, signed_data, signature));
« no previous file with comments | « net/quic/crypto/channel_id.h ('k') | net/quic/crypto/quic_crypto_client_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698