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

Side by Side Diff: content/public/common/ssl_status.cc

Issue 2066483009: Expose SSLInfo::pkp_bypassed to devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove change to browser_protocol.json 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
« no previous file with comments | « content/public/common/ssl_status.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "content/public/common/ssl_status.h" 5 #include "content/public/common/ssl_status.h"
6 6
7 #include "net/cert/sct_status_flags.h" 7 #include "net/cert/sct_status_flags.h"
8 #include "net/ssl/ssl_info.h" 8 #include "net/ssl/ssl_info.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 SSLStatus::SSLStatus() 12 SSLStatus::SSLStatus()
13 : security_style(SECURITY_STYLE_UNKNOWN), 13 : security_style(SECURITY_STYLE_UNKNOWN),
14 cert_id(0), 14 cert_id(0),
15 cert_status(0), 15 cert_status(0),
16 security_bits(-1), 16 security_bits(-1),
17 key_exchange_info(0), 17 key_exchange_info(0),
18 connection_status(0), 18 connection_status(0),
19 content_status(NORMAL_CONTENT), 19 content_status(NORMAL_CONTENT),
20 num_unknown_scts(0), 20 num_unknown_scts(0),
21 num_invalid_scts(0), 21 num_invalid_scts(0),
22 num_valid_scts(0) {} 22 num_valid_scts(0),
23 pkp_bypassed(false) {}
23 24
24 SSLStatus::SSLStatus(SecurityStyle security_style, 25 SSLStatus::SSLStatus(SecurityStyle security_style,
25 int cert_id, 26 int cert_id,
26 const net::SSLInfo& ssl_info) 27 const net::SSLInfo& ssl_info)
27 : security_style(security_style), 28 : security_style(security_style),
28 cert_id(cert_id), 29 cert_id(cert_id),
29 cert_status(ssl_info.cert_status), 30 cert_status(ssl_info.cert_status),
30 security_bits(ssl_info.security_bits), 31 security_bits(ssl_info.security_bits),
31 key_exchange_info(ssl_info.key_exchange_info), 32 key_exchange_info(ssl_info.key_exchange_info),
32 connection_status(ssl_info.connection_status), 33 connection_status(ssl_info.connection_status),
33 content_status(NORMAL_CONTENT), 34 content_status(NORMAL_CONTENT),
34 num_unknown_scts(0), 35 num_unknown_scts(0),
35 num_invalid_scts(0), 36 num_invalid_scts(0),
36 num_valid_scts(0) { 37 num_valid_scts(0),
38 pkp_bypassed(ssl_info.pkp_bypassed) {
37 // Count unknown, invalid and valid SCTs. 39 // Count unknown, invalid and valid SCTs.
38 for (const auto& sct_and_status : ssl_info.signed_certificate_timestamps) { 40 for (const auto& sct_and_status : ssl_info.signed_certificate_timestamps) {
39 switch (sct_and_status.status) { 41 switch (sct_and_status.status) {
40 case net::ct::SCT_STATUS_LOG_UNKNOWN: 42 case net::ct::SCT_STATUS_LOG_UNKNOWN:
41 num_unknown_scts++; 43 num_unknown_scts++;
42 break; 44 break;
43 case net::ct::SCT_STATUS_INVALID: 45 case net::ct::SCT_STATUS_INVALID:
44 num_invalid_scts++; 46 num_invalid_scts++;
45 break; 47 break;
46 case net::ct::SCT_STATUS_OK: 48 case net::ct::SCT_STATUS_OK:
47 num_valid_scts++; 49 num_valid_scts++;
48 break; 50 break;
49 case net::ct::SCT_STATUS_NONE: 51 case net::ct::SCT_STATUS_NONE:
50 case net::ct::SCT_STATUS_MAX: 52 case net::ct::SCT_STATUS_MAX:
51 // These enum values do not represent SCTs that are taken into account 53 // These enum values do not represent SCTs that are taken into account
52 // for CT compliance calculations, so we ignore them. 54 // for CT compliance calculations, so we ignore them.
53 NOTREACHED(); 55 NOTREACHED();
54 break; 56 break;
55 } 57 }
56 } 58 }
57 } 59 }
58 60
59 SSLStatus::SSLStatus(const SSLStatus& other) = default; 61 SSLStatus::SSLStatus(const SSLStatus& other) = default;
60 62
61 SSLStatus::~SSLStatus() {} 63 SSLStatus::~SSLStatus() {}
62 64
63 } // namespace content 65 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/ssl_status.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698