this repo has no description
1
fork

Configure Feed

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

Improvements to Security build

+16 -429
+1 -427
platform-include/xpc/activity.h
··· 1 - #ifndef __XPC_ACTIVITY_H__ 2 - #define __XPC_ACTIVITY_H__ 3 - 4 - #ifndef __XPC_INDIRECT__ 5 - #error "Please #include <xpc/xpc.h> instead of this file directly." 6 - // For HeaderDoc. 7 - #include <xpc/base.h> 8 - #endif // __XPC_INDIRECT__ 9 - 10 - #ifdef __BLOCKS__ 11 - 12 - __BEGIN_DECLS 13 - 14 - /* 15 - * The following are a collection of keys and values used to set an activity's 16 - * execution criteria. 17 - */ 18 - 19 - /*! 20 - * @constant XPC_ACTIVITY_INTERVAL 21 - * An integer property indicating the desired time interval (in seconds) of the 22 - * activity. The activity will not be run more than once per time interval. 23 - * Due to the nature of XPC Activity finding an opportune time to run 24 - * the activity, any two occurrences may be more or less than 'interval' 25 - * seconds apart, but on average will be 'interval' seconds apart. 26 - * The presence of this key implies the following, unless overridden: 27 - * - XPC_ACTIVITY_REPEATING with a value of true 28 - * - XPC_ACTIVITY_DELAY with a value of half the 'interval' 29 - * The delay enforces a minimum distance between any two occurrences. 30 - * - XPC_ACTIVITY_GRACE_PERIOD with a value of half the 'interval'. 31 - * The grace period is the amount of time allowed to pass after the end of 32 - * the interval before more aggressive scheduling occurs. The grace period 33 - * does not increase the size of the interval. 34 - */ 35 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 36 - XPC_EXPORT 37 - const char *XPC_ACTIVITY_INTERVAL; 38 - 39 - /*! 40 - * @constant XPC_ACTIVITY_REPEATING 41 - * A boolean property indicating whether this is a repeating activity. 42 - */ 43 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 44 - XPC_EXPORT 45 - const char *XPC_ACTIVITY_REPEATING; 46 - 47 - /*! 48 - * @constant XPC_ACTIVITY_DELAY 49 - * An integer property indicating the number of seconds to delay before 50 - * beginning the activity. 51 - */ 52 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 53 - XPC_EXPORT 54 - const char *XPC_ACTIVITY_DELAY; 55 - 56 - /*! 57 - * @constant XPC_ACTIVITY_GRACE_PERIOD 58 - * An integer property indicating the number of seconds to allow as a grace 59 - * period before the scheduling of the activity becomes more aggressive. 60 - */ 61 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 62 - XPC_EXPORT 63 - const char *XPC_ACTIVITY_GRACE_PERIOD; 64 - 65 - 66 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 67 - XPC_EXPORT 68 - const int64_t XPC_ACTIVITY_INTERVAL_1_MIN; 69 - 70 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 71 - XPC_EXPORT 72 - const int64_t XPC_ACTIVITY_INTERVAL_5_MIN; 73 - 74 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 75 - XPC_EXPORT 76 - const int64_t XPC_ACTIVITY_INTERVAL_15_MIN; 77 - 78 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 79 - XPC_EXPORT 80 - const int64_t XPC_ACTIVITY_INTERVAL_30_MIN; 81 - 82 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 83 - XPC_EXPORT 84 - const int64_t XPC_ACTIVITY_INTERVAL_1_HOUR; 85 - 86 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 87 - XPC_EXPORT 88 - const int64_t XPC_ACTIVITY_INTERVAL_4_HOURS; 89 - 90 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 91 - XPC_EXPORT 92 - const int64_t XPC_ACTIVITY_INTERVAL_8_HOURS; 93 - 94 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 95 - XPC_EXPORT 96 - const int64_t XPC_ACTIVITY_INTERVAL_1_DAY; 97 - 98 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 99 - XPC_EXPORT 100 - const int64_t XPC_ACTIVITY_INTERVAL_7_DAYS; 101 - 102 - /*! 103 - * @constant XPC_ACTIVITY_PRIORITY 104 - * A string property indicating the priority of the activity. 105 - */ 106 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 107 - XPC_EXPORT 108 - const char *XPC_ACTIVITY_PRIORITY; 109 - 110 - /*! 111 - * @constant XPC_ACTIVITY_PRIORITY_MAINTENANCE 112 - * A string indicating activity is maintenance priority. 113 - * Maintenance priority is intended for user-invisible maintenance tasks 114 - * such as garbage collection or optimization. 115 - */ 116 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 117 - XPC_EXPORT 118 - const char *XPC_ACTIVITY_PRIORITY_MAINTENANCE; 119 - 120 - /*! 121 - * @constant XPC_ACTIVITY_PRIORITY_UTILITY 122 - * A string indicating activity is utility priority. 123 - * Utility priority is intended for user-visible tasks such as fetching data 124 - * from the network, copying files, or importing data. 125 - */ 126 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 127 - XPC_EXPORT 128 - const char *XPC_ACTIVITY_PRIORITY_UTILITY; 129 - 130 - /*! 131 - * @constant XPC_ACTIVITY_ALLOW_BATTERY 132 - * A Boolean value indicating whether the activity should be allowed to run 133 - * while the computer is on battery power. The default value is false for 134 - * maintenance priority activity and true for utility priority activity. 135 - */ 136 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 137 - XPC_EXPORT 138 - const char *XPC_ACTIVITY_ALLOW_BATTERY; 139 - 140 - /*! 141 - * @constant XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP 142 - * A Boolean value indicating whether the activity should only be performed 143 - * while the primary screen is in sleep mode. Defaults to false. 144 - */ 145 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 146 - XPC_EXPORT 147 - const char *XPC_ACTIVITY_REQUIRE_SCREEN_SLEEP; // bool 148 - 149 - /*! 150 - * @constant XPC_ACTIVITY_REQUIRE_BATTERY_LEVEL 151 - * An integer percentage of minimum battery charge required to allow the 152 - * activity to run. A default minimum battery level is determined by the 153 - * system. 154 - */ 155 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 156 - XPC_EXPORT 157 - const char *XPC_ACTIVITY_REQUIRE_BATTERY_LEVEL; // int (%) 158 - 159 - /*! 160 - * @constant XPC_ACTIVITY_REQUIRE_HDD_SPINNING 161 - * A Boolean value indicating whether the activity should only be performed 162 - * while the hard disk drive (HDD) is spinning. Computers with flash storage 163 - * are considered to be equivalent to HDD spinning. Defaults to false. 164 - */ 165 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 166 - XPC_EXPORT 167 - const char *XPC_ACTIVITY_REQUIRE_HDD_SPINNING; // bool 168 - 169 - /*! 170 - * @define XPC_TYPE_ACTIVITY 171 - * A type representing a connection to a named service. This connection is 172 - * bidirectional and can be used to both send and receive messages. A 173 - * connection carries the credentials of the remote service provider. 174 - */ 175 - #define XPC_TYPE_ACTIVITY (&_xpc_type_activity) 176 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 177 - XPC_EXPORT 178 - XPC_TYPE(_xpc_type_activity); 179 - 180 - /*! 181 - * @typedef xpc_activity_t 182 - * 183 - * @abstract 184 - * An XPC activity object. 185 - * 186 - * @discussion 187 - * This object represents a set of execution criteria and a current execution 188 - * state for background activity on the system. Once an activity is registered, 189 - * the system will evaluate its criteria to determine whether the activity is 190 - * eligible to run under current system conditions. When an activity becomes 191 - * eligible to run, its execution state will be updated and an invocation of 192 - * its handler block will be made. 193 - */ 194 - XPC_DECL(xpc_activity); 195 - 196 - /*! 197 - * @typedef xpc_activity_handler_t 198 - * 199 - * @abstract 200 - * A block that is called when an XPC activity becomes eligible to run. 201 - */ 202 - typedef void (^xpc_activity_handler_t)(xpc_activity_t activity); 203 - 204 - /*! 205 - * @constant XPC_ACTIVITY_CHECK_IN 206 - * This constant may be passed to xpc_activity_register() as the criteria 207 - * dictionary in order to check in with the system for previously registered 208 - * activity using the same identifier (for example, an activity taken from a 209 - * launchd property list). 210 - */ 211 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 212 - XPC_EXPORT 213 - const xpc_object_t XPC_ACTIVITY_CHECK_IN; 214 - 215 - /*! 216 - * @function xpc_activity_register 217 - * 218 - * @abstract 219 - * Registers an activity with the system. 220 - * 221 - * @discussion 222 - * Registers a new activity with the system. The criteria of the activity are 223 - * described by the dictionary passed to this function. If an activity with the 224 - * same identifier already exists, the criteria provided override the existing 225 - * criteria unless the special dictionary XPC_ACTIVITY_CHECK_IN is used. The 226 - * XPC_ACTIVITY_CHECK_IN dictionary instructs the system to first look up an 227 - * existing activity without modifying its criteria. Once the existing activity 228 - * is found (or a new one is created with an empty set of criteria) the handler 229 - * will be called with an activity object in the XPC_ACTIVITY_STATE_CHECK_IN 230 - * state. 231 - * 232 - * @param identifier 233 - * A unique identifier for the activity. Each application has its own namespace. 234 - * The identifier should remain constant across registrations, relaunches of 235 - * the application, and reboots. It should identify the kind of work being done, 236 - * not a particular invocation of the work. 237 - * 238 - * @param criteria 239 - * A dictionary of criteria for the activity. 240 - * 241 - * @param handler 242 - * The handler block to be called when the activity changes state to one of the 243 - * following states: 244 - * - XPC_ACTIVITY_STATE_CHECK_IN (optional) 245 - * - XPC_ACTIVITY_STATE_RUN 246 - * 247 - * The handler block is never invoked reentrantly. It will be invoked on a 248 - * dispatch queue with an appropriate priority to perform the activity. 249 - */ 250 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 251 - XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 XPC_NONNULL3 252 - void 253 - xpc_activity_register(const char *identifier, xpc_object_t criteria, 254 - xpc_activity_handler_t handler); 255 - 256 - /*! 257 - * @function xpc_activity_copy_criteria 258 - * 259 - * @abstract 260 - * Returns an XPC dictionary describing the execution criteria of an activity. 261 - * This will return NULL in cases where the activity has already completed, e.g. 262 - * when checking in to an event that finished and was not rescheduled. 263 - */ 264 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 265 - XPC_EXPORT XPC_WARN_RESULT XPC_RETURNS_RETAINED 266 - xpc_object_t 267 - xpc_activity_copy_criteria(xpc_activity_t activity); 268 - 269 - /*! 270 - * @function xpc_activity_set_criteria 271 - * 272 - * @abstract 273 - * Modifies the execution criteria of an activity. 274 - */ 275 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 276 - XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 277 - void 278 - xpc_activity_set_criteria(xpc_activity_t activity, xpc_object_t criteria); 279 - 280 - /*! 281 - * @enum xpc_activity_state_t 282 - * An activity is defined to be in one of the following states. Applications 283 - * may check the current state of the activity using xpc_activity_get_state() 284 - * in the handler block provided to xpc_activity_register(). 285 - * 286 - * The application can modify the state of the activity by calling 287 - * xpc_activity_set_state() with one of the following: 288 - * - XPC_ACTIVITY_STATE_DEFER 289 - * - XPC_ACTIVITY_STATE_CONTINUE 290 - * - XPC_ACTIVITY_STATE_DONE 291 - * 292 - * @constant XPC_ACTIVITY_STATE_CHECK_IN 293 - * An activity in this state has just completed a checkin with the system after 294 - * XPC_ACTIVITY_CHECK_IN was provided as the criteria dictionary to 295 - * xpc_activity_register. The state gives the application an opportunity to 296 - * inspect and modify the activity's criteria. 297 - * 298 - * @constant XPC_ACTIVITY_STATE_WAIT 299 - * An activity in this state is waiting for an opportunity to run. This value 300 - * is never returned within the activity's handler block, as the block is 301 - * invoked in response to XPC_ACTIVITY_STATE_CHECK_IN or XPC_ACTIVITY_STATE_RUN. 302 - * 303 - * Note: 304 - * A launchd job may idle exit while an activity is in the wait state and be 305 - * relaunched in response to the activity becoming runnable. The launchd job 306 - * simply needs to re-register for the activity on its next launch by passing 307 - * XPC_ACTIVITY_STATE_CHECK_IN to xpc_activity_register(). 308 - * 309 - * @constant XPC_ACTIVITY_STATE_RUN 310 - * An activity in this state is eligible to run based on its criteria. 311 - * 312 - * @constant XPC_ACTIVITY_STATE_DEFER 313 - * An application may pass this value to xpc_activity_set_state() to indicate 314 - * that the activity should be deferred (placed back into the WAIT state) until 315 - * a time when its criteria are met again. Deferring an activity does not reset 316 - * any of its time-based criteria (in other words, it will remain past due). 317 - * 318 - * IMPORTANT: 319 - * This should be done in response to observing xpc_activity_should_defer(). 320 - * It should not be done unilaterally. If you determine that conditions are bad 321 - * to do your activity's work for reasons you can't express in a criteria 322 - * dictionary, you should set the activity's state to XPC_ACTIVITY_STATE_DONE. 323 - * 324 - * 325 - * @constant XPC_ACTIVITY_STATE_CONTINUE 326 - * An application may pass this value to xpc_activity_set_state() to indicate 327 - * that the activity will continue its operation beyond the return of its 328 - * handler block. This can be used to extend an activity to include asynchronous 329 - * operations. The activity's handler block will not be invoked again until the 330 - * state has been updated to either XPC_ACTIVITY_STATE_DEFER or, in the case 331 - * of repeating activity, XPC_ACTIVITY_STATE_DONE. 332 - * 333 - * @constant XPC_ACTIVITY_STATE_DONE 334 - * An application may pass this value to xpc_activity_set_state() to indicate 335 - * that the activity has completed. For non-repeating activity, the resources 336 - * associated with the activity will be automatically released upon return from 337 - * the handler block. For repeating activity, timers present in the activity's 338 - * criteria will be reset. 339 - */ 340 - enum { 341 - XPC_ACTIVITY_STATE_CHECK_IN, 342 - XPC_ACTIVITY_STATE_WAIT, 343 - XPC_ACTIVITY_STATE_RUN, 344 - XPC_ACTIVITY_STATE_DEFER, 345 - XPC_ACTIVITY_STATE_CONTINUE, 346 - XPC_ACTIVITY_STATE_DONE, 347 - }; 348 - typedef long xpc_activity_state_t; 349 - 350 - /*! 351 - * @function xpc_activity_get_state 352 - * 353 - * @abstract 354 - * Returns the current state of an activity. 355 - */ 356 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 357 - XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 358 - xpc_activity_state_t 359 - xpc_activity_get_state(xpc_activity_t activity); 360 - 361 - /*! 362 - * @function xpc_activity_set_state 363 - * 364 - * @abstract 365 - * Updates the current state of an activity. 366 - * 367 - * @return 368 - * Returns true if the state was successfully updated; otherwise, returns 369 - * false if the requested state transition is not valid. 370 - */ 371 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 372 - XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 373 - bool 374 - xpc_activity_set_state(xpc_activity_t activity, xpc_activity_state_t state); 375 - 376 - /*! 377 - * @function xpc_activity_should_defer 378 - * 379 - * @abstract 380 - * Test whether an activity should be deferred. 381 - * 382 - * @discussion 383 - * This function may be used to test whether the criteria of a long-running 384 - * activity are still satisfied. If not, the system indicates that the 385 - * application should defer the activity. The application may acknowledge the 386 - * deferral by calling xpc_activity_set_state() with XPC_ACTIVITY_STATE_DEFER. 387 - * Once deferred, the system will place the activity back into the WAIT state 388 - * and re-invoke the handler block at the earliest opportunity when the criteria 389 - * are once again satisfied. 390 - * 391 - * @return 392 - * Returns true if the activity should be deferred. 393 - */ 394 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 395 - XPC_EXPORT 396 - bool 397 - xpc_activity_should_defer(xpc_activity_t activity); 398 - 399 - /*! 400 - * @function xpc_activity_unregister 401 - * 402 - * @abstract 403 - * Unregisters an activity found by its identifier. 404 - * 405 - * @discussion 406 - * A dynamically registered activity will be deleted in response to this call. 407 - * Statically registered activity (from a launchd property list) will be 408 - * reverted to its original criteria if any modifications were made. 409 - * 410 - * Unregistering an activity has no effect on any outstanding xpc_activity_t 411 - * objects or any currently executing xpc_activity_handler_t blocks; however, 412 - * no new handler block invocations will be made after it is unregistered. 413 - * 414 - * @param identifier 415 - * The identifier of the activity to unregister. 416 - */ 417 - __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0) 418 - XPC_EXPORT XPC_NONNULL1 419 - void 420 - xpc_activity_unregister(const char *identifier); 421 - 422 - __END_DECLS 423 - 424 - #endif // __BLOCKS__ 425 - 426 - #endif // __XPC_ACTIVITY_H__ 427 - 1 + ../../src/external/libxpc/xpc/activity.h
+2
src/CryptoTokenKit/CMakeLists.txt
··· 20 20 SOURCES 21 21 src/ctkclient.c 22 22 src/ctkclient_test.c 23 + src/defs.c 23 24 24 25 DEPENDENCIES 25 26 system 27 + CoreFoundation 26 28 )
+1
src/CryptoTokenKit/include/ACMDefs.h
··· 1 1 #ifndef _ACMDEFS_H_ 2 2 #define _ACMDEFS_H_ 3 + #include <CoreFoundation/CFString.h> 3 4 4 5 // No one knows what these are for 5 6
+10
src/CryptoTokenKit/src/defs.c
··· 1 + #include "ACMDefs.h" 2 + #include <CoreFoundation/CFString.h> 3 + 4 + const int kAKSKeyOpSign = 1; 5 + 6 + const CFStringRef kAKSKeyOpDecrypt = CFSTR("AKSKeyOpDecrypt"); 7 + 8 + const int kAKSKeyOpComputeKey = 2; 9 + 10 + const CFStringRef kAKSKeyOpAttest = CFSTR("AKSKeyOpAttest");
+1 -2
src/libsystem/CMakeLists.txt
··· 52 52 removefile 53 53 system_copyfile 54 54 system_coreservices 55 - 55 + system_coretls 56 56 system_malloc 57 57 system_c 58 58 system_kernel ··· 73 73 system_blocks 74 74 xpc 75 75 corecrypto 76 - system_coretls 77 76 commonCrypto 78 77 ) 79 78
+1
src/sandbox/sandbox.c
··· 3 3 #include <string.h> 4 4 5 5 // DUMMY implementation 6 + const enum sandbox_filter_type SANDBOX_CHECK_NO_REPORT = SANDBOX_FILTER_NONE; 6 7 7 8 int sandbox_init(const char *profile, uint64_t flags, char **errorbuf) 8 9 {