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

Unified Diff: components/cronet/url_request_context_config.h

Issue 1407263010: [Cronet] Public key pinning for Java API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small changes and rebase Created 5 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
Index: components/cronet/url_request_context_config.h
diff --git a/components/cronet/url_request_context_config.h b/components/cronet/url_request_context_config.h
index 7953d2d8075fd7cf407ff6d8db7c6180fa88274d..cf491383f4d52bd58fdb1bc91e430f3180053a30 100644
--- a/components/cronet/url_request_context_config.h
+++ b/components/cronet/url_request_context_config.h
@@ -10,6 +10,7 @@
#include "base/json/json_value_converter.h"
#include "base/macros.h"
#include "base/memory/scoped_vector.h"
+#include "base/time/time.h"
namespace net {
class CertVerifier;
@@ -41,6 +42,27 @@ struct URLRequestContextConfig {
DISALLOW_COPY_AND_ASSIGN(QuicHint);
};
+ // Public-Key-Pinning configuration structure.
+ struct Pkp {
+ Pkp();
+ ~Pkp();
+
+ // Register |converter| for use in converter.Convert().
+ static void RegisterJSONConverter(base::JSONValueConverter<Pkp>* converter);
+
+ // Host name.
+ std::string host;
+ // Pin hashes (currently SHA256 only).
+ ScopedVector<std::string> pin_hashes;
+ // Indicates whether the pinning should apply to the pinned host subdomains.
+ bool include_subdomains;
+ // Expiration date for the pins.
+ base::Time expiration_date;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Pkp);
+ };
+
URLRequestContextConfig();
~URLRequestContextConfig();
@@ -87,6 +109,8 @@ struct URLRequestContextConfig {
std::string data_reduction_primary_proxy;
std::string data_reduction_fallback_proxy;
std::string data_reduction_secure_proxy_check_url;
+ // The list of public key pins.
+ ScopedVector<Pkp> pkp_list;
// Certificate verifier for testing.
scoped_ptr<net::CertVerifier> mock_cert_verifier;
« no previous file with comments | « components/cronet/android/test/mock_cert_verifier.cc ('k') | components/cronet/url_request_context_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698