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

Unified Diff: net/quic/test_tools/crypto_test_utils_openssl.h

Issue 2328433006: This CL adds GFE token binding support for QUIC, similar to what was added for HTTPS and SPDY. (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/crypto_test_utils_openssl.h
diff --git a/net/quic/test_tools/crypto_test_utils_openssl.h b/net/quic/test_tools/crypto_test_utils_openssl.h
new file mode 100644
index 0000000000000000000000000000000000000000..8fe9a7e4f8fc4587945eafab86f4c744b5dbbf40
--- /dev/null
+++ b/net/quic/test_tools/crypto_test_utils_openssl.h
@@ -0,0 +1,51 @@
+#ifndef NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_OPENSSL_H_
+#define NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_OPENSSL_H_
+
+#include <memory>
+
+#include "net/quic/core/crypto/channel_id.h"
+#include "net/quic/test_tools/crypto_test_utils.h"
+
+#include "security/util/openssl_unique_ptr.h"
+#include "third_party/openssl/evp.h"
+
+namespace net {
+
+namespace test {
+
+class TestChannelIDKey : public ChannelIDKey {
+ public:
+ explicit TestChannelIDKey(EVP_PKEY* ecdsa_key) : ecdsa_key_(ecdsa_key) {}
+ ~TestChannelIDKey() override {}
+
+ // ChannelIDKey implementation.
+
+ bool Sign(base::StringPiece signed_data, std::string* out_signature) const override;
+
+ std::string SerializeKey() const override;
+
+ const EVP_PKEY* get_evp_pkey() const { return ecdsa_key_.get(); }
+
+ private:
+ security::openssl_unique_ptr<EVP_PKEY> ecdsa_key_;
+};
+
+class TestChannelIDSource : public ChannelIDSource {
+ public:
+ ~TestChannelIDSource() override {}
+
+ // ChannelIDSource implementation.
+
+ QuicAsyncStatus GetChannelIDKey(
+ const std::string& hostname,
+ std::unique_ptr<ChannelIDKey>* channel_id_key,
+ ChannelIDSourceCallback* /*callback*/) override;
+
+ private:
+ static EVP_PKEY* HostnameToKey(const std::string& hostname);
+};
+
+} // namespace test
+} // namespace net
+
+#endif // NET_QUIC_TEST_TOOLS_CRYPTO_TEST_UTILS_OPENSSL_H_
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698