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

Side by Side Diff: content/common/ssl_status_serialization.cc

Issue 2241213002: Distinguish between SCT invalidity reasons in UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing review comments Created 4 years, 4 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 #include "content/common/ssl_status_serialization.h" 5 #include "content/common/ssl_status_serialization.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 13 matching lines...) Expand all
24 return true; 24 return true;
25 } 25 }
26 return false; 26 return false;
27 } 27 }
28 28
29 // Checks that an integer |sct_status| is a valid net::ct::SCTVerifyStatus enum 29 // Checks that an integer |sct_status| is a valid net::ct::SCTVerifyStatus enum
30 // value. Returns true if valid, false otherwise. 30 // value. Returns true if valid, false otherwise.
31 bool CheckSCTStatus(uint32_t sct_status) { 31 bool CheckSCTStatus(uint32_t sct_status) {
32 switch (sct_status) { 32 switch (sct_status) {
33 case net::ct::SCT_STATUS_LOG_UNKNOWN: 33 case net::ct::SCT_STATUS_LOG_UNKNOWN:
34 case net::ct::SCT_STATUS_INVALID: 34 case net::ct::SCT_STATUS_INVALID_SIGNATURE:
35 case net::ct::SCT_STATUS_OK: 35 case net::ct::SCT_STATUS_OK:
36 case net::ct::SCT_STATUS_MAX: 36 case net::ct::SCT_STATUS_INVALID_TIMESTAMP:
37 return true; 37 return true;
38 case net::ct::SCT_STATUS_NONE: 38 case net::ct::SCT_STATUS_NONE:
39 case net::ct::SCT_STATUS_MAX:
Avi (use Gerrit) 2016/08/16 15:25:47 This is wrong (see my other note). MAX shouldn't b
Eran Messeri 2016/08/16 16:06:09 Done, removed.
39 // SCT_STATUS_NONE should never happen, so it isn't valid to 40 // SCT_STATUS_NONE should never happen, so it isn't valid to
40 // receive a status of NONE in a serialized SSLStatus. 41 // receive a status of NONE in a serialized SSLStatus.
41 return false; 42 return false;
42 } 43 }
43 return false; 44 return false;
44 } 45 }
45 46
46 } // namespace 47 } // namespace
47 48
48 namespace content { 49 namespace content {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // Sanity check |key_exchange_info|: 0 or greater. 120 // Sanity check |key_exchange_info|: 0 or greater.
120 if (ssl_status->key_exchange_info < 0) { 121 if (ssl_status->key_exchange_info < 0) {
121 *ssl_status = SSLStatus(); 122 *ssl_status = SSLStatus();
122 return false; 123 return false;
123 } 124 }
124 125
125 return true; 126 return true;
126 } 127 }
127 128
128 } // namespace content 129 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698