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/nss_cert_database.h" | 5 #include "net/cert/nss_cert_database.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <certdb.h> | 8 #include <certdb.h> |
9 #include <pk11pub.h> | 9 #include <pk11pub.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 #include <memory> | 12 #include <memory> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
17 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/threading/thread_task_runner_handle.h" | 22 #include "base/threading/thread_task_runner_handle.h" |
23 #include "crypto/scoped_nss_types.h" | 23 #include "crypto/scoped_nss_types.h" |
24 #include "crypto/scoped_test_nss_db.h" | 24 #include "crypto/scoped_test_nss_db.h" |
25 #include "net/base/crypto_module.h" | 25 #include "net/base/crypto_module.h" |
26 #include "net/base/hash_value.h" | 26 #include "net/base/hash_value.h" |
27 #include "net/base/net_errors.h" | 27 #include "net/base/net_errors.h" |
28 #include "net/base/test_data_directory.h" | |
29 #include "net/cert/cert_status_flags.h" | 28 #include "net/cert/cert_status_flags.h" |
30 #include "net/cert/cert_verify_proc_nss.h" | 29 #include "net/cert/cert_verify_proc_nss.h" |
31 #include "net/cert/cert_verify_result.h" | 30 #include "net/cert/cert_verify_result.h" |
32 #include "net/cert/x509_certificate.h" | 31 #include "net/cert/x509_certificate.h" |
33 #include "net/test/cert_test_util.h" | 32 #include "net/test/cert_test_util.h" |
| 33 #include "net/test/test_data_directory.h" |
34 #include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h" | 34 #include "net/third_party/mozilla_security_manager/nsNSSCertificateDB.h" |
35 #include "testing/gtest/include/gtest/gtest.h" | 35 #include "testing/gtest/include/gtest/gtest.h" |
36 | 36 |
37 // In NSS 3.13, CERTDB_VALID_PEER was renamed CERTDB_TERMINAL_RECORD. So we use | 37 // In NSS 3.13, CERTDB_VALID_PEER was renamed CERTDB_TERMINAL_RECORD. So we use |
38 // the new name of the macro. | 38 // the new name of the macro. |
39 #if !defined(CERTDB_TERMINAL_RECORD) | 39 #if !defined(CERTDB_TERMINAL_RECORD) |
40 #define CERTDB_TERMINAL_RECORD CERTDB_VALID_PEER | 40 #define CERTDB_TERMINAL_RECORD CERTDB_VALID_PEER |
41 #endif | 41 #endif |
42 | 42 |
43 using base::ASCIIToUTF16; | 43 using base::ASCIIToUTF16; |
(...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 EXPECT_EQ(NSSCertDatabase::TRUST_DEFAULT, | 981 EXPECT_EQ(NSSCertDatabase::TRUST_DEFAULT, |
982 cert_db_->GetCertTrust(certs2[0].get(), SERVER_CERT)); | 982 cert_db_->GetCertTrust(certs2[0].get(), SERVER_CERT)); |
983 | 983 |
984 new_certs = ListCerts(); | 984 new_certs = ListCerts(); |
985 ASSERT_EQ(2U, new_certs.size()); | 985 ASSERT_EQ(2U, new_certs.size()); |
986 EXPECT_STRNE(new_certs[0]->os_cert_handle()->nickname, | 986 EXPECT_STRNE(new_certs[0]->os_cert_handle()->nickname, |
987 new_certs[1]->os_cert_handle()->nickname); | 987 new_certs[1]->os_cert_handle()->nickname); |
988 } | 988 } |
989 | 989 |
990 } // namespace net | 990 } // namespace net |
OLD | NEW |