2 * Copyright (c) 2002-2008, 2010-2015, 2017 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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
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.
21 * @APPLE_LICENSE_HEADER_END@
25 * Modification History
27 * October 31, 2000 Allan Nathanson <ajn@apple.com>
32 #include <sys/types.h>
33 #include <sys/param.h>
36 #include <mach-o/dyld_priv.h>
38 #include <CoreFoundation/CFRuntime.h>
39 #include "dy_framework.h"
43 _SC_dlopen(const char *framework
)
46 static dispatch_once_t once
;
47 static const char *suffix
= NULL
;
49 dispatch_once(&once
, ^{
50 if (!dyld_process_is_restricted()) {
51 suffix
= getenv("DYLD_IMAGE_SUFFIX");
52 if ((suffix
!= NULL
) &&
53 ((strlen(suffix
) < 2) || (suffix
[0] != '_'))) {
54 // if too short or no leading "_"
62 char path
[MAXPATHLEN
];
64 strlcpy(path
, framework
, sizeof(path
));
65 strlcat(path
, suffix
, sizeof(path
));
66 if (0 <= stat(path
, &statbuf
)) {
67 image
= dlopen(path
, RTLD_LAZY
| RTLD_LOCAL
);
72 image
= dlopen(framework
, RTLD_LAZY
| RTLD_LOCAL
);
78 #pragma mark IOKit.framework APIs
82 static void *image
= NULL
;
83 static dispatch_once_t once
;
85 dispatch_once(&once
, ^{
86 image
= _SC_dlopen("/System/Library/Frameworks/IOKit.framework/IOKit");
93 __private_extern__ CFMutableDictionaryRef
94 _IOBSDNameMatching(mach_port_t masterPort
, uint32_t options
, const char *bsdName
)
96 #undef IOBSDNameMatching
97 static typeof (IOBSDNameMatching
) *dyfunc
= NULL
;
99 void *image
= __loadIOKit();
100 if (image
) dyfunc
= dlsym(image
, "IOBSDNameMatching");
102 return dyfunc
? dyfunc(masterPort
, options
, bsdName
) : NULL
;
106 __private_extern__ io_object_t
107 _IOIteratorNext(io_iterator_t iterator
)
109 #undef IOIteratorNext
110 static typeof (IOIteratorNext
) *dyfunc
= NULL
;
112 void *image
= __loadIOKit();
113 if (image
) dyfunc
= dlsym(image
, "IOIteratorNext");
115 return dyfunc
? dyfunc(iterator
) : 0;
119 __private_extern__ kern_return_t
120 _IOMasterPort(mach_port_t bootstrapPort
, mach_port_t
*masterPort
)
123 static typeof (IOMasterPort
) *dyfunc
= NULL
;
125 void *image
= __loadIOKit();
126 if (image
) dyfunc
= dlsym(image
, "IOMasterPort");
128 return dyfunc
? dyfunc(bootstrapPort
, masterPort
) : KERN_FAILURE
;
132 __private_extern__ boolean_t
133 _IOObjectConformsTo(io_object_t object
, const io_name_t className
)
135 #undef IOObjectConformsTo
136 static typeof (IOObjectConformsTo
) *dyfunc
= NULL
;
138 void *image
= __loadIOKit();
139 if (image
) dyfunc
= dlsym(image
, "IOObjectConformsTo");
141 return dyfunc
? dyfunc(object
, className
) : FALSE
;
145 __private_extern__ boolean_t
146 _IOObjectGetClass(io_object_t object
, io_name_t className
)
148 #undef IOObjectGetClass
149 static typeof (IOObjectGetClass
) *dyfunc
= NULL
;
151 void *image
= __loadIOKit();
152 if (image
) dyfunc
= dlsym(image
, "IOObjectGetClass");
154 return dyfunc
? dyfunc(object
, className
) : FALSE
;
158 __private_extern__ kern_return_t
159 _IOObjectRelease(io_object_t object
)
161 #undef IOObjectRelease
162 static typeof (IOObjectRelease
) *dyfunc
= NULL
;
164 void *image
= __loadIOKit();
165 if (image
) dyfunc
= dlsym(image
, "IOObjectRelease");
167 return dyfunc
? dyfunc(object
) : KERN_FAILURE
;
171 #if !TARGET_OS_IPHONE
173 __private_extern__ IOReturn
174 _IOPMConnectionAcknowledgeEvent(IOPMConnection myConnection
, IOPMConnectionMessageToken token
)
176 #undef IOPMConnectionAcknowledgeEvent
177 static typeof (IOPMConnectionAcknowledgeEvent
) *dyfunc
= NULL
;
179 void *image
= __loadIOKit();
180 if (image
) dyfunc
= dlsym(image
, "IOPMConnectionAcknowledgeEvent");
182 return dyfunc
? dyfunc(myConnection
, token
) : kIOReturnError
;
186 __private_extern__ IOReturn
187 _IOPMConnectionCreate(CFStringRef myName
, IOPMCapabilityBits interests
, IOPMConnection
*newConnection
)
189 #undef IOPMConnectionCreate
190 static typeof (IOPMConnectionCreate
) *dyfunc
= NULL
;
192 void *image
= __loadIOKit();
193 if (image
) dyfunc
= dlsym(image
, "IOPMConnectionCreate");
195 return dyfunc
? dyfunc(myName
, interests
, newConnection
) : kIOReturnError
;
199 __private_extern__ IOPMCapabilityBits
200 _IOPMConnectionGetSystemCapabilities(void)
202 #undef IOPMConnectionGetSystemCapabilities
203 static typeof (IOPMConnectionGetSystemCapabilities
) *dyfunc
= NULL
;
205 void *image
= __loadIOKit();
206 if (image
) dyfunc
= dlsym(image
, "IOPMConnectionGetSystemCapabilities");
208 return dyfunc
? dyfunc() : kIOPMSleepWakeInterest
;
212 __private_extern__ IOReturn
213 _IOPMConnectionRelease(IOPMConnection myConnection
)
215 #undef IOPMConnectionRelease
216 static typeof (IOPMConnectionRelease
) *dyfunc
= NULL
;
218 void *image
= __loadIOKit();
219 if (image
) dyfunc
= dlsym(image
, "IOPMConnectionRelease");
221 return dyfunc
? dyfunc(myConnection
) : kIOReturnError
;
225 __private_extern__
void
226 _IOPMConnectionSetDispatchQueue(IOPMConnection myConnection
, dispatch_queue_t myQueue
)
228 #undef IOPMConnectionSetDispatchQueue
229 static typeof (IOPMConnectionSetDispatchQueue
) *dyfunc
= NULL
;
231 void *image
= __loadIOKit();
232 if (image
) dyfunc
= dlsym(image
, "IOPMConnectionSetDispatchQueue");
235 dyfunc(myConnection
, myQueue
);
241 __private_extern__ IOReturn
242 _IOPMConnectionSetNotification(IOPMConnection myConnection
, void *param
, IOPMEventHandlerType handler
)
244 #undef IOPMConnectionSetNotification
245 static typeof (IOPMConnectionSetNotification
) *dyfunc
= NULL
;
247 void *image
= __loadIOKit();
248 if (image
) dyfunc
= dlsym(image
, "IOPMConnectionSetNotification");
250 return dyfunc
? dyfunc(myConnection
, param
, handler
) : kIOReturnError
;
253 #endif // !TARGET_OS_IPHONE
256 __private_extern__ CFTypeRef
257 _IORegistryEntryCreateCFProperty(io_registry_entry_t entry
, CFStringRef key
, CFAllocatorRef allocator
, IOOptionBits options
)
259 #undef IORegistryEntryCreateCFProperty
260 static typeof (IORegistryEntryCreateCFProperty
) *dyfunc
= NULL
;
262 void *image
= __loadIOKit();
263 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryCreateCFProperty");
265 return dyfunc
? dyfunc(entry
, key
, allocator
, options
) : NULL
;
269 __private_extern__ kern_return_t
270 _IORegistryEntryCreateCFProperties(io_registry_entry_t entry
, CFMutableDictionaryRef
*properties
, CFAllocatorRef allocator
, IOOptionBits options
)
272 #undef IORegistryEntryCreateCFProperties
273 static typeof (IORegistryEntryCreateCFProperties
) *dyfunc
= NULL
;
275 void *image
= __loadIOKit();
276 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryCreateCFProperties");
278 return dyfunc
? dyfunc(entry
, properties
, allocator
, options
) : KERN_FAILURE
;
282 __private_extern__ kern_return_t
283 _IORegistryEntryCreateIterator(mach_port_t masterPort
, const io_name_t plane
, IOOptionBits options
, io_iterator_t
*iterator
)
285 #undef IORegistryEntryCreateIterator
286 static typeof (IORegistryEntryCreateIterator
) *dyfunc
= NULL
;
288 void *image
= __loadIOKit();
289 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryCreateIterator");
291 return dyfunc
? dyfunc(masterPort
, plane
, options
, iterator
) : KERN_FAILURE
;
295 __private_extern__ kern_return_t
296 _IORegistryEntryGetLocationInPlane(io_registry_entry_t entry
, const io_name_t plane
, io_name_t location
)
298 #undef IORegistryEntryGetLocationInPlane
299 static typeof (IORegistryEntryGetLocationInPlane
) *dyfunc
= NULL
;
301 void *image
= __loadIOKit();
302 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryGetLocationInPlane");
304 return dyfunc
? dyfunc(entry
, plane
, location
) : KERN_FAILURE
;
308 __private_extern__ kern_return_t
309 _IORegistryEntryGetName(io_registry_entry_t entry
, io_name_t name
)
311 #undef IORegistryEntryGetName
312 static typeof (IORegistryEntryGetName
) *dyfunc
= NULL
;
314 void *image
= __loadIOKit();
315 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryGetName");
317 return dyfunc
? dyfunc(entry
, name
) : KERN_FAILURE
;
321 __private_extern__ kern_return_t
322 _IORegistryEntryGetNameInPlane(io_registry_entry_t entry
, const io_name_t plane
, io_name_t name
)
324 #undef IORegistryEntryGetNameInPlane
325 static typeof (IORegistryEntryGetNameInPlane
) *dyfunc
= NULL
;
327 void *image
= __loadIOKit();
328 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryGetNameInPlane");
330 return dyfunc
? dyfunc(entry
, plane
, name
) : KERN_FAILURE
;
334 __private_extern__ kern_return_t
335 _IORegistryEntryGetParentEntry(io_registry_entry_t entry
, const io_name_t plane
, io_registry_entry_t
*parent
)
337 #undef IORegistryEntryGetParentEntry
338 static typeof (IORegistryEntryGetParentEntry
) *dyfunc
= NULL
;
340 void *image
= __loadIOKit();
341 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryGetParentEntry");
343 return dyfunc
? dyfunc(entry
, plane
, parent
) : KERN_FAILURE
;
347 __private_extern__ kern_return_t
348 _IORegistryEntryGetPath(io_registry_entry_t entry
, const io_name_t plane
, io_string_t path
)
350 #undef IORegistryEntryGetPath
351 static typeof (IORegistryEntryGetPath
) *dyfunc
= NULL
;
353 void *image
= __loadIOKit();
354 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryGetPath");
356 return dyfunc
? dyfunc(entry
, plane
, path
) : KERN_FAILURE
;
360 __private_extern__ kern_return_t
361 _IORegistryEntryGetRegistryEntryID(io_registry_entry_t entry
, uint64_t *entryID
)
363 #undef IORegistryEntryGetRegistryEntryID
364 static typeof (IORegistryEntryGetRegistryEntryID
) *dyfunc
= NULL
;
366 void *image
= __loadIOKit();
367 if (image
) dyfunc
= dlsym(image
, "IORegistryEntryGetRegistryEntryID");
369 return dyfunc
? dyfunc(entry
, entryID
) : KERN_FAILURE
;
373 __private_extern__ CFTypeRef
374 _IORegistryEntrySearchCFProperty(io_registry_entry_t entry
, const io_name_t plane
, CFStringRef key
, CFAllocatorRef allocator
, IOOptionBits options
)
376 #undef IORegistryEntrySearchCFProperty
377 static typeof (IORegistryEntrySearchCFProperty
) *dyfunc
= NULL
;
379 void *image
= __loadIOKit();
380 if (image
) dyfunc
= dlsym(image
, "IORegistryEntrySearchCFProperty");
382 return dyfunc
? dyfunc(entry
, plane
, key
, allocator
, options
) : NULL
;
386 __private_extern__ kern_return_t
387 _IOServiceGetMatchingServices(mach_port_t masterPort
, CFDictionaryRef matching
, io_iterator_t
*existing
)
389 #undef IOServiceGetMatchingServices
390 static typeof (IOServiceGetMatchingServices
) *dyfunc
= NULL
;
392 void *image
= __loadIOKit();
393 if (image
) dyfunc
= dlsym(image
, "IOServiceGetMatchingServices");
395 return dyfunc
? dyfunc(masterPort
, matching
, existing
) : KERN_FAILURE
;
399 __private_extern__ CFMutableDictionaryRef
400 _IOServiceMatching(const char *name
)
402 #undef IOServiceMatching
403 static typeof (IOServiceMatching
) *dyfunc
= NULL
;
405 void *image
= __loadIOKit();
406 if (image
) dyfunc
= dlsym(image
, "IOServiceMatching");
408 return dyfunc
? dyfunc(name
) : NULL
;
412 #pragma mark Security.framework APIs
415 __loadSecurity(void) {
416 static void *image
= NULL
;
417 static dispatch_once_t once
;
419 dispatch_once(&once
, ^{
420 image
= _SC_dlopen("/System/Library/Frameworks/Security.framework/Security");
426 #define SECURITY_FRAMEWORK_EXTERN(t, s) \
427 __private_extern__ t \
430 static t *dysym = NULL; \
432 void *image = __loadSecurity(); \
433 if (image) dysym = dlsym(image, #s ); \
435 return (dysym != NULL) ? *dysym : NULL; \
438 #if !TARGET_OS_IPHONE
439 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecAttrService
)
440 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecClass
)
441 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecClassGenericPassword
)
442 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecMatchLimit
)
443 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecMatchLimitAll
)
444 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecMatchSearchList
)
445 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecReturnRef
)
446 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecGuestAttributePid
)
447 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecCodeInfoIdentifier
)
448 SECURITY_FRAMEWORK_EXTERN(CFTypeRef
, kSecCodeInfoUnique
)
450 __private_extern__ OSStatus
451 _AuthorizationMakeExternalForm(AuthorizationRef authorization
, AuthorizationExternalForm
*extForm
)
453 #undef AuthorizationMakeExternalForm
454 static typeof (AuthorizationMakeExternalForm
) *dyfunc
= NULL
;
456 void *image
= __loadSecurity();
457 if (image
) dyfunc
= dlsym(image
, "AuthorizationMakeExternalForm");
459 return dyfunc
? dyfunc(authorization
, extForm
) : -1;
462 __private_extern__ OSStatus
463 _SecAccessCreate(CFStringRef descriptor
, CFArrayRef trustedlist
, SecAccessRef
*accessRef
)
465 #undef SecAccessCreate
466 static typeof (SecAccessCreate
) *dyfunc
= NULL
;
468 void *image
= __loadSecurity();
469 if (image
) dyfunc
= dlsym(image
, "SecAccessCreate");
471 return dyfunc
? dyfunc(descriptor
, trustedlist
, accessRef
) : -1;
474 #if (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
475 __private_extern__ OSStatus
476 _SecAccessCreateFromOwnerAndACL(const CSSM_ACL_OWNER_PROTOTYPE
*owner
, uint32 aclCount
, const CSSM_ACL_ENTRY_INFO
*acls
, SecAccessRef
*accessRef
)
478 #undef SecAccessCreateFromOwnerAndACL
479 static typeof (SecAccessCreateFromOwnerAndACL
) *dyfunc
= NULL
;
481 void *image
= __loadSecurity();
482 if (image
) dyfunc
= dlsym(image
, "SecAccessCreateFromOwnerAndACL");
484 return dyfunc
? dyfunc(owner
, aclCount
, acls
, accessRef
) : -1;
486 #else // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
487 __private_extern__ SecAccessRef
488 _SecAccessCreateWithOwnerAndACL(uid_t userId
, gid_t groupId
, SecAccessOwnerType ownerType
, CFArrayRef acls
, CFErrorRef
*error
)
490 #undef SecAccessCreateWithOwnerAndACL
491 static typeof (SecAccessCreateWithOwnerAndACL
) *dyfunc
= NULL
;
493 void *image
= __loadSecurity();
494 if (image
) dyfunc
= dlsym(image
, "SecAccessCreateWithOwnerAndACL");
496 return dyfunc
? dyfunc(userId
, groupId
, ownerType
, acls
, error
) : NULL
;
498 #endif // (__MAC_OS_X_VERSION_MIN_REQUIRED < 1070)
500 __private_extern__ OSStatus
501 _SecItemCopyMatching(CFDictionaryRef query
, CFTypeRef
*result
)
503 #undef SecItemCopyMatching
504 static typeof (SecItemCopyMatching
) *dyfunc
= NULL
;
506 void *image
= __loadSecurity();
507 if (image
) dyfunc
= dlsym(image
, "SecItemCopyMatching");
509 return dyfunc
? dyfunc(query
, result
) : -1;
512 __private_extern__ OSStatus
513 _SecKeychainCopyDomainDefault(SecPreferencesDomain domain
, SecKeychainRef
*keychain
)
515 #undef SecKeychainCopyDomainDefault
516 static typeof (SecKeychainCopyDomainDefault
) *dyfunc
= NULL
;
518 void *image
= __loadSecurity();
519 if (image
) dyfunc
= dlsym(image
, "SecKeychainCopyDomainDefault");
521 return dyfunc
? dyfunc(domain
, keychain
) : -1;
524 __private_extern__ OSStatus
525 _SecKeychainOpen(const char *pathName
, SecKeychainRef
*keychain
)
527 #undef SecKeychainOpen
528 static typeof (SecKeychainOpen
) *dyfunc
= NULL
;
530 void *image
= __loadSecurity();
531 if (image
) dyfunc
= dlsym(image
, "SecKeychainOpen");
533 return dyfunc
? dyfunc(pathName
, keychain
) : -1;
536 __private_extern__ OSStatus
537 _SecKeychainSetDomainDefault(SecPreferencesDomain domain
, SecKeychainRef keychain
)
539 #undef SecKeychainSetDomainDefault
540 static typeof (SecKeychainSetDomainDefault
) *dyfunc
= NULL
;
542 void *image
= __loadSecurity();
543 if (image
) dyfunc
= dlsym(image
, "SecKeychainSetDomainDefault");
545 return dyfunc
? dyfunc(domain
, keychain
) : -1;
548 __private_extern__ OSStatus
549 _SecKeychainItemCopyContent(SecKeychainItemRef itemRef
, SecItemClass
*itemClass
, SecKeychainAttributeList
*attrList
, UInt32
*length
, void **outData
)
551 #undef SecKeychainItemCopyContent
552 static typeof (SecKeychainItemCopyContent
) *dyfunc
= NULL
;
554 void *image
= __loadSecurity();
555 if (image
) dyfunc
= dlsym(image
, "SecKeychainItemCopyContent");
557 return dyfunc
? dyfunc(itemRef
, itemClass
, attrList
, length
, outData
) : -1;
560 __private_extern__ OSStatus
561 _SecKeychainItemCreateFromContent(SecItemClass itemClass
, SecKeychainAttributeList
*attrList
, UInt32 length
, const void *data
, SecKeychainRef keychainRef
, SecAccessRef initialAccess
, SecKeychainItemRef
*itemRef
)
563 #undef SecKeychainItemCreateFromContent
564 static typeof (SecKeychainItemCreateFromContent
) *dyfunc
= NULL
;
566 void *image
= __loadSecurity();
567 if (image
) dyfunc
= dlsym(image
, "SecKeychainItemCreateFromContent");
569 return dyfunc
? dyfunc(itemClass
, attrList
, length
, data
, keychainRef
, initialAccess
, itemRef
) : -1;
572 __private_extern__ OSStatus
573 _SecKeychainItemDelete(SecKeychainItemRef itemRef
)
575 #undef SecKeychainItemDelete
576 static typeof (SecKeychainItemDelete
) *dyfunc
= NULL
;
578 void *image
= __loadSecurity();
579 if (image
) dyfunc
= dlsym(image
, "SecKeychainItemDelete");
581 return dyfunc
? dyfunc(itemRef
) : -1;
584 __private_extern__ OSStatus
585 _SecKeychainItemFreeContent(SecKeychainAttributeList
*attrList
, void *data
)
587 #undef SecKeychainItemFreeContent
588 static typeof (SecKeychainItemFreeContent
) *dyfunc
= NULL
;
590 void *image
= __loadSecurity();
591 if (image
) dyfunc
= dlsym(image
, "SecKeychainItemFreeContent");
593 return dyfunc
? dyfunc(attrList
, data
) : -1;
596 __private_extern__ OSStatus
597 _SecKeychainItemModifyContent(SecKeychainItemRef itemRef
, const SecKeychainAttributeList
*attrList
, UInt32 length
, const void *data
)
599 #undef SecKeychainItemModifyContent
600 static typeof (SecKeychainItemModifyContent
) *dyfunc
= NULL
;
602 void *image
= __loadSecurity();
603 if (image
) dyfunc
= dlsym(image
, "SecKeychainItemModifyContent");
605 return dyfunc
? dyfunc(itemRef
, attrList
, length
, data
) : -1;
609 __private_extern__ OSStatus
610 _SecTrustedApplicationCreateFromPath(const char *path
, SecTrustedApplicationRef
*app
)
612 #undef SecTrustedApplicationCreateFromPath
613 static typeof (SecTrustedApplicationCreateFromPath
) *dyfunc
= NULL
;
615 void *image
= __loadSecurity();
616 if (image
) dyfunc
= dlsym(image
, "SecTrustedApplicationCreateFromPath");
618 return dyfunc
? dyfunc(path
, app
) : -1;
621 #else // TARGET_OS_IPHONE
623 SECURITY_FRAMEWORK_EXTERN(CFStringRef
, kSecPropertyKeyValue
)
624 SECURITY_FRAMEWORK_EXTERN(CFStringRef
, kSecPropertyKeyLabel
)
626 __private_extern__ CFArrayRef
627 _SecCertificateCopyProperties(SecCertificateRef certRef
)
629 #undef SecCertificateCopyProperties
630 static typeof (SecCertificateCopyProperties
) *dyfunc
= NULL
;
632 void *image
= __loadSecurity();
633 if (image
) dyfunc
= dlsym(image
, "SecCertificateCopyProperties");
635 return dyfunc
? dyfunc(certRef
) : NULL
;
638 #endif // TARGET_OS_IPHONE
640 __private_extern__ SecCertificateRef
641 _SecCertificateCreateWithData(CFAllocatorRef allocator
, CFDataRef data
)
643 #undef SecCertificateCreateWithData
644 static typeof (SecCertificateCreateWithData
) *dyfunc
= NULL
;
646 void *image
= __loadSecurity();
647 if (image
) dyfunc
= dlsym(image
, "SecCertificateCreateWithData");
649 return dyfunc
? dyfunc(allocator
, data
) : NULL
;