OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/cast_certificate/cast_crl.h" | 5 #include "components/cast_certificate/cast_crl.h" |
6 | 6 |
7 #include <unordered_map> | 7 #include <unordered_map> |
8 #include <unordered_set> | 8 #include <unordered_set> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // Verify the issuer certificate. | 138 // Verify the issuer certificate. |
139 net::der::GeneralizedTime verification_time; | 139 net::der::GeneralizedTime verification_time; |
140 if (!net::der::EncodeTimeAsGeneralizedTime(time, &verification_time)) { | 140 if (!net::der::EncodeTimeAsGeneralizedTime(time, &verification_time)) { |
141 VLOG(2) << "CRL - Unable to parse verification time."; | 141 VLOG(2) << "CRL - Unable to parse verification time."; |
142 return false; | 142 return false; |
143 } | 143 } |
144 net::CertPathBuilder::Result result; | 144 net::CertPathBuilder::Result result; |
145 net::CertPathBuilder path_builder(parsed_cert.get(), trust_store, | 145 net::CertPathBuilder path_builder(parsed_cert.get(), trust_store, |
146 signature_policy.get(), verification_time, | 146 signature_policy.get(), verification_time, |
147 &result); | 147 &result); |
148 net::CompletionStatus rv = path_builder.Run(base::Closure()); | 148 path_builder.Run(); |
149 DCHECK_EQ(rv, net::CompletionStatus::SYNC); | |
150 if (!result.HasValidPath()) { | 149 if (!result.HasValidPath()) { |
151 VLOG(2) << "CRL - Issuer certificate verification failed."; | 150 VLOG(2) << "CRL - Issuer certificate verification failed."; |
152 // TODO(crbug.com/634443): Log the error information. | 151 // TODO(crbug.com/634443): Log the error information. |
153 return false; | 152 return false; |
154 } | 153 } |
155 // There are no requirements placed on the leaf certificate having any | 154 // There are no requirements placed on the leaf certificate having any |
156 // particular KeyUsages. Leaf certificate checks are bypassed. | 155 // particular KeyUsages. Leaf certificate checks are bypassed. |
157 | 156 |
158 // Verify the CRL is still valid. | 157 // Verify the CRL is still valid. |
159 net::der::GeneralizedTime not_before; | 158 net::der::GeneralizedTime not_before; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 LOG(ERROR) << "CRL - Verification failed."; | 349 LOG(ERROR) << "CRL - Verification failed."; |
351 return nullptr; | 350 return nullptr; |
352 } | 351 } |
353 return base::MakeUnique<CastCRLImpl>(tbs_crl, overall_not_after); | 352 return base::MakeUnique<CastCRLImpl>(tbs_crl, overall_not_after); |
354 } | 353 } |
355 LOG(ERROR) << "No supported version of revocation data."; | 354 LOG(ERROR) << "No supported version of revocation data."; |
356 return nullptr; | 355 return nullptr; |
357 } | 356 } |
358 | 357 |
359 } // namespace cast_certificate | 358 } // namespace cast_certificate |
OLD | NEW |