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

Side by Side Diff: net/http/transport_security_state.h

Issue 2144693004: Add the ability to send Expect-Staple reports. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ocsp-verify-result
Patch Set: Clean tests, add documentation. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_H_ 5 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_H_
6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_ 6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 // 1. The header value is "preload", indicating that the site wants to 442 // 1. The header value is "preload", indicating that the site wants to
443 // be opted in to Expect CT. 443 // be opted in to Expect CT.
444 // 2. The given host is present on the Expect CT preload list with a 444 // 2. The given host is present on the Expect CT preload list with a
445 // valid report-uri, and the build is timely (i.e. preload list is fresh). 445 // valid report-uri, and the build is timely (i.e. preload list is fresh).
446 // 3. |ssl_info| indicates that the connection violated the Expect CT policy. 446 // 3. |ssl_info| indicates that the connection violated the Expect CT policy.
447 // 4. An Expect CT reporter has been provided with SetExpectCTReporter(). 447 // 4. An Expect CT reporter has been provided with SetExpectCTReporter().
448 void ProcessExpectCTHeader(const std::string& value, 448 void ProcessExpectCTHeader(const std::string& value,
449 const HostPortPair& host_port_pair, 449 const HostPortPair& host_port_pair,
450 const SSLInfo& ssl_info); 450 const SSLInfo& ssl_info);
451 451
452 // Sends an Expect-Staple report containing the raw |ocsp_response| for
453 // |host_port_pair| if the following conditions are true:
454 // 1. The given host is present on the Expect-Staple preload list with a valid
455 // report-uri, and the build is timely (i.e. preload list is fresh).
Ryan Sleevi 2016/07/19 19:11:04 This is really two conditions (same with #3) :) 1
dadrian 2016/07/19 21:21:45 Done.
dadrian 2016/07/19 21:21:46 Done.
456 // 2. |ssl_info| indicates the connection did not provide an OCSP response
457 // indicating a revocation status of GOOD.
458 // 3. A report sender is provided with SetReportSender(), and the private
459 // |enable_static_expect_staple_| flag is set.
460 void ProcessExpectStaple(const HostPortPair& host_port_pair,
Ryan Sleevi 2016/07/19 19:11:04 Naming wise, I think this should be CheckExpectSta
dadrian 2016/07/19 21:21:46 Done. This is just a ploy to cause name collision
461 const SSLInfo& ssl_info,
462 const std::string& ocsp_response);
463
452 // For unit tests only; causes ShouldRequireCT() to return |*required| 464 // For unit tests only; causes ShouldRequireCT() to return |*required|
453 // by default (that is, unless a RequireCTDelegate overrides). Set to 465 // by default (that is, unless a RequireCTDelegate overrides). Set to
454 // nullptr to reset. 466 // nullptr to reset.
455 static void SetShouldRequireCTForTesting(bool* required); 467 static void SetShouldRequireCTForTesting(bool* required);
456 468
457 private: 469 private:
458 friend class TransportSecurityStateTest; 470 friend class TransportSecurityStateTest;
459 FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPOnly); 471 FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPOnly);
460 FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPMaxAge0); 472 FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, UpdateDynamicPKPMaxAge0);
461 FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, NoClobberPins); 473 FRIEND_TEST_ALL_PREFIXES(HttpSecurityHeadersTest, NoClobberPins);
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 // rate-limiting. 588 // rate-limiting.
577 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> 589 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>>
578 sent_reports_cache_; 590 sent_reports_cache_;
579 591
580 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); 592 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState);
581 }; 593 };
582 594
583 } // namespace net 595 } // namespace net
584 596
585 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ 597 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/transport_security_state.cc » ('j') | net/http/transport_security_state.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698