]> git.saurik.com Git - apple/security.git/blame - OSX/sec/Security/ios_tapi_hacks.h
Security-58286.270.3.0.1.tar.gz
[apple/security.git] / OSX / sec / Security / ios_tapi_hacks.h
CommitLineData
ecaf5866
A
1/*
2 * Copyright (c) 2017 Apple Inc. All Rights Reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23#ifndef ios_tapi_hack_h
24#define ios_tapi_hack_h
25
26// This file is to work around TAPI's insistence that every exported symbol is in a header file.
27// The Security project just simply rejects such ideas, so this is the pressure valve:
28//
29// One-offs in header files that shouldn't be exported in the real-live iOS Security framework
30// can be added here, and TAPI will accept them.
31//
32// Please don't add anything here.
33
34#ifndef SECURITY_PROJECT_TAPI_HACKS
35#error This header is not for inclusion; it's a nasty hack to get the iOS Security framework to build with TAPI.
36#endif
37
38#include <sqlite3.h>
39#include <xpc/xpc.h>
40
41CFDataRef SecDistinguishedNameCopyNormalizedContent(CFDataRef distinguished_name);
42CFDataRef _SecItemCreatePersistentRef(CFTypeRef iclass, sqlite_int64 rowid, CFDictionaryRef attributes);
43CFDictionaryRef SecTokenItemValueCopy(CFDataRef db_value, CFErrorRef *error);
44CFArrayRef SecItemCopyParentCertificates_ios(CFDataRef normalizedIssuer, CFArrayRef accessGroups, CFErrorRef *error);
45bool SecItemCertificateExists(CFDataRef normalizedIssuer, CFDataRef serialNumber, CFArrayRef accessGroups, CFErrorRef *error);
46bool _SecItemParsePersistentRef(CFDataRef persistent_ref, CFStringRef *return_class,
47 sqlite_int64 *return_rowid, CFDictionaryRef *return_token_attrs);
48
49// SecItemPriv.h
50extern const CFStringRef kSecUseSystemKeychain;
51
52// securityd_client.h
53
54typedef struct SecurityClient {
55} SecurityClient;
56
57extern struct securityd *gSecurityd;
58extern struct trustd *gTrustd;
59extern SecurityClient * SecSecurityClientGet(void);
60bool securityd_send_sync_and_do(enum SecXPCOperation op, CFErrorRef *error,
61 bool (^add_to_message)(xpc_object_t message, CFErrorRef* error),
62 bool (^handle_response)(xpc_object_t response, CFErrorRef* error));
79b9da22
A
63typedef void (^securityd_handler_t)(xpc_object_t reply, CFErrorRef error);
64void securityd_send_async_and_do(enum SecXPCOperation op, dispatch_queue_t replyq,
65 bool (^add_to_message)(xpc_object_t message, CFErrorRef* error),
66 securityd_handler_t handler);
ecaf5866
A
67XPC_RETURNS_RETAINED xpc_object_t securityd_message_with_reply_sync(xpc_object_t message, CFErrorRef *error);
68XPC_RETURNS_RETAINED xpc_object_t securityd_create_message(enum SecXPCOperation op, CFErrorRef *error);
69bool securityd_message_no_error(xpc_object_t message, CFErrorRef *error);
70
71@interface SecuritydXPCClient : NSObject
72@end
73
74void SecAccessGroupsSetCurrent(CFArrayRef accessGroups);
75CFArrayRef SecAccessGroupsGetCurrent(void);
76
77#include <os/log_private.h>
78extern os_log_t secLogObjForScope(const char *scope);
79extern os_log_t secLogObjForCFScope(CFStringRef scope);
80#if TARGET_OS_IOS
81void SecSecuritySetMusrMode(bool mode, uid_t uid, int activeUser);
82#endif // TARGET_OS_IOS
83
29734401 84void SecServerSetTrustdMachServiceName(const char *name);
ecaf5866
A
85
86#endif /* ios_tapi_hacks_h */
87