#include <Security/SecLogging.h>
#include "securityd_client.h"
#include "SecuritydXPC.h"
static bool dict_to_error_request(enum SecXPCOperation op, CFDictionaryRef query, CFErrorRef *error)
{
return securityd_send_sync_and_do(op, error, ^bool(xpc_object_t message, CFErrorRef *error) {
return SecXPCDictionarySetPList(message, kSecXPCKeyQuery, query, error);
}, NULL);
}
static CFDictionaryRef void_to_dict_error_request(enum SecXPCOperation op, CFErrorRef *error) {
__block CFDictionaryRef dict = NULL;
securityd_send_sync_and_do(op, error, NULL, ^bool(xpc_object_t response, CFErrorRef *error) {
return (dict = SecXPCDictionaryCopyPList(response, kSecXPCKeyResult, error));
});
return dict;
}
CFArrayRef SecGetCurrentServerLoggingInfo(CFErrorRef *error)
{
return SECURITYD_XPC(sec_get_log_settings, void_to_dict_error_request, error);
}
bool SecSetLoggingInfoForXPCScope(CFPropertyListRef settings, CFErrorRef *error)
{
return SECURITYD_XPC(sec_set_xpc_log_settings, dict_to_error_request, settings, error);
}