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/ev_root_ca_metadata.h" | 5 #include "net/cert/ev_root_ca_metadata.h" |
6 | 6 |
7 #if defined(USE_NSS_CERTS) | 7 #if defined(USE_NSS_CERTS) |
8 #include <cert.h> | 8 #include <cert.h> |
9 #include <pkcs11n.h> | 9 #include <pkcs11n.h> |
10 #include <secerr.h> | 10 #include <secerr.h> |
11 #include <secoid.h> | 11 #include <secoid.h> |
12 #elif defined(OS_WIN) | 12 #elif defined(OS_WIN) |
13 #include <stdlib.h> | 13 #include <stdlib.h> |
14 #endif | 14 #endif |
15 | 15 |
16 #include "base/lazy_instance.h" | 16 #include "base/lazy_instance.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #if defined(USE_NSS_CERTS) | 18 #if defined(USE_NSS_CERTS) |
19 #include "crypto/nss_util.h" | 19 #include "crypto/nss_util.h" |
20 #endif | 20 #endif |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 | 23 |
24 #if defined(USE_NSS_CERTS) || defined(OS_WIN) | 24 #if defined(USE_NSS_CERTS) || defined(OS_WIN) |
25 // Raw metadata. | 25 // Raw metadata. |
26 struct EVMetadata { | 26 struct EVMetadata { |
27 // kMaxOIDsPerCA is the number of OIDs that we can support per root CA. At | 27 // kMaxOIDsPerCA is the number of OIDs that we can support per root CA. At |
28 // least one CA has different EV policies for businuss vs government | 28 // least one CA has different EV policies for business vs government |
29 // entities and, in the case of cross-signing, we might need to list another | 29 // entities and, in the case of cross-signing, we might need to list another |
30 // CA's policy OID under the cross-signing root. | 30 // CA's policy OID under the cross-signing root. |
31 static const size_t kMaxOIDsPerCA = 2; | 31 static const size_t kMaxOIDsPerCA = 2; |
32 // This is the maximum length of an OID string (including the trailing NUL). | 32 // This is the maximum length of an OID string (including the trailing NUL). |
33 static const size_t kMaxOIDLength = 32; | 33 static const size_t kMaxOIDLength = 32; |
34 | 34 |
35 // The SHA-1 fingerprint of the root CA certificate, used as a unique | 35 // The SHA-1 fingerprint of the root CA certificate, used as a unique |
36 // identifier for a root CA certificate. | 36 // identifier for a root CA certificate. |
37 SHA1HashValue fingerprint; | 37 SHA1HashValue fingerprint; |
38 | 38 |
39 // The EV policy OIDs of the root CA. | 39 // The EV policy OIDs of the root CA. |
40 const char policy_oids[kMaxOIDsPerCA][kMaxOIDLength]; | 40 const char policy_oids[kMaxOIDsPerCA][kMaxOIDLength]; |
41 }; | 41 }; |
42 | 42 |
43 static const EVMetadata ev_root_ca_metadata[] = { | 43 static const EVMetadata ev_root_ca_metadata[] = { |
44 // AC Camerfirma S.A. Chambers of Commerce Root - 2008 | 44 // AC Camerfirma S.A. Chambers of Commerce Root - 2008 |
45 // https://www.camerfirma.com | 45 // https://www.camerfirma.com |
46 { | 46 { |
47 {{0x78, 0x6a, 0x74, 0xac, 0x76, 0xab, 0x14, 0x7f, 0x9c, 0x6a, | 47 {{0x78, 0x6a, 0x74, 0xac, 0x76, 0xab, 0x14, 0x7f, 0x9c, 0x6a, |
48 0x30, 0x50, 0xba, 0x9e, 0xa8, 0x7e, 0xfe, 0x9a, 0xce, 0x3c}}, | 48 0x30, 0x50, 0xba, 0x9e, 0xa8, 0x7e, 0xfe, 0x9a, 0xce, 0x3c}}, |
49 { | 49 { |
50 // AC Camerfirma uses the last two arcs to track how the private key | 50 // AC Camerfirma uses the last two arcs to track how the private key |
51 // is | 51 // is managed - the effective verification policy is the same. |
52 // managed - the effective verification policy is the same. | |
53 "1.3.6.1.4.1.17326.10.14.2.1.2", "1.3.6.1.4.1.17326.10.14.2.2.2", | 52 "1.3.6.1.4.1.17326.10.14.2.1.2", "1.3.6.1.4.1.17326.10.14.2.2.2", |
54 }, | 53 }, |
55 }, | 54 }, |
56 // AC Camerfirma S.A. Global Chambersign Root - 2008 | 55 // AC Camerfirma S.A. Global Chambersign Root - 2008 |
57 // https://server2.camerfirma.com:8082 | 56 // https://server2.camerfirma.com:8082 |
58 { | 57 { |
59 {{0x4a, 0xbd, 0xee, 0xec, 0x95, 0x0d, 0x35, 0x9c, 0x89, 0xae, | 58 {{0x4a, 0xbd, 0xee, 0xec, 0x95, 0x0d, 0x35, 0x9c, 0x89, 0xae, |
60 0xc7, 0x52, 0xa1, 0x2c, 0x5b, 0x29, 0xf6, 0xd6, 0xaa, 0x0c}}, | 59 0xc7, 0x52, 0xa1, 0x2c, 0x5b, 0x29, 0xf6, 0xd6, 0xaa, 0x0c}}, |
61 { | 60 { |
62 // AC Camerfirma uses the last two arcs to track how the private key | 61 // AC Camerfirma uses the last two arcs to track how the private key |
63 // is | 62 // is managed - the effective verification policy is the same. |
64 // managed - the effective verification policy is the same. | |
65 "1.3.6.1.4.1.17326.10.8.12.1.2", "1.3.6.1.4.1.17326.10.8.12.2.2", | 63 "1.3.6.1.4.1.17326.10.8.12.1.2", "1.3.6.1.4.1.17326.10.8.12.2.2", |
66 }, | 64 }, |
67 }, | 65 }, |
68 // AddTrust External CA Root | 66 // AddTrust External CA Root |
69 // https://addtrustexternalcaroot-ev.comodoca.com | 67 // https://addtrustexternalcaroot-ev.comodoca.com |
70 { | 68 { |
71 {{0x02, 0xfa, 0xf3, 0xe2, 0x91, 0x43, 0x54, 0x68, 0x60, 0x78, | 69 {{0x02, 0xfa, 0xf3, 0xe2, 0x91, 0x43, 0x54, 0x68, 0x60, 0x78, |
72 0x57, 0x69, 0x4d, 0xf5, 0xe4, 0x5b, 0x68, 0x85, 0x18, 0x68}}, | 70 0x57, 0x69, 0x4d, 0xf5, 0xe4, 0x5b, 0x68, 0x85, 0x18, 0x68}}, |
73 { | 71 { |
74 "1.3.6.1.4.1.6449.1.2.1.5.1", | 72 "1.3.6.1.4.1.6449.1.2.1.5.1", |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 ev_policy_[metadata.fingerprint].push_back(policy); | 745 ev_policy_[metadata.fingerprint].push_back(policy); |
748 policy_oids_.insert(policy); | 746 policy_oids_.insert(policy); |
749 } | 747 } |
750 } | 748 } |
751 #endif | 749 #endif |
752 } | 750 } |
753 | 751 |
754 EVRootCAMetadata::~EVRootCAMetadata() { } | 752 EVRootCAMetadata::~EVRootCAMetadata() { } |
755 | 753 |
756 } // namespace net | 754 } // namespace net |
OLD | NEW |