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

Unified Diff: components/cronet/android/api/src/org/chromium/net/CronetEngine.java

Issue 2052363002: Enable public key pinning of local trust anchors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
Index: components/cronet/android/api/src/org/chromium/net/CronetEngine.java
diff --git a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
index f30991ac3c7ae2223aaaeabfa683902ab575467f..52f89e4711b761441498c2b5ec6a606cab6dc681 100644
--- a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
+++ b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
@@ -101,7 +101,8 @@ public abstract class CronetEngine {
// See setters below for verbose descriptions.
private final Context mContext;
private final List<QuicHint> mQuicHints = new LinkedList<QuicHint>();
- private final List<Pkp> mPkps = new LinkedList<Pkp>();
+ private final List<Pkp> mPkps = new LinkedList<>();
+ private boolean mPinLocalTrustAnchors = false;
Ryan Sleevi 2016/06/13 17:03:11 STYLE suggestion: Keep this variable named consist
kapishnikov 2016/06/15 00:56:20 Done, following the existing pattern.
private String mUserAgent;
private String mStoragePath;
private boolean mLegacyModeEnabled;
@@ -541,6 +542,21 @@ public abstract class CronetEngine {
}
/**
+ * Enables or disables pinning of the local (user-level) trust anchors.
+ *
+ * @param value {@code true} to enable pinning, {@code false} to disable.
+ * @return the builder to facilitate chaining.
+ */
+ public Builder enableLocalTrustAnchorPinning(boolean value) {
+ mPinLocalTrustAnchors = value;
+ return this;
+ }
+
+ boolean localTrustAnchorsPinningEnabled() {
Ryan Sleevi 2016/06/13 17:03:11 naming: I'm not sufficiently read on Java style, b
kapishnikov 2016/06/15 00:56:20 Point taken. I have followed the pattern how the o
+ return mPinLocalTrustAnchors;
+ }
+
+ /**
* Checks whether a given string represents a valid host name for PKP and converts it
* to ASCII Compatible Encoding representation according to RFC 1122, RFC 1123 and
* RFC 3490. This method is more restrictive than required by RFC 7469. Thus, a host

Powered by Google App Engine
This is Rietveld 408576698