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/cronet/android/cert/cert_verifier_cache_serializer.h" | 5 #include "components/cronet/android/cert/cert_verifier_cache_serializer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/android/path_utils.h" | 10 #include "base/android/path_utils.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "components/cronet/android/cert/proto/cert_verification.pb.h" | 14 #include "components/cronet/android/cert/proto/cert_verification.pb.h" |
15 #include "net/base/net_errors.h" | 15 #include "net/base/net_errors.h" |
16 #include "net/base/test_completion_callback.h" | 16 #include "net/base/test_completion_callback.h" |
17 #include "net/cert/caching_cert_verifier.h" | 17 #include "net/cert/caching_cert_verifier.h" |
18 #include "net/cert/cert_verifier.h" | 18 #include "net/cert/cert_verifier.h" |
19 #include "net/cert/cert_verify_result.h" | 19 #include "net/cert/cert_verify_result.h" |
20 #include "net/cert/mock_cert_verifier.h" | 20 #include "net/cert/mock_cert_verifier.h" |
21 #include "net/cert/x509_certificate.h" | 21 #include "net/cert/x509_certificate.h" |
22 #include "net/log/net_log.h" | 22 #include "net/log/net_log_with_source.h" |
23 #include "net/test/cert_test_util.h" | 23 #include "net/test/cert_test_util.h" |
24 #include "net/test/test_data_directory.h" | 24 #include "net/test/test_data_directory.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 | 26 |
27 namespace cronet { | 27 namespace cronet { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 // Helper function that verifies the cerificate with the given |cert_name| | 31 // Helper function that verifies the cerificate with the given |cert_name| |
32 // against the given |hostname| using the given |verifier|. Result from the cert | 32 // against the given |hostname| using the given |verifier|. Result from the cert |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 cert_cache.mutable_cache_entry(i); | 668 cert_cache.mutable_cache_entry(i); |
669 // Corrupt |verification_time|. | 669 // Corrupt |verification_time|. |
670 cache_entry->clear_verification_time(); | 670 cache_entry->clear_verification_time(); |
671 } | 671 } |
672 | 672 |
673 net::CachingCertVerifier verifier2(base::MakeUnique<net::MockCertVerifier>()); | 673 net::CachingCertVerifier verifier2(base::MakeUnique<net::MockCertVerifier>()); |
674 EXPECT_FALSE(DeserializeCertVerifierCache(cert_cache, &verifier2)); | 674 EXPECT_FALSE(DeserializeCertVerifierCache(cert_cache, &verifier2)); |
675 } | 675 } |
676 | 676 |
677 } // namespace cronet | 677 } // namespace cronet |
OLD | NEW |