| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/cert_verify_proc.h" | 5 #include "net/cert/cert_verify_proc.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 DigestAlgorithm::Sha384; | 635 DigestAlgorithm::Sha384; |
| 636 | 636 |
| 637 struct CertParams { | 637 struct CertParams { |
| 638 // Certificate.signatureAlgorithm | 638 // Certificate.signatureAlgorithm |
| 639 DigestAlgorithm cert_algorithm; | 639 DigestAlgorithm cert_algorithm; |
| 640 | 640 |
| 641 // TBSCertificate.algorithm | 641 // TBSCertificate.algorithm |
| 642 DigestAlgorithm tbs_algorithm; | 642 DigestAlgorithm tbs_algorithm; |
| 643 }; | 643 }; |
| 644 | 644 |
| 645 // On iOS trying to import a certificate with mismatched signature will | 645 // On some platforms trying to import a certificate with mismatched signature |
| 646 // fail. Consequently the rest of the tests can't be performed. | 646 // will fail. Consequently the rest of the tests can't be performed. |
| 647 WARN_UNUSED_RESULT bool SupportsImportingMismatchedAlgorithms() const { | 647 WARN_UNUSED_RESULT bool SupportsImportingMismatchedAlgorithms() const { |
| 648 #if defined(OS_IOS) | 648 #if defined(OS_IOS) |
| 649 LOG(INFO) << "Skipping test on iOS because certs with mismatched " | 649 LOG(INFO) << "Skipping test on iOS because certs with mismatched " |
| 650 "algorithms cannot be imported"; | 650 "algorithms cannot be imported"; |
| 651 return false; | 651 return false; |
| 652 #elif defined(OS_MACOSX) | 652 #elif defined(OS_MACOSX) |
| 653 if (base::mac::IsAtLeastOS10_12()) { | 653 if (base::mac::IsAtLeastOS10_12()) { |
| 654 LOG(INFO) << "Skipping test on macOS >= 10.12 because certs with " | 654 LOG(INFO) << "Skipping test on macOS >= 10.12 because certs with " |
| 655 "mismatched algorithms cannot be imported"; | 655 "mismatched algorithms cannot be imported"; |
| 656 return false; | 656 return false; |
| (...skipping 1660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2317 int flags = 0; | 2317 int flags = 0; |
| 2318 CertVerifyResult verify_result; | 2318 CertVerifyResult verify_result; |
| 2319 int error = verify_proc->Verify(cert.get(), "127.0.0.1", std::string(), flags, | 2319 int error = verify_proc->Verify(cert.get(), "127.0.0.1", std::string(), flags, |
| 2320 NULL, CertificateList(), &verify_result); | 2320 NULL, CertificateList(), &verify_result); |
| 2321 EXPECT_EQ(OK, error); | 2321 EXPECT_EQ(OK, error); |
| 2322 histograms.ExpectTotalCount(kTLSFeatureExtensionHistogram, 0); | 2322 histograms.ExpectTotalCount(kTLSFeatureExtensionHistogram, 0); |
| 2323 histograms.ExpectTotalCount(kTLSFeatureExtensionOCSPHistogram, 0); | 2323 histograms.ExpectTotalCount(kTLSFeatureExtensionOCSPHistogram, 0); |
| 2324 } | 2324 } |
| 2325 | 2325 |
| 2326 } // namespace net | 2326 } // namespace net |
| OLD | NEW |