Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: net/cert/test_keychain_search_list_mac.cc

Issue 2101303005: CertVerifyProcMac: Add Keychain re-ordering hack, check CRLsets in path pruning loop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review changes and url_request_unittest fixes Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/cert/test_keychain_search_list_mac.h"
6
7 #include "base/memory/ptr_util.h"
8
9 namespace net {
10
11 namespace {
12
13 TestKeychainSearchList* g_test_keychain_search_list = nullptr;
14
15 } // namespace
16
17 TestKeychainSearchList::TestKeychainSearchList() {
18 g_test_keychain_search_list = this;
19 scoped_keychain_search_list.reset(
20 CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
21 }
22
23 TestKeychainSearchList::~TestKeychainSearchList() {
24 g_test_keychain_search_list = nullptr;
25 }
26
27 // static
28 std::unique_ptr<TestKeychainSearchList> TestKeychainSearchList::Create() {
29 if (g_test_keychain_search_list)
30 return nullptr;
31 return base::WrapUnique(new TestKeychainSearchList);
32 }
33
34 // static
35 bool TestKeychainSearchList::HasInstance() {
36 return !!g_test_keychain_search_list;
37 }
38
39 // static
40 TestKeychainSearchList* TestKeychainSearchList::GetInstance() {
41 return g_test_keychain_search_list;
42 }
43
44 OSStatus TestKeychainSearchList::CopySearchList(
45 CFArrayRef* keychain_search_list) const {
46 *keychain_search_list =
47 CFArrayCreateCopy(kCFAllocatorDefault, scoped_keychain_search_list.get());
48 return *keychain_search_list ? 0 : errSecAllocate;
49 }
50
51 void TestKeychainSearchList::AddKeychain(SecKeychainRef keychain) {
52 CFArrayAppendValue(scoped_keychain_search_list.get(), keychain);
53 }
54
55 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698