| 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 #ifndef NET_CERT_X509_UTIL_MAC_H_ | 5 #ifndef NET_CERT_X509_UTIL_MAC_H_ |
| 6 #define NET_CERT_X509_UTIL_MAC_H_ | 6 #define NET_CERT_X509_UTIL_MAC_H_ |
| 7 | 7 |
| 8 #include <CoreFoundation/CFArray.h> | 8 #include <CoreFoundation/CFArray.h> |
| 9 #include <Security/Security.h> | 9 #include <Security/Security.h> |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 SecPolicyRef* policy); | 36 SecPolicyRef* policy); |
| 37 | 37 |
| 38 // Creates a security policy for basic X.509 validation. If the policy is | 38 // Creates a security policy for basic X.509 validation. If the policy is |
| 39 // successfully created, it will be stored in |*policy| and ownership | 39 // successfully created, it will be stored in |*policy| and ownership |
| 40 // transferred to the caller. | 40 // transferred to the caller. |
| 41 OSStatus NET_EXPORT CreateBasicX509Policy(SecPolicyRef* policy); | 41 OSStatus NET_EXPORT CreateBasicX509Policy(SecPolicyRef* policy); |
| 42 | 42 |
| 43 // Creates security policies to control revocation checking (OCSP and CRL). | 43 // Creates security policies to control revocation checking (OCSP and CRL). |
| 44 // If |enable_revocation_checking| is true, revocation checking will be | 44 // If |enable_revocation_checking| is true, revocation checking will be |
| 45 // explicitly enabled. | 45 // explicitly enabled. |
| 46 // If |enable_revocation_checking| is false, but |enable_ev_checking| is | 46 // Otherwise, the policies returned will be explicitly prohibited from accessing |
| 47 // true, then the system policies for EV checking (which include checking | 47 // the network or the local cache, if possible. |
| 48 // for an online OCSP response) will be permitted. However, if the OS | |
| 49 // does not believe the certificate is EV, no revocation checking will be | |
| 50 // performed. | |
| 51 // If both are false, then the policies returned will be explicitly | |
| 52 // prohibited from accessing the network or the local cache, regardless of | |
| 53 // system settings. | |
| 54 // If the policies are successfully created, they will be appended to | 48 // If the policies are successfully created, they will be appended to |
| 55 // |policies|. | 49 // |policies|. |
| 56 OSStatus NET_EXPORT CreateRevocationPolicies(bool enable_revocation_checking, | 50 OSStatus NET_EXPORT CreateRevocationPolicies(bool enable_revocation_checking, |
| 57 bool enable_ev_checking, | |
| 58 CFMutableArrayRef policies); | 51 CFMutableArrayRef policies); |
| 59 | 52 |
| 60 // CSSM functions are deprecated as of OSX 10.7, but have no replacement. | 53 // CSSM functions are deprecated as of OSX 10.7, but have no replacement. |
| 61 // https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 | 54 // https://bugs.chromium.org/p/chromium/issues/detail?id=590914#c1 |
| 62 #pragma clang diagnostic push | 55 #pragma clang diagnostic push |
| 63 #pragma clang diagnostic ignored "-Wdeprecated-declarations" | 56 #pragma clang diagnostic ignored "-Wdeprecated-declarations" |
| 64 | 57 |
| 65 // Wrapper for a CSSM_DATA_PTR that was obtained via one of the CSSM field | 58 // Wrapper for a CSSM_DATA_PTR that was obtained via one of the CSSM field |
| 66 // accessors (such as CSSM_CL_CertGet[First/Next]Value or | 59 // accessors (such as CSSM_CL_CertGet[First/Next]Value or |
| 67 // CSSM_CL_CertGet[First/Next]CachedValue). | 60 // CSSM_CL_CertGet[First/Next]CachedValue). |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 CSSM_HANDLE cached_cert_handle_; | 130 CSSM_HANDLE cached_cert_handle_; |
| 138 }; | 131 }; |
| 139 | 132 |
| 140 #pragma clang diagnostic pop // "-Wdeprecated-declarations" | 133 #pragma clang diagnostic pop // "-Wdeprecated-declarations" |
| 141 | 134 |
| 142 } // namespace x509_util | 135 } // namespace x509_util |
| 143 | 136 |
| 144 } // namespace net | 137 } // namespace net |
| 145 | 138 |
| 146 #endif // NET_CERT_X509_UTIL_MAC_H_ | 139 #endif // NET_CERT_X509_UTIL_MAC_H_ |
| OLD | NEW |