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 "net/cert/internal/parse_ocsp.h" | 5 #include "net/cert/internal/parse_ocsp.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "net/cert/internal/test_helpers.h" | 9 #include "net/cert/internal/test_helpers.h" |
10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 der::Input cert_input(&cert_data); | 52 der::Input cert_input(&cert_data); |
53 | 53 |
54 der::Input issuer_tbs_certificate_tlv; | 54 der::Input issuer_tbs_certificate_tlv; |
55 der::Input issuer_signature_algorithm_tlv; | 55 der::Input issuer_signature_algorithm_tlv; |
56 der::BitString issuer_signature_value; | 56 der::BitString issuer_signature_value; |
57 der::Input cert_tbs_certificate_tlv; | 57 der::Input cert_tbs_certificate_tlv; |
58 der::Input cert_signature_algorithm_tlv; | 58 der::Input cert_signature_algorithm_tlv; |
59 der::BitString cert_signature_value; | 59 der::BitString cert_signature_value; |
60 if (!ParseCertificate(ca_input, &issuer_tbs_certificate_tlv, | 60 if (!ParseCertificate(ca_input, &issuer_tbs_certificate_tlv, |
61 &issuer_signature_algorithm_tlv, | 61 &issuer_signature_algorithm_tlv, |
62 &issuer_signature_value)) | 62 &issuer_signature_value, nullptr)) |
63 return PARSE_CERT; | 63 return PARSE_CERT; |
64 if (!ParseCertificate(cert_input, &cert_tbs_certificate_tlv, | 64 if (!ParseCertificate(cert_input, &cert_tbs_certificate_tlv, |
65 &cert_signature_algorithm_tlv, &cert_signature_value)) | 65 &cert_signature_algorithm_tlv, &cert_signature_value, |
| 66 nullptr)) |
66 return PARSE_CERT; | 67 return PARSE_CERT; |
67 OCSPResponse parsed_ocsp; | 68 OCSPResponse parsed_ocsp; |
68 OCSPResponseData parsed_ocsp_data; | 69 OCSPResponseData parsed_ocsp_data; |
69 if (!ParseOCSPResponse(ocsp_input, &parsed_ocsp)) | 70 if (!ParseOCSPResponse(ocsp_input, &parsed_ocsp)) |
70 return PARSE_OCSP; | 71 return PARSE_OCSP; |
71 if (parsed_ocsp.status != OCSPResponse::ResponseStatus::SUCCESSFUL) | 72 if (parsed_ocsp.status != OCSPResponse::ResponseStatus::SUCCESSFUL) |
72 return OCSP_NOT_SUCCESSFUL; | 73 return OCSP_NOT_SUCCESSFUL; |
73 if (!ParseOCSPResponseData(parsed_ocsp.data, &parsed_ocsp_data)) | 74 if (!ParseOCSPResponseData(parsed_ocsp.data, &parsed_ocsp_data)) |
74 return PARSE_OCSP_DATA; | 75 return PARSE_OCSP_DATA; |
75 | 76 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 der::EncodeTimeAsGeneralizedTime(this_update, &response.this_update)); | 307 der::EncodeTimeAsGeneralizedTime(this_update, &response.this_update)); |
307 response.has_next_update = false; | 308 response.has_next_update = false; |
308 #if defined(OS_WIN) | 309 #if defined(OS_WIN) |
309 EXPECT_FALSE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); | 310 EXPECT_FALSE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); |
310 #else | 311 #else |
311 EXPECT_TRUE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); | 312 EXPECT_TRUE(CheckOCSPDateValid(response, verify_time, kOCSPAgeOneWeek)); |
312 #endif | 313 #endif |
313 } | 314 } |
314 | 315 |
315 } // namespace net | 316 } // namespace net |
OLD | NEW |