| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_INTERNAL_TRUST_STORE_MAC_H_ | 5 #ifndef NET_CERT_INTERNAL_TRUST_STORE_MAC_H_ |
| 6 #define NET_CERT_INTERNAL_TRUST_STORE_MAC_H_ | 6 #define NET_CERT_INTERNAL_TRUST_STORE_MAC_H_ |
| 7 | 7 |
| 8 #include <CoreFoundation/CoreFoundation.h> | 8 #include <CoreFoundation/CoreFoundation.h> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // |policy_oid|. For list of possible policy values, see: | 24 // |policy_oid|. For list of possible policy values, see: |
| 25 // https://developer.apple.com/reference/security/1667150-certificate_key_and_
trust_servic/1670151-standard_policies_for_specific_c?language=objc | 25 // https://developer.apple.com/reference/security/1667150-certificate_key_and_
trust_servic/1670151-standard_policies_for_specific_c?language=objc |
| 26 // TODO(mattm): policy oids are actually CFStrings, but the constants are | 26 // TODO(mattm): policy oids are actually CFStrings, but the constants are |
| 27 // defined as CFTypeRef in older SDK versions. Change |policy_oid| type to | 27 // defined as CFTypeRef in older SDK versions. Change |policy_oid| type to |
| 28 // const CFStringRef when Chromium switches to building against the 10.11 SDK | 28 // const CFStringRef when Chromium switches to building against the 10.11 SDK |
| 29 // (or newer). | 29 // (or newer). |
| 30 explicit TrustStoreMac(CFTypeRef policy_oid); | 30 explicit TrustStoreMac(CFTypeRef policy_oid); |
| 31 ~TrustStoreMac() override; | 31 ~TrustStoreMac() override; |
| 32 | 32 |
| 33 // TrustStore implementation: | 33 // TrustStore implementation: |
| 34 void FindTrustAnchorsForCert(const scoped_refptr<ParsedCertificate>& cert, | 34 void FindIssuers(const scoped_refptr<ParsedCertificate>& cert, |
| 35 TrustAnchors* matches) const override; | 35 TrustAnchors* trust_anchors, |
| 36 ParsedCertificateList* intermediates) const override; |
| 37 bool IsBlacklisted( |
| 38 const scoped_refptr<ParsedCertificate>& cert) const override; |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 FRIEND_TEST_ALL_PREFIXES(TrustStoreMacTest, MultiRootNotTrusted); | 41 FRIEND_TEST_ALL_PREFIXES(TrustStoreMacTest, MultiRootNotTrusted); |
| 39 FRIEND_TEST_ALL_PREFIXES(TrustStoreMacTest, SystemCerts); | 42 FRIEND_TEST_ALL_PREFIXES(TrustStoreMacTest, SystemCerts); |
| 40 | 43 |
| 41 // Finds certificates in the OS keychains whose Subject matches |name_data|. | 44 // Finds certificates in the OS keychains whose Subject matches |name_data|. |
| 42 // The result is an array of SecCertificateRef. | 45 // The result is an array of SecCertificateRef. |
| 43 static base::ScopedCFTypeRef<CFArrayRef> | 46 static base::ScopedCFTypeRef<CFArrayRef> |
| 44 FindMatchingCertificatesForMacNormalizedSubject(CFDataRef name_data); | 47 FindMatchingCertificatesForMacNormalizedSubject(CFDataRef name_data); |
| 45 | 48 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 56 TrustAnchors* matches) const; | 59 TrustAnchors* matches) const; |
| 57 | 60 |
| 58 const CFStringRef policy_oid_; | 61 const CFStringRef policy_oid_; |
| 59 | 62 |
| 60 DISALLOW_COPY_AND_ASSIGN(TrustStoreMac); | 63 DISALLOW_COPY_AND_ASSIGN(TrustStoreMac); |
| 61 }; | 64 }; |
| 62 | 65 |
| 63 } // namespace net | 66 } // namespace net |
| 64 | 67 |
| 65 #endif // NET_CERT_INTERNAL_TRUST_STORE_MAC_H_ | 68 #endif // NET_CERT_INTERNAL_TRUST_STORE_MAC_H_ |
| OLD | NEW |