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

Unified Diff: trunk/src/net/quic/test_tools/crypto_test_utils.cc

Issue 15018013: Revert 198736 "Land Recent QUIC changes" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 | « trunk/src/net/quic/test_tools/crypto_test_utils.h ('k') | trunk/src/net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/net/quic/test_tools/crypto_test_utils.cc
===================================================================
--- trunk/src/net/quic/test_tools/crypto_test_utils.cc (revision 198763)
+++ trunk/src/net/quic/test_tools/crypto_test_utils.cc (working copy)
@@ -4,7 +4,7 @@
#include "net/quic/test_tools/crypto_test_utils.h"
-#include "net/quic/crypto/common_cert_set.h"
+#include "base/strings/string_piece.h"
#include "net/quic/crypto/crypto_handshake.h"
#include "net/quic/crypto/crypto_server_config.h"
#include "net/quic/crypto/quic_decrypter.h"
@@ -215,68 +215,6 @@
return it->second;
}
-class MockCommonCertSet : public CommonCertSet {
- public:
- MockCommonCertSet(StringPiece cert, uint64 hash, uint32 index)
- : cert_(cert.as_string()),
- hash_(hash),
- index_(index) {
- }
-
- virtual StringPiece GetCommonHashes() OVERRIDE {
- CHECK(false) << "not implemented";
- return StringPiece();
- }
-
- virtual StringPiece GetCert(uint64 hash, uint32 index) OVERRIDE {
- if (hash == hash_ && index == index_) {
- return cert_;
- }
- return StringPiece();
- }
-
- virtual bool MatchCert(StringPiece cert,
- StringPiece common_set_hashes,
- uint64* out_hash,
- uint32* out_index) OVERRIDE {
- if (cert != cert_) {
- return false;
- }
-
- if (common_set_hashes.size() % sizeof(uint64) != 0) {
- return false;
- }
- bool client_has_set = false;
- for (size_t i = 0; i < common_set_hashes.size(); i += sizeof(uint64)) {
- uint64 hash;
- memcpy(&hash, common_set_hashes.data() + i, sizeof(hash));
- if (hash == hash_) {
- client_has_set = true;
- break;
- }
- }
-
- if (!client_has_set) {
- return false;
- }
-
- *out_hash = hash_;
- *out_index = index_;
- return true;
- }
-
- private:
- const string cert_;
- const uint64 hash_;
- const uint32 index_;
-};
-
-CommonCertSet* CryptoTestUtils::MockCommonCertSet(StringPiece cert,
- uint64 hash,
- uint32 index) {
- return new class MockCommonCertSet(cert, hash, index);
-}
-
void CryptoTestUtils::CompareClientAndServerKeys(
QuicCryptoClientStream* client,
QuicCryptoServerStream* server) {
« no previous file with comments | « trunk/src/net/quic/test_tools/crypto_test_utils.h ('k') | trunk/src/net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698