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

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

Issue 2277653002: Bring back SCT_STATUS_INVALID for cached entries (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix SCT_STATUS_INVALID comment to not refer to disk cache Created 4 years, 3 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/common/ssl_status_serialization.cc ('k') | net/cert/ct_sct_to_string.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "net/ssl/ssl_connection_status_flags.h" 7 #include "net/ssl/ssl_connection_status_flags.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 SSLStatus status; 141 SSLStatus status;
142 SetTestStatus(&status); 142 SetTestStatus(&status);
143 status.sct_statuses.push_back(static_cast<net::ct::SCTVerifyStatus>(100)); 143 status.sct_statuses.push_back(static_cast<net::ct::SCTVerifyStatus>(100));
144 std::string serialized = SerializeSecurityInfo(status); 144 std::string serialized = SerializeSecurityInfo(status);
145 145
146 SSLStatus deserialized; 146 SSLStatus deserialized;
147 ASSERT_FALSE(DeserializeSecurityInfo(serialized, &deserialized)); 147 ASSERT_FALSE(DeserializeSecurityInfo(serialized, &deserialized));
148 EXPECT_PRED2(SSLStatusAreEqual, SSLStatus(), deserialized); 148 EXPECT_PRED2(SSLStatusAreEqual, SSLStatus(), deserialized);
149 } 149 }
150 150
151 // Test that SCTVerifyStatus INVALID can be deserialized; even though
152 // this value is deprecated, it may still appear in previously written
153 // disk cache entries. Regression test for https://crbug.com/640296
154 TEST(SSLStatusSerializationTest, DeserializeInvalidSCT) {
155 SSLStatus status;
156 SetTestStatus(&status);
157 status.sct_statuses.push_back(
158 static_cast<net::ct::SCTVerifyStatus>(net::ct::SCT_STATUS_INVALID));
159 std::string serialized = SerializeSecurityInfo(status);
160
161 SSLStatus deserialized;
162 ASSERT_TRUE(DeserializeSecurityInfo(serialized, &deserialized));
163 EXPECT_PRED2(SSLStatusAreEqual, status, deserialized);
164 }
165
151 } // namespace 166 } // namespace
OLDNEW
« no previous file with comments | « content/common/ssl_status_serialization.cc ('k') | net/cert/ct_sct_to_string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698