1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#include <libkern/libkern.h> #include <libkern/section_keywords.h> #include <libkern/apple_encrypted_archive/apple_encrypted_archive.h> #if defined(SECURITY_READ_ONLY_LATE) SECURITY_READ_ONLY_LATE(const apple_encrypted_archive_t *) apple_encrypted_archive = NULL; SECURITY_READ_ONLY_LATE(registration_callback_t) registration_callback = NULL; #else const apple_encrypted_archive_t *apple_encrypted_archive = NULL; registration_callback_t registration_callback = NULL; #endif void apple_encrypted_archive_interface_register(const apple_encrypted_archive_t *aea) { if (apple_encrypted_archive) { panic("apple_encrypted_archive interface already set"); } apple_encrypted_archive = aea; if (registration_callback) { registration_callback(); } } void apple_encrypted_archive_interface_set_registration_callback(registration_callback_t callback) { if (callback && registration_callback) { panic("apple_encrypted_archive interface registration callback is already set"); } registration_callback = callback; }