OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chromeos/network/onc/onc_certificate_importer_impl.h" | 5 #include "chromeos/network/onc/onc_certificate_importer_impl.h" |
6 | 6 |
7 #include <cert.h> | 7 #include <cert.h> |
8 #include <certdb.h> | 8 #include <certdb.h> |
9 #include <keyhi.h> | 9 #include <keyhi.h> |
10 #include <pk11pub.h> | 10 #include <pk11pub.h> |
(...skipping 28 matching lines...) Expand all Loading... |
39 unsigned all_flags = trust.sslFlags | trust.emailFlags | | 39 unsigned all_flags = trust.sslFlags | trust.emailFlags | |
40 trust.objectSigningFlags; | 40 trust.objectSigningFlags; |
41 | 41 |
42 if (cert->nickname && (all_flags & CERTDB_USER)) | 42 if (cert->nickname && (all_flags & CERTDB_USER)) |
43 return net::USER_CERT; | 43 return net::USER_CERT; |
44 if ((all_flags & CERTDB_VALID_CA) || CERT_IsCACert(cert, NULL)) | 44 if ((all_flags & CERTDB_VALID_CA) || CERT_IsCACert(cert, NULL)) |
45 return net::CA_CERT; | 45 return net::CA_CERT; |
46 // TODO(mattm): http://crbug.com/128633. | 46 // TODO(mattm): http://crbug.com/128633. |
47 if (trust.sslFlags & CERTDB_TERMINAL_RECORD) | 47 if (trust.sslFlags & CERTDB_TERMINAL_RECORD) |
48 return net::SERVER_CERT; | 48 return net::SERVER_CERT; |
49 return net::UNKNOWN_CERT; | 49 return net::OTHER_CERT; |
50 } | 50 } |
51 #else | 51 #else |
52 net::CertType GetCertType(net::X509Certificate::OSCertHandle cert) { | 52 net::CertType GetCertType(net::X509Certificate::OSCertHandle cert) { |
53 NOTIMPLEMENTED(); | 53 NOTIMPLEMENTED(); |
54 return net::UNKNOWN_CERT; | 54 return net::OTHER_CERT; |
55 } | 55 } |
56 #endif // USE_NSS | 56 #endif // USE_NSS |
57 | 57 |
58 class ONCCertificateImporterImplTest : public testing::Test { | 58 class ONCCertificateImporterImplTest : public testing::Test { |
59 public: | 59 public: |
60 virtual void SetUp() { | 60 virtual void SetUp() { |
61 ASSERT_TRUE(test_nssdb_.is_open()); | 61 ASSERT_TRUE(test_nssdb_.is_open()); |
62 | 62 |
63 slot_ = net::NSSCertDatabase::GetInstance()->GetPublicModule(); | 63 slot_ = net::NSSCertDatabase::GetInstance()->GetPublicModule(); |
64 | 64 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 "certificate-client-update.onc"), | 312 "certificate-client-update.onc"), |
313 CertParam(net::SERVER_CERT, | 313 CertParam(net::SERVER_CERT, |
314 "certificate-server.onc", | 314 "certificate-server.onc", |
315 "certificate-server-update.onc"), | 315 "certificate-server-update.onc"), |
316 CertParam(net::CA_CERT, | 316 CertParam(net::CA_CERT, |
317 "certificate-web-authority.onc", | 317 "certificate-web-authority.onc", |
318 "certificate-web-authority-update.onc"))); | 318 "certificate-web-authority-update.onc"))); |
319 | 319 |
320 } // namespace onc | 320 } // namespace onc |
321 } // namespace chromeos | 321 } // namespace chromeos |
OLD | NEW |