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 "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/sha1.h" | 9 #include "base/sha1.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle( | 1019 scoped_refptr<X509Certificate> cert = X509Certificate::CreateFromHandle( |
1020 google_cert_handle, intermediates); | 1020 google_cert_handle, intermediates); |
1021 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert.get()); | 1021 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert.get()); |
1022 | 1022 |
1023 X509Certificate::FreeOSCertHandle(google_cert_handle); | 1023 X509Certificate::FreeOSCertHandle(google_cert_handle); |
1024 X509Certificate::FreeOSCertHandle(thawte_cert_handle); | 1024 X509Certificate::FreeOSCertHandle(thawte_cert_handle); |
1025 | 1025 |
1026 Pickle pickle; | 1026 Pickle pickle; |
1027 cert->Persist(&pickle); | 1027 cert->Persist(&pickle); |
1028 | 1028 |
1029 void* iter = NULL; | 1029 PickleIterator iter(pickle); |
1030 scoped_refptr<X509Certificate> cert_from_pickle = | 1030 scoped_refptr<X509Certificate> cert_from_pickle = |
1031 X509Certificate::CreateFromPickle( | 1031 X509Certificate::CreateFromPickle( |
1032 pickle, &iter, X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN); | 1032 pickle, &iter, X509Certificate::PICKLETYPE_CERTIFICATE_CHAIN); |
1033 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert_from_pickle); | 1033 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert_from_pickle); |
1034 EXPECT_TRUE(X509Certificate::IsSameOSCert( | 1034 EXPECT_TRUE(X509Certificate::IsSameOSCert( |
1035 cert->os_cert_handle(), cert_from_pickle->os_cert_handle())); | 1035 cert->os_cert_handle(), cert_from_pickle->os_cert_handle())); |
1036 const X509Certificate::OSCertHandles& cert_intermediates = | 1036 const X509Certificate::OSCertHandles& cert_intermediates = |
1037 cert->GetIntermediateCertificates(); | 1037 cert->GetIntermediateCertificates(); |
1038 const X509Certificate::OSCertHandles& pickle_intermediates = | 1038 const X509Certificate::OSCertHandles& pickle_intermediates = |
1039 cert_from_pickle->GetIntermediateCertificates(); | 1039 cert_from_pickle->GetIntermediateCertificates(); |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 #define MAYBE_VerifyMixed DISABLED_VerifyMixed | 2015 #define MAYBE_VerifyMixed DISABLED_VerifyMixed |
2016 #else | 2016 #else |
2017 #define MAYBE_VerifyMixed VerifyMixed | 2017 #define MAYBE_VerifyMixed VerifyMixed |
2018 #endif | 2018 #endif |
2019 WRAPPED_INSTANTIATE_TEST_CASE_P( | 2019 WRAPPED_INSTANTIATE_TEST_CASE_P( |
2020 MAYBE_VerifyMixed, | 2020 MAYBE_VerifyMixed, |
2021 X509CertificateWeakDigestTest, | 2021 X509CertificateWeakDigestTest, |
2022 testing::ValuesIn(kVerifyMixedTestData)); | 2022 testing::ValuesIn(kVerifyMixedTestData)); |
2023 | 2023 |
2024 } // namespace net | 2024 } // namespace net |
OLD | NEW |