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

Unified Diff: net/http/http_response_info_unittest.cc

Issue 2294373002: Certificate Transparency: Remove the obsolete invalid sct status. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« net/http/http_response_info.cc ('K') | « net/http/http_response_info.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_info_unittest.cc
diff --git a/net/http/http_response_info_unittest.cc b/net/http/http_response_info_unittest.cc
index 75ae43532c4d71aeead410bbd4d3589a886d8afb..0eff3ed0cbbc7ddc0dfc96ca82129e0734407cd2 100644
--- a/net/http/http_response_info_unittest.cc
+++ b/net/http/http_response_info_unittest.cc
@@ -5,7 +5,10 @@
#include "net/http/http_response_info.h"
#include "base/pickle.h"
+#include "net/cert/signed_certificate_timestamp.h"
+#include "net/cert/signed_certificate_timestamp_and_status.h"
#include "net/http/http_response_headers.h"
+#include "net/test/ct_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
@@ -90,6 +93,21 @@ TEST_F(HttpResponseInfoTest, AsyncRevalidationRequiredNotPersisted) {
EXPECT_FALSE(restored_response_info.async_revalidation_required);
}
+TEST_F(HttpResponseInfoTest, FailsInitFromPickleWithInvalidSCTStatus) {
+ scoped_refptr<ct::SignedCertificateTimestamp> sct;
+ ct::GetX509CertSCT(&sct);
+
+ response_info_.ssl_info.signed_certificate_timestamps.push_back(
+ SignedCertificateTimestampAndStatus(sct,
+ static_cast<ct::SCTVerifyStatus>(2)));
+
+ base::Pickle pickle;
+ response_info_.Persist(&pickle, false, false);
+ bool truncated = false;
+ net::HttpResponseInfo restored_response_info;
+ EXPECT_FALSE(restored_response_info.InitFromPickle(pickle, &truncated));
estark 2016/08/31 22:03:33 I would find this test slightly more comforting if
Ryan Sleevi 2016/09/01 00:01:29 +1
Eran Messeri 2016/09/01 14:16:34 Good catch, thanks - turns out SCTs aren't seriali
+}
+
} // namespace
} // namespace net
« net/http/http_response_info.cc ('K') | « net/http/http_response_info.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698