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

Unified Diff: net/cert/ct_signed_certificate_timestamp_log_param.cc

Issue 2208073002: DO NOT REVIEW: Certificate Transparency: Extend SCT verify result enum. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CT: Formatting and compilation fixes. 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
Index: net/cert/ct_signed_certificate_timestamp_log_param.cc
diff --git a/net/cert/ct_signed_certificate_timestamp_log_param.cc b/net/cert/ct_signed_certificate_timestamp_log_param.cc
index f829e56a8139ae1a24a40d5ce3f950af83f1b332..eceacbdc4a197d344160f86ad37ac6b41a5bc79b 100644
--- a/net/cert/ct_signed_certificate_timestamp_log_param.cc
+++ b/net/cert/ct_signed_certificate_timestamp_log_param.cc
@@ -70,6 +70,20 @@ std::unique_ptr<base::ListValue> SCTListToPrintableValues(
return output_scts;
}
+// Given a list of SCTs and their status, return a ListValue instance where
+// each item in the list is a dictionary created by SCTToDictionary, only
+// if its status matches |match_status|
+std::unique_ptr<base::ListValue> SCTListAndStatusToPrintableValues(
+ const ct::SCTAndStatusList& sct_status_list,
+ ct::SCTVerifyStatus match_status) {
+ std::unique_ptr<base::ListValue> output_scts(new base::ListValue());
+ for (const auto& sct_and_status : sct_status_list)
+ if (sct_and_status.second == match_status)
+ output_scts->Append(SCTToDictionary(*(sct_and_status.first.get())));
+
+ return output_scts;
+}
+
} // namespace
std::unique_ptr<base::Value> NetLogSignedCertificateTimestampCallback(
@@ -80,8 +94,13 @@ std::unique_ptr<base::Value> NetLogSignedCertificateTimestampCallback(
dict->Set("verified_scts",
SCTListToPrintableValues(ct_result->verified_scts));
- dict->Set("invalid_scts",
- SCTListToPrintableValues(ct_result->invalid_scts));
+ dict->Set("invalid_signature_scts",
+ SCTListAndStatusToPrintableValues(
+ ct_result->invalid_scts, ct::SCT_STATUS_INVALID_SIGNATURE));
+
+ dict->Set("bad_timestamp_scts",
+ SCTListAndStatusToPrintableValues(
+ ct_result->invalid_scts, ct::SCT_STATUS_INVALID_TIMESTAMP));
dict->Set("unknown_logs_scts",
SCTListToPrintableValues(ct_result->unknown_logs_scts));

Powered by Google App Engine
This is Rietveld 408576698