this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add various stubs needed for `secd`

+286 -13
+1
src/CMakeLists.txt
··· 320 320 add_subdirectory(external/libnetwork) 321 321 add_subdirectory(libMobileGestalt) 322 322 add_subdirectory(external/MITKerberosShim) 323 + add_subdirectory(MobileKeyBag) 323 324 endif() 324 325 325 326 if (COMPONENT_iokitd)
+10
src/MobileKeyBag/CMakeLists.txt
··· 1 + project(MobileKeyBag) 2 + 3 + add_darling_static_library(MobileKeyBag 4 + SOURCES 5 + src/MobileKeyBag.c 6 + ) 7 + 8 + target_include_directories(MobileKeyBag PUBLIC 9 + include 10 + )
+20
src/MobileKeyBag/include/MobileKeyBag/MobileKeyBag.h
··· 1 + #ifndef _MOBILE_KEY_BAG_H_ 2 + #define _MOBILE_KEY_BAG_H_ 3 + 4 + #include <CoreFoundation/CoreFoundation.h> 5 + 6 + #ifdef __cplusplus 7 + extern "C" { 8 + #endif 9 + 10 + typedef struct __MKBKeyBagHandle* MKBKeyBagHandleRef; 11 + 12 + int MKBKeyBagCreateWithData(CFDataRef keybagBlob, MKBKeyBagHandleRef* newHandle); 13 + int MKBKeyBagGetAKSHandle(MKBKeyBagHandleRef keybag, int32_t* handle); 14 + int MKBKeyBagUnlock(MKBKeyBagHandleRef keybag, CFDataRef passcode); 15 + 16 + #ifdef __cplusplus 17 + } 18 + #endif 19 + 20 + #endif // _MOBILE_KEY_BAG_H_
+17
src/MobileKeyBag/src/MobileKeyBag.c
··· 1 + #include <MobileKeyBag/MobileKeyBag.h> 2 + #include <stdio.h> 3 + 4 + int MKBKeyBagCreateWithData(CFDataRef keybagBlob, MKBKeyBagHandleRef* newHandle) { 5 + printf("STUB %s\n", __PRETTY_FUNCTION__); 6 + return -1; 7 + }; 8 + 9 + int MKBKeyBagGetAKSHandle(MKBKeyBagHandleRef keybag, int32_t* handle) { 10 + printf("STUB %s\n", __PRETTY_FUNCTION__); 11 + return -1; 12 + }; 13 + 14 + int MKBKeyBagUnlock(MKBKeyBagHandleRef keybag, CFDataRef passcode) { 15 + printf("STUB %s\n", __PRETTY_FUNCTION__); 16 + return -1; 17 + };
+2
src/frameworks/CloudKit/include/CloudKit/CKContainer.h
··· 21 21 22 22 @interface CKContainer : NSObject 23 23 24 + + (instancetype)containerWithIdentifier: (NSString*)identifier; 25 + 24 26 @end
+28
src/frameworks/CloudKit/include/CloudKit/CKContainer_Private.h
··· 1 + /* 2 + * This file is part of Darling. 3 + * 4 + * Copyright (C) 2023 Darling Developers 5 + * 6 + * Darling is free software: you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation, either version 3 of the License, or 9 + * (at your option) any later version. 10 + * 11 + * Darling is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + * 16 + * You should have received a copy of the GNU General Public License 17 + * along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 + */ 19 + 20 + #import <CloudKit/CKContainer.h> 21 + 22 + typedef void (^CKContainerDeviceIDCompletionHandler)(NSString* deviceID, NSError* error); 23 + 24 + @interface CKContainer (Private) 25 + 26 + - (void)fetchCurrentDeviceIDWithCompletionHandler: (CKContainerDeviceIDCompletionHandler)completionHandler; 27 + 28 + @end
+11 -1
src/libacm/acmstub.c
··· 3 3 ACMContextRef ACMContextCreateWithExternalForm(const void *externalForm, size_t dataLength) { 4 4 printf("STUB %s\n", __PRETTY_FUNCTION__); 5 5 return NULL; 6 - } 6 + } 7 + 8 + ACMStatus ACMContextDelete(ACMContextRef context, bool destroyContext) { 9 + printf("STUB %s\n", __PRETTY_FUNCTION__); 10 + return -1; 11 + } 12 + 13 + ACMStatus ACMContextRemovePassphraseCredentialsByPurposeAndScope(const ACMContextRef context, ACMPassphrasePurpose purpose, ACMScope scope) { 14 + printf("STUB %s\n", __PRETTY_FUNCTION__); 15 + return -1; 16 + }
+19 -10
src/libaks/include/libaks.h
··· 4 4 #include <IOKit/IOReturn.h> 5 5 #include <stdint.h> 6 6 #include <stddef.h> 7 + #include <stdbool.h> 7 8 8 9 #ifdef __cplusplus 9 10 extern "C" { ··· 63 64 // i'm 99.9999999...% sure this is a typo in Security, but whatever 64 65 #define kSKSReturnNoPermission kAKSReturnNoPermission 65 66 66 - typedef int32_t keyclass_t; 67 + typedef enum _aks_keyclass_enum { 68 + key_class_none, 69 + key_class_ak, 70 + key_class_ck, 71 + key_class_dk, 72 + key_class_aku, 73 + key_class_cku, 74 + key_class_dku, 75 + key_class_akpu, // implied to exist by some Security code (`SecDbBackupmanager.m`) 76 + key_class_f, // ditto (`server.c` for `secd` executable) 77 + key_class_last, 78 + } keyclass_t; 67 79 68 80 // i know it's a pointer, but it seems to be used opaquely, so not much more information 69 81 // oh, it's also a CF type (deduced because it's used with `__bridge_retained` in Objective-C code) ··· 81 93 kern_return_t aks_lock_bag(keybag_handle_t handle); 82 94 83 95 typedef enum _aks_key_type_enum { 84 - key_class_none, 96 + key_type_none, // assuming `0` is reserved as `none` 85 97 key_type_sym, 86 - key_class_ak, 87 - key_class_ck, 88 - key_class_dk, 89 - key_class_aku, 90 - key_class_cku, 91 - key_class_dku, 92 - key_class_akpu, // implied to exist by some Security code (`SecDbBackupmanager.m`) 93 - key_class_last, 98 + key_type_asym_ec_p256, // implied to exist by some Security code (`server.c` for `secd` executable) 99 + key_type_last, // assuming same convention as `_aks_keyclass_enum` 94 100 } aks_key_type_t; 95 101 96 102 // 4096-bit = 512-byte; i *think* that's the maximum key length? ··· 111 117 112 118 const uint8_t * aks_ref_key_get_blob(aks_ref_key_t refkey, size_t *out_blob_len); 113 119 const uint8_t * aks_ref_key_get_external_data(aks_ref_key_t refkey, size_t *out_external_data_len); 120 + const uint8_t * aks_ref_key_get_public_key(aks_ref_key_t refkey, size_t* out_pub_key_len); 114 121 115 122 int aks_ref_key_create(keybag_handle_t handle, keyclass_t key_class, aks_key_type_t type, const uint8_t *params, size_t params_len, aks_ref_key_t *ot); 116 123 int aks_ref_key_create_with_blob(keybag_handle_t keybag, const uint8_t *ref_key_blob, size_t ref_key_blob_len, aks_ref_key_t* handle); ··· 124 131 kern_return_t aks_unwrap_key(const uint8_t *source, uint32_t textLength, keyclass_t keyclass, keybag_handle_t keybag, uint8_t *data, int *dest_len); 125 132 126 133 int aks_operation_optional_params(const uint8_t * access_groups, size_t access_groups_len, const uint8_t * external_data, size_t external_data_len, const void * acm_handle, int acm_handle_len, void ** out_der, size_t * out_der_len); 134 + 135 + bool hwaes_key_available(void); 127 136 128 137 #ifdef __cplusplus 129 138 }
+70
src/libaks/libaks.c
··· 95 95 printf("STUB %s\n", __PRETTY_FUNCTION__); 96 96 return NULL; 97 97 } 98 + 99 + kern_return_t aks_generation(keybag_handle_t handle, generation_option_t option, uint32_t* current) { 100 + printf("STUB %s\n", __PRETTY_FUNCTION__); 101 + return kAKSReturnError; 102 + } 103 + 104 + kern_return_t aks_get_bag_uuid(keybag_handle_t handle, uuid_t uuid) { 105 + printf("STUB %s\n", __PRETTY_FUNCTION__); 106 + return kAKSReturnError; 107 + } 108 + 109 + kern_return_t aks_lock_bag(keybag_handle_t handle) { 110 + printf("STUB %s\n", __PRETTY_FUNCTION__); 111 + return kAKSReturnError; 112 + } 113 + 114 + int aks_operation_optional_params(const uint8_t * access_groups, size_t access_groups_len, const uint8_t * external_data, size_t external_data_len, const void * acm_handle, int acm_handle_len, void ** out_der, size_t * out_der_len) { 115 + printf("STUB %s\n", __PRETTY_FUNCTION__); 116 + return kAKSReturnError; 117 + } 118 + 119 + int aks_ref_key_create(keybag_handle_t handle, keyclass_t key_class, aks_key_type_t type, const uint8_t *params, size_t params_len, aks_ref_key_t *ot) { 120 + printf("STUB %s\n", __PRETTY_FUNCTION__); 121 + return kAKSReturnError; 122 + } 123 + 124 + int aks_ref_key_create_with_blob(keybag_handle_t keybag, const uint8_t *ref_key_blob, size_t ref_key_blob_len, aks_ref_key_t* handle) { 125 + printf("STUB %s\n", __PRETTY_FUNCTION__); 126 + return kAKSReturnError; 127 + } 128 + 129 + int aks_ref_key_encrypt(aks_ref_key_t handle, const uint8_t *der_params, size_t der_params_len, const void *data, size_t data_len, void **out_der, size_t *out_der_len) { 130 + printf("STUB %s\n", __PRETTY_FUNCTION__); 131 + return kAKSReturnError; 132 + } 133 + 134 + int aks_ref_key_decrypt(aks_ref_key_t handle, const uint8_t *der_params, size_t der_params_len, const void *data, size_t data_len, void **out_der, size_t *out_der_len) { 135 + printf("STUB %s\n", __PRETTY_FUNCTION__); 136 + return kAKSReturnError; 137 + } 138 + 139 + int aks_ref_key_free(aks_ref_key_t* refkey) { 140 + printf("STUB %s\n", __PRETTY_FUNCTION__); 141 + return kAKSReturnError; 142 + } 143 + 144 + int aks_ref_key_delete(aks_ref_key_t handle, const uint8_t *der_params, size_t der_params_len) { 145 + printf("STUB %s\n", __PRETTY_FUNCTION__); 146 + return kAKSReturnError; 147 + } 148 + 149 + const uint8_t * aks_ref_key_get_public_key(aks_ref_key_t refkey, size_t* out_pub_key_len) { 150 + printf("STUB %s\n", __PRETTY_FUNCTION__); 151 + return NULL; 152 + } 153 + 154 + kern_return_t aks_wrap_key(const uint8_t *source, uint32_t textLength, keyclass_t keyclass, keybag_handle_t keybag, uint8_t *data, int *dest_len, keyclass_t *actual_class) { 155 + printf("STUB %s\n", __PRETTY_FUNCTION__); 156 + return kAKSReturnError; 157 + } 158 + 159 + kern_return_t aks_unwrap_key(const uint8_t *source, uint32_t textLength, keyclass_t keyclass, keybag_handle_t keybag, uint8_t *data, int *dest_len) { 160 + printf("STUB %s\n", __PRETTY_FUNCTION__); 161 + return kAKSReturnError; 162 + } 163 + 164 + bool hwaes_key_available(void) { 165 + printf("STUB %s\n", __PRETTY_FUNCTION__); 166 + return false; 167 + }
+12
src/private-frameworks/AuthKit/include/AuthKit/AKAccountManager.h
··· 17 17 along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 18 */ 19 19 20 + #import <Foundation/Foundation.h> 21 + 22 + #import <Accounts/ACAccount.h> 23 + 24 + typedef NS_ENUM(NSUInteger, AKAppleIDSecurityLevel) { 25 + AKAppleIDSecurityLevelHSA2, 26 + }; 27 + 20 28 @interface AKAccountManager : NSObject 29 + 30 + - (NSString*)altDSIDForAccount: (ACAccount*)account; 31 + - (ACAccount*)authKitAccountWithAltDSID: (NSString*)altDSID; 32 + - (AKAppleIDSecurityLevel)securityLevelForAccount: (ACAccount*)account; 21 33 22 34 @end
+4
src/private-frameworks/AuthKit/include/AuthKit/AKAnisetteData.h
··· 17 17 along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 18 */ 19 19 20 + #import <Foundation/Foundation.h> 21 + 20 22 @interface AKAnisetteData : NSObject 23 + 24 + @property(readonly) NSString* machineID; 21 25 22 26 @end
+6
src/private-frameworks/AuthKit/include/AuthKit/AKAnisetteProvisioningController.h
··· 17 17 along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 18 */ 19 19 20 + #import <Foundation/Foundation.h> 21 + 22 + #import <AuthKit/AKAnisetteData.h> 23 + 20 24 @interface AKAnisetteProvisioningController : NSObject 25 + 26 + - (AKAnisetteData*)anisetteDataWithError: (NSError**)error; 21 27 22 28 @end
+7
src/private-frameworks/AuthKit/include/AuthKit/AKAppleIDAuthenticationController.h
··· 17 17 along with Darling. If not, see <http://www.gnu.org/licenses/>. 18 18 */ 19 19 20 + #import <Foundation/Foundation.h> 21 + 22 + #import <AuthKit/AKDeviceListRequestContext.h> 23 + #import <AuthKit/AKRemoteDevice.h> 24 + 20 25 @interface AKAppleIDAuthenticationController : NSObject 26 + 27 + - (void)fetchDeviceListWithContext: (AKDeviceListRequestContext*)context completion: (void(^)(NSArray<AKRemoteDevice*>*, NSError*))handler; 21 28 22 29 @end
+8
src/private-frameworks/AuthKit/include/AuthKit/AKDeviceListRequestContext.h
··· 1 + #import <Foundation/Foundation.h> 2 + 3 + @interface AKDeviceListRequestContext : NSObject 4 + 5 + @property(copy) NSArray<NSString*>* services; 6 + @property(copy) NSString* altDSID; 7 + 8 + @end
+8
src/private-frameworks/AuthKit/include/AuthKit/AKRemoteDevice.h
··· 1 + #import <Foundation/Foundation.h> 2 + 3 + @interface AKRemoteDevice : NSObject 4 + 5 + @property(readonly) NSString* machineId; 6 + @property(readonly) NSString* serialNumber; 7 + 8 + @end
+2
src/private-frameworks/AuthKit/include/AuthKit/AuthKit.h
··· 49 49 #import <AuthKit/AKAppleIDAuthenticationContext.h> 50 50 #import <AuthKit/AKAccountManager.h> 51 51 #import <AuthKit/AKAppleIDAuthenticationDaemonInterface.h> 52 + #import <AuthKit/AKDeviceListRequestContext.h> 53 + #import <AuthKit/AKRemoteDevice.h>
+1
src/private-frameworks/AuthKit/include/AuthKit/AuthKit_Private.h
··· 1 + #import <AuthKit/AuthKit.h>
+13
src/private-frameworks/AuthKit/src/AKDeviceListRequestContext.m
··· 1 + #import <AuthKit/AKDeviceListRequestContext.h> 2 + 3 + @implementation AKDeviceListRequestContext 4 + 5 + - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector { 6 + return [NSMethodSignature signatureWithObjCTypes: "v@:"]; 7 + } 8 + 9 + - (void)forwardInvocation:(NSInvocation *)anInvocation { 10 + NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]); 11 + } 12 + 13 + @end
+4
src/private-frameworks/TrustedPeers/include/TrustedPeers/TPPBPeerStableInfo.h
··· 19 19 20 20 #include <Foundation/Foundation.h> 21 21 22 + @class TPPBPeerStableInfo; 23 + 24 + extern TPPBPeerStableInfo* const TPPBPeerStableInfo_UserControllableViewStatus_UNKNOWN; 25 + 22 26 @interface TPPBPeerStableInfo : NSObject 23 27 24 28 @end
+12
src/private-frameworks/TrustedPeers/include/TrustedPeers/TPPolicy.h
··· 19 19 20 20 #include <Foundation/Foundation.h> 21 21 22 + #import <TrustedPeers/TPPBPeerStableInfo.h> 23 + 24 + @class TPSyncingPolicy; 25 + 22 26 @interface TPPolicy : NSObject 27 + 28 + - (TPSyncingPolicy*)syncingPolicyForModel: (NSString*)model syncUserControllableViews: (TPPBPeerStableInfo*)stableInfo error: (NSError**)error; 29 + 30 + @end 31 + 32 + @interface TPSyncingPolicy : TPPolicy 33 + 34 + - (NSString*)mapDictionaryToView: (NSDictionary*)dictionary; 23 35 24 36 @end
+6
src/private-frameworks/TrustedPeers/include/TrustedPeers/TPPolicyDocument.h
··· 19 19 20 20 #include <Foundation/Foundation.h> 21 21 22 + #import <TrustedPeers/TPPolicy.h> 23 + 22 24 @interface TPPolicyDocument : NSObject 25 + 26 + + (instancetype)policyDocWithHash: (NSString*)hash data: (NSData*)data; 27 + 28 + - (TPPolicy*)policyWithSecrets: (NSDictionary*)secrets decrypter: (id)decrypter error: (NSError**)error; 23 29 24 30 @end
+2
src/private-frameworks/TrustedPeers/src/TPPBPeerStableInfo.m
··· 19 19 20 20 #import <TrustedPeers/TPPBPeerStableInfo.h> 21 21 22 + TPPBPeerStableInfo* const TPPBPeerStableInfo_UserControllableViewStatus_UNKNOWN = nil; 23 + 22 24 @implementation TPPBPeerStableInfo 23 25 24 26 - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector
+14
src/private-frameworks/TrustedPeers/src/TPPolicy.m
··· 32 32 } 33 33 34 34 @end 35 + 36 + @implementation TPSyncingPolicy 37 + 38 + - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector 39 + { 40 + return [NSMethodSignature signatureWithObjCTypes: "v@:"]; 41 + } 42 + 43 + - (void)forwardInvocation:(NSInvocation *)anInvocation 44 + { 45 + NSLog(@"Stub called: %@ in %@", NSStringFromSelector([anInvocation selector]), [self class]); 46 + } 47 + 48 + @end
+3
src/private-frameworks/login/functions.c
··· 19 19 20 20 #include <login/login.h> 21 21 22 + // arbitrary guess 23 + const char* kSA_SessionStateChangedNotification = "SA_SessionStateChangedNotification"; 24 + 22 25 void CFXPCRelease(void) { } 23 26 void CreateArgumentsForFunction(void) { } 24 27 void GetSessionAgentClient(void) { }
+3
src/private-frameworks/login/include/login/SessionAgentStatusCom.h
··· 3 3 4 4 typedef int SessionAgentState; 5 5 6 + extern const char* kSA_SessionStateChangedNotification; 7 + 6 8 #define kSA_state_desktopshowing 1 9 + #define kSA_state_loggingout_pointofnoreturn 2 /* arbitrary guess */ 7 10 8 11 SessionAgentState SASSessionStateForUser(int uid); 9 12
+3 -2
src/softlinking/include/SoftLinking/SoftLinking.h
··· 7 7 #import <Foundation/Foundation.h> 8 8 #import <CoreFoundation/CoreFoundation.h> 9 9 #import <dispatch/dispatch.h> 10 + #include <dlfcn.h> 10 11 11 12 // certain aspects of this file (such as framework, function, and constant loading) 12 13 // can be implemented in plain C, but because it can also load Objective-C classes, ··· 67 68 68 69 #define SOFT_LINK_CONSTANT(_framework, _name, _type) \ 69 70 static _type get ## _name () { \ 70 - static _type* constant = NULL; \ 71 + static _type const* constant = NULL; \ 71 72 static dispatch_once_t once_handle; \ 72 73 dispatch_once(&once_handle, ^{ \ 73 74 CFBundleRef bundle = softlink_get_cfbundle_ ## _framework (); \ 74 75 if (bundle) \ 75 - constant = CFBundleGetDataPointerForName(bundle, SOFT_LINK_CFSTRINGIFY(_name)); \ 76 + constant = (_type const*)CFBundleGetDataPointerForName(bundle, SOFT_LINK_CFSTRINGIFY(_name)); \ 76 77 }); \ 77 78 /* 78 79 i'm not sure what to do if the symbol can't be found since