Merge pull request #25813 from linusg/bump-macos-libc

libc: Update macOS headers to SDK 26.1
This commit is contained in:
Alex Rønne Petersen 2025-11-04 23:05:14 +01:00 committed by GitHub
commit 74900e938a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
28 changed files with 1899 additions and 195 deletions

View File

@ -1 +1 @@
{"MinimalDisplayName":"26.0"}
{"MinimalDisplayName":"26.1"}

View File

@ -400,7 +400,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libcorecrypto.dylib'
current-version: 1922.0.25
current-version: 1922.40.14
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -417,21 +417,21 @@ exports:
_ccsha256_vng_intel_SupplementalSSE3_di ]
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
symbols: [ _CCEC_FAULT_CANARY, _CCRSA_PKCS1_FAULT_CANARY, _CCRSA_PSS_FAULT_CANARY,
_CCSS_PRIME_P192, _CCSS_PRIME_P224, _CCSS_PRIME_P256, _CCSS_PRIME_P384,
_CCSS_PRIME_P521, _cc_abort, _cc_atfork_child, _cc_atfork_parent,
_cc_atfork_prepare, _cc_clear, _cc_cmp_safe, _cc_impl_name,
_cc_try_abort, _cc_try_abort_if, _ccaes_cbc_decrypt_mode,
_ccaes_cbc_encrypt_mode, _ccaes_ccm_decrypt_mode, _ccaes_ccm_encrypt_mode,
_ccaes_cfb8_decrypt_mode, _ccaes_cfb8_encrypt_mode, _ccaes_cfb_decrypt_mode,
_ccaes_cfb_encrypt_mode, _ccaes_ctr_crypt_mode, _ccaes_ecb_decrypt_mode,
_ccaes_ecb_encrypt_mode, _ccaes_gcm_decrypt_mode, _ccaes_gcm_encrypt_mode,
_ccaes_gladman_cbc_decrypt_mode, _ccaes_gladman_cbc_encrypt_mode,
_ccaes_ltc_ecb_decrypt_mode, _ccaes_ltc_ecb_encrypt_mode,
_ccaes_ofb_crypt_mode, _ccaes_siv_decrypt_mode, _ccaes_siv_encrypt_mode,
_ccaes_siv_hmac_sha256_decrypt_mode, _ccaes_siv_hmac_sha256_encrypt_mode,
_ccaes_unwind, _ccaes_xts_decrypt_mode, _ccaes_xts_encrypt_mode,
_ccansikdf_x963, _ccapsic_client_check_intersect_response,
symbols: [ _CCEC_FAULT_CANARY, _CCMLDSA_FAULT_CANARY, _CCRSA_PKCS1_FAULT_CANARY,
_CCRSA_PSS_FAULT_CANARY, _CCSS_PRIME_P192, _CCSS_PRIME_P224,
_CCSS_PRIME_P256, _CCSS_PRIME_P384, _CCSS_PRIME_P521, _cc_abort,
_cc_atfork_child, _cc_atfork_parent, _cc_atfork_prepare, _cc_clear,
_cc_cmp_safe, _cc_impl_name, _cc_try_abort, _cc_try_abort_if,
_ccaes_cbc_decrypt_mode, _ccaes_cbc_encrypt_mode, _ccaes_ccm_decrypt_mode,
_ccaes_ccm_encrypt_mode, _ccaes_cfb8_decrypt_mode, _ccaes_cfb8_encrypt_mode,
_ccaes_cfb_decrypt_mode, _ccaes_cfb_encrypt_mode, _ccaes_ctr_crypt_mode,
_ccaes_ecb_decrypt_mode, _ccaes_ecb_encrypt_mode, _ccaes_gcm_decrypt_mode,
_ccaes_gcm_encrypt_mode, _ccaes_gladman_cbc_decrypt_mode,
_ccaes_gladman_cbc_encrypt_mode, _ccaes_ltc_ecb_decrypt_mode,
_ccaes_ltc_ecb_encrypt_mode, _ccaes_ofb_crypt_mode, _ccaes_siv_decrypt_mode,
_ccaes_siv_encrypt_mode, _ccaes_siv_hmac_sha256_decrypt_mode,
_ccaes_siv_hmac_sha256_encrypt_mode, _ccaes_unwind, _ccaes_xts_decrypt_mode,
_ccaes_xts_encrypt_mode, _ccansikdf_x963, _ccapsic_client_check_intersect_response,
_ccapsic_client_generate_match_response, _ccapsic_client_init,
_ccapsic_client_state_sizeof, _ccapsic_server_determine_intersection,
_ccapsic_server_encode_element, _ccapsic_server_init, _ccapsic_server_state_sizeof,
@ -650,19 +650,20 @@ exports:
_ccmldsa_sign_with_context, _ccmldsa_signature_nbytes_ctx,
_ccmldsa_signature_nbytes_params, _ccmldsa_sizeof_full_ctx,
_ccmldsa_sizeof_pub_ctx, _ccmldsa_verify, _ccmldsa_verify_prehashed,
_ccmldsa_verify_with_context, _ccmode_factory_cbc_decrypt,
_ccmode_factory_cbc_encrypt, _ccmode_factory_ccm_decrypt,
_ccmode_factory_ccm_encrypt, _ccmode_factory_cfb8_decrypt,
_ccmode_factory_cfb8_encrypt, _ccmode_factory_cfb_decrypt,
_ccmode_factory_cfb_encrypt, _ccmode_factory_ctr_crypt, _ccmode_factory_gcm_decrypt,
_ccmode_factory_gcm_encrypt, _ccmode_factory_ofb_crypt, _ccmode_factory_siv_decrypt,
_ccmode_factory_siv_encrypt, _ccmode_factory_xts_decrypt,
_ccmode_factory_xts_encrypt, _ccn_add, _ccn_add1, _ccn_bitlen,
_ccn_cmp, _ccn_cmpn, _ccn_lprint, _ccn_print, _ccn_read_uint,
_ccn_set_bit, _ccn_seti, _ccn_sub, _ccn_swap, _ccn_write_int,
_ccn_write_int_size, _ccn_write_uint, _ccn_write_uint_padded,
_ccn_write_uint_padded_ct, _ccn_write_uint_size, _ccn_xor,
_ccn_zero, _ccnistkdf_ctr_cmac, _ccnistkdf_ctr_cmac_fixed,
_ccmldsa_verify_prehashed_with_canary, _ccmldsa_verify_with_canary,
_ccmldsa_verify_with_context, _ccmldsa_verify_with_context_and_canary,
_ccmode_factory_cbc_decrypt, _ccmode_factory_cbc_encrypt,
_ccmode_factory_ccm_decrypt, _ccmode_factory_ccm_encrypt,
_ccmode_factory_cfb8_decrypt, _ccmode_factory_cfb8_encrypt,
_ccmode_factory_cfb_decrypt, _ccmode_factory_cfb_encrypt,
_ccmode_factory_ctr_crypt, _ccmode_factory_gcm_decrypt, _ccmode_factory_gcm_encrypt,
_ccmode_factory_ofb_crypt, _ccmode_factory_siv_decrypt, _ccmode_factory_siv_encrypt,
_ccmode_factory_xts_decrypt, _ccmode_factory_xts_encrypt,
_ccn_add, _ccn_add1, _ccn_bitlen, _ccn_cmp, _ccn_cmpn, _ccn_lprint,
_ccn_print, _ccn_read_uint, _ccn_set_bit, _ccn_seti, _ccn_sub,
_ccn_swap, _ccn_write_int, _ccn_write_int_size, _ccn_write_uint,
_ccn_write_uint_padded, _ccn_write_uint_padded_ct, _ccn_write_uint_size,
_ccn_xor, _ccn_zero, _ccnistkdf_ctr_cmac, _ccnistkdf_ctr_cmac_fixed,
_ccnistkdf_ctr_hmac, _ccnistkdf_ctr_hmac_fixed, _ccofb_block_size,
_ccofb_context_size, _ccofb_init, _ccofb_one_shot, _ccofb_update,
_ccoid_equal, _ccoid_payload, _ccoid_size, _ccpad_cts1_decrypt,
@ -1116,7 +1117,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libquarantine.dylib'
current-version: 196.0.1
current-version: 196.40.3
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -1281,7 +1282,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_c.dylib'
current-version: 1725.0.11
current-version: 1725.40.4
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -1578,7 +1579,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_collections.dylib'
current-version: 1725.0.11
current-version: 1725.40.4
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -1608,7 +1609,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_configuration.dylib'
current-version: 1385.0.7
current-version: 1385.40.9
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -1643,8 +1644,8 @@ exports:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
symbols: [ _CMCONTAINERSEAM_DEFAULT, _CMDISPATCHSEAM_DEFAULT, _CMFSSEAM_DEFAULT,
_CMNOTIFYSEAM_DEFAULT, _CMPWDSEAM_DEFAULT, _CMSANDBOXSEAM_DEFAULT,
_CONTAINER_CLASS_NAMES, _CONTAINER_NOTIFY_GENERATION_INITIAL,
_CMNOTIFYSEAM_DEFAULT, _CMPWDSEAM_DEFAULT, _CMQUARANTINESEAM_DEFAULT,
_CMSANDBOXSEAM_DEFAULT, _CONTAINER_CLASS_NAMES, _CONTAINER_NOTIFY_GENERATION_INITIAL,
_CONTAINER_NOTIFY_GENERATION_INVALID, _CONTAINER_NOTIFY_USER_INVALIDATED,
_CONTAINER_PERSONA_CURRENT, _CONTAINER_PERSONA_PRIMARY, __container_init,
__container_notify_copy_notify_name, __container_query_get_next_result_sync,
@ -1658,17 +1659,17 @@ exports:
_container_acquire_sandbox_extension, _container_audit_token_copy_codesign_hash,
_container_audit_token_copy_codesign_identifier, _container_audit_token_copy_codesign_team_identifier,
_container_audit_token_copy_entitlement, _container_audit_token_copy_executable_name,
_container_audit_token_for_pid, _container_audit_token_get_codesign_status,
_container_audit_token_get_egid, _container_audit_token_get_euid,
_container_audit_token_get_pid, _container_audit_token_get_platform,
_container_audit_token_is_valid, _container_authorize, _container_authorize_container,
_container_authorize_container_for_self, _container_authorize_get_result_description,
_container_base64_decode, _container_base64_decode_string,
_container_base64_encode, _container_base64_encode_string,
_container_bundle_copy_data_container, _container_bundle_copy_data_container_path,
_container_class_for_each_normalized_class, _container_class_normalized,
_container_class_supports_data_subdirectory, _container_class_supports_randomized_path,
_container_class_supports_randomized_path_on_current_platform,
_container_audit_token_copy_executable_name_with_pid, _container_audit_token_for_pid,
_container_audit_token_get_codesign_status, _container_audit_token_get_egid,
_container_audit_token_get_euid, _container_audit_token_get_pid,
_container_audit_token_get_platform, _container_audit_token_is_valid,
_container_authorize, _container_authorize_container, _container_authorize_container_for_self,
_container_authorize_get_result_description, _container_base64_decode,
_container_base64_decode_string, _container_base64_encode,
_container_base64_encode_string, _container_bundle_copy_data_container,
_container_bundle_copy_data_container_path, _container_class_for_each_normalized_class,
_container_class_normalized, _container_class_supports_data_subdirectory,
_container_class_supports_randomized_path, _container_class_supports_randomized_path_on_current_platform,
_container_client_copy_decoded_from_xpc_object, _container_client_copy_encoded_xpc_object,
_container_client_copy_entitlement, _container_client_create_from_audit_token,
_container_client_get_audit_token, _container_client_get_codesign_identifier,
@ -1680,7 +1681,7 @@ exports:
_container_client_is_signature_valid, _container_client_is_signed,
_container_client_is_test_client, _container_codesign_copy_cdhash,
_container_codesign_copy_cs_identity, _container_codesign_copy_cs_team_identifier,
_container_codesign_copy_current_identifier, _container_codesign_get_self_audit_token,
_container_codesign_get_current_identifier, _container_codesign_get_self_audit_token,
_container_codesign_get_status, _container_copy_client, _container_copy_code_signing_info_for_identifier,
_container_copy_from_path, _container_copy_info, _container_copy_info_value_for_key,
_container_copy_object, _container_copy_path, _container_copy_persona_unique_strings,
@ -1794,7 +1795,8 @@ exports:
_container_seam_dispatch_set_common, _container_seam_fs_ensure_lazy_loaded,
_container_seam_fs_reset, _container_seam_fs_set_common, _container_seam_notify_reset,
_container_seam_notify_set_common, _container_seam_pwd_reset,
_container_seam_pwd_set_common, _container_seam_sandbox_reset,
_container_seam_pwd_set_common, _container_seam_quarantine_reset,
_container_seam_quarantine_set_common, _container_seam_sandbox_reset,
_container_seam_sandbox_set_common, _container_serialize_copy_deserialized_reference,
_container_serialize_copy_serialized_reference, _container_set_code_signing_info_for_identifier,
_container_set_data_protection_for_current_user, _container_set_info_value,
@ -1831,7 +1833,7 @@ exports:
_container_xpc_set_outgoing_message_send_block, _container_xpc_set_use_shared_connection,
_container_xpc_shared_copy_connection, _gCMContainerSeam,
_gCMDispatchSeam, _gCMFSSeam, _gCMNotifySeam, _gCMPWDSeam,
_gCMSandboxSeam ]
_gCMQuarantineSeam, _gCMSandboxSeam ]
- targets: [ x86_64-maccatalyst, arm64-maccatalyst, arm64e-maccatalyst ]
symbols: [ _CONTAINER_CURRENT_MOBILE_UID, _CONTAINER_INSTALLATION_UID,
_CONTAINER_SYSTEM_UID, _container_create_or_lookup, _container_create_or_lookup_app_group_paths,
@ -1925,7 +1927,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_dnssd.dylib'
current-version: 2881.0.25
current-version: 2881.40.18
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -1962,7 +1964,7 @@ exports:
tbd-version: 4
targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
install-name: '/usr/lib/system/libsystem_eligibility.dylib'
current-version: 286
current-version: 286.40.9
parent-umbrella:
- targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
umbrella: System
@ -2118,7 +2120,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_kernel.dylib'
current-version: 12377.1.9
current-version: 12377.41.6
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -2254,7 +2256,7 @@ exports:
_clock_alarm, _clock_alarm_reply, _clock_get_attributes, _clock_get_time,
_clock_set_attributes, _clock_set_time, _clock_sleep, _clock_sleep_trap,
_clonefile, _clonefileat, _close, '_close$NOCANCEL', _coalition_create,
_coalition_info_debug_info, _coalition_info_resource_usage,
_coalition_info_debug_info, _coalition_info_pid_list, _coalition_info_resource_usage,
_coalition_info_set_efficiency, _coalition_info_set_name,
_coalition_ledger_set_logical_writes_limit, _coalition_policy_get,
_coalition_policy_set, _coalition_reap, _coalition_terminate,
@ -2636,7 +2638,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_m.dylib'
current-version: 3307.0.1
current-version: 3309
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst,
arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ]
@ -2858,7 +2860,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_malloc.dylib'
current-version: 792.1.1
current-version: 792.41.1
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -2983,11 +2985,12 @@ exports:
_ne_session_status_to_string, _ne_session_stop, _ne_session_stop_all_with_plugin_type,
_ne_session_stop_reason_to_string, _ne_session_type_to_string,
_ne_session_urlfilter_configs_present, _ne_session_use_as_system_vpn,
_ne_session_vod_evaluate_connection_present, _ne_session_vpn_include_all_networks_configs_present,
_ne_socket_set_attribution, _ne_socket_set_domains, _ne_socket_set_is_app_initiated,
_ne_socket_set_website_attribution, _ne_tracker_build_cache,
_ne_tracker_build_trie, _ne_tracker_check_info_changed, _ne_tracker_check_is_hostname_blocked,
_ne_tracker_check_tcc, _ne_tracker_clear_cache, _ne_tracker_context_can_block_request,
_ne_session_vod_evaluate_connection_present, _ne_session_vpn_configs_present,
_ne_session_vpn_include_all_networks_configs_present, _ne_socket_set_attribution,
_ne_socket_set_domains, _ne_socket_set_is_app_initiated, _ne_socket_set_website_attribution,
_ne_tracker_build_cache, _ne_tracker_build_trie, _ne_tracker_check_info_changed,
_ne_tracker_check_is_hostname_blocked, _ne_tracker_check_tcc,
_ne_tracker_clear_cache, _ne_tracker_context_can_block_request,
_ne_tracker_context_get_domain, _ne_tracker_context_get_domain_owner,
_ne_tracker_context_is_from_app_list, _ne_tracker_context_is_from_web_list,
_ne_tracker_copy_current_stacktrace, _ne_tracker_create_xcode_issue,
@ -3024,7 +3027,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_platform.dylib'
current-version: 359.1.2
current-version: 359.40.3
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -3200,7 +3203,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_sandbox.dylib'
current-version: 2680.0.50
current-version: 2680.41.1
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -3321,7 +3324,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_secinit.dylib'
current-version: 168.0.3
current-version: 168.40.2
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -3354,7 +3357,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libsystem_trace.dylib'
current-version: 1815.0.16
current-version: 1815.40.20
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -3441,7 +3444,7 @@ exports:
tbd-version: 4
targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
install-name: '/usr/lib/system/libsystem_trial.dylib'
current-version: 474
current-version: 474.3
parent-umbrella:
- targets: [ x86_64-macos, arm64-macos, arm64e-macos ]
umbrella: System
@ -3484,7 +3487,7 @@ tbd-version: 4
targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
install-name: '/usr/lib/system/libxpc.dylib'
current-version: 3089.0.11
current-version: 3089.41.2
parent-umbrella:
- targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst,
arm64e-macos, arm64e-maccatalyst ]
@ -3670,10 +3673,10 @@ exports:
_xpc_binprefs_equal, _xpc_binprefs_init, _xpc_binprefs_is_noop,
_xpc_binprefs_set_psattr, _xpc_bool_create, _xpc_bool_get_value,
_xpc_bs_main, _xpc_bundle_copy_info_dictionary, _xpc_bundle_copy_normalized_cryptex_path,
_xpc_bundle_copy_resource_path, _xpc_bundle_copy_services,
_xpc_bundle_create, _xpc_bundle_create_from_origin, _xpc_bundle_create_from_origin_with_string_cache,
_xpc_bundle_create_main, _xpc_bundle_create_with_string_cache,
_xpc_bundle_get_error, _xpc_bundle_get_executable_path, _xpc_bundle_get_info_dictionary,
_xpc_bundle_copy_services, _xpc_bundle_create, _xpc_bundle_create_from_origin,
_xpc_bundle_create_from_origin_with_string_cache, _xpc_bundle_create_main,
_xpc_bundle_create_with_string_cache, _xpc_bundle_get_error,
_xpc_bundle_get_executable_path, _xpc_bundle_get_info_dictionary,
_xpc_bundle_get_path, _xpc_bundle_get_property, _xpc_bundle_get_xpcservice_dictionary,
_xpc_bundle_populate, _xpc_bundle_resolve, _xpc_bundle_resolve_on_queue,
_xpc_bundle_resolve_sync, _xpc_coalition_copy_info, _xpc_coalition_history_pipe_async,
@ -3752,15 +3755,15 @@ exports:
_xpc_event_publisher_set_error_handler, _xpc_event_publisher_set_event,
_xpc_event_publisher_set_handler, _xpc_event_publisher_set_initial_load_completed_handler_4remoted,
_xpc_event_publisher_set_subscriber_keepalive, _xpc_event_publisher_set_throttling,
_xpc_event_stream_check_in, _xpc_event_stream_check_in2, _xpc_exit_reason_get_label,
_xpc_extension_type_init, _xpc_fd_create, _xpc_fd_dup, _xpc_file_transfer_cancel,
_xpc_file_transfer_copy_io, _xpc_file_transfer_create_with_fd,
_xpc_file_transfer_create_with_path, _xpc_file_transfer_get_size,
_xpc_file_transfer_get_transfer_id, _xpc_file_transfer_send_finished,
_xpc_file_transfer_set_transport_writing_callbacks, _xpc_file_transfer_write_finished,
_xpc_file_transfer_write_to_fd, _xpc_file_transfer_write_to_path,
_xpc_generate_audit_token, _xpc_get_attachment_endpoint, _xpc_get_class4NSXPC,
_xpc_get_event_name, _xpc_get_instance, _xpc_get_service_identifier_for_token,
_xpc_exit_reason_get_label, _xpc_extension_type_init, _xpc_fd_create,
_xpc_fd_dup, _xpc_file_transfer_cancel, _xpc_file_transfer_copy_io,
_xpc_file_transfer_create_with_fd, _xpc_file_transfer_create_with_path,
_xpc_file_transfer_get_size, _xpc_file_transfer_get_transfer_id,
_xpc_file_transfer_send_finished, _xpc_file_transfer_set_transport_writing_callbacks,
_xpc_file_transfer_write_finished, _xpc_file_transfer_write_to_fd,
_xpc_file_transfer_write_to_path, _xpc_generate_audit_token,
_xpc_get_attachment_endpoint, _xpc_get_class4NSXPC, _xpc_get_event_name,
_xpc_get_instance, _xpc_get_service_identifier_for_token,
_xpc_get_service_name_from_pid, _xpc_get_service_uid_for_token,
_xpc_get_type, _xpc_handle_service, _xpc_handle_subservice,
_xpc_hash, _xpc_impersonate_user, _xpc_init_services, _xpc_inspect_copy_description,

View File

@ -37,11 +37,11 @@
#if __has_builtin(__is_target_os)
#if __is_target_os(macos)
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_0
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_1
#endif
#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_0
#define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_1
#endif /* __has_builtin(__is_target_os) */
#endif /* defined(__has_builtin) */
#endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */
@ -51,11 +51,11 @@
#if __has_builtin(__is_target_os)
#if __is_target_os(ios)
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_0
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_1
#endif
#elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_0
#define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_1
#endif /* __has_builtin(__is_target_os) */
#endif /* defined(__has_builtin) */
#endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */
@ -65,13 +65,13 @@
#if __has_builtin(__is_target_os)
#if __is_target_os(watchos)
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_0
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_1
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_0
#define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_1
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) */
@ -83,13 +83,13 @@
#if __has_builtin(__is_target_os)
#if __is_target_os(tvos)
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_0
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_1
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif
#elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_0
#define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_1
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0
#endif /* __has_builtin(__is_target_os) */
@ -103,7 +103,7 @@
#if __has_builtin(__is_target_os)
#if __is_target_os(driverkit)
#define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_25_0
#define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_25_1
#endif
#endif /* __has_builtin(__is_target_os) */
#endif /* defined(__has_builtin) */
@ -114,7 +114,7 @@
#if __has_builtin(__is_target_os)
#if __is_target_os(visionos)
#define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_26_0
#define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_26_1
/* for compatibility with existing code. New code should use platform specific checks */
#define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1
#endif

View File

@ -97,6 +97,7 @@
#define __MAC_15_6 150600
#define __MAC_16_0 160000
#define __MAC_26_0 260000
#define __MAC_26_1 260100
/* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#define __IPHONE_2_0 20000
@ -188,6 +189,7 @@
#define __IPHONE_18_6 180600
#define __IPHONE_19_0 190000
#define __IPHONE_26_0 260000
#define __IPHONE_26_1 260100
/* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#define __WATCHOS_1_0 10000
@ -248,6 +250,7 @@
#define __WATCHOS_11_6 110600
#define __WATCHOS_12_0 120000
#define __WATCHOS_26_0 260000
#define __WATCHOS_26_1 260100
/* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#define __TVOS_9_0 90000
@ -308,6 +311,7 @@
#define __TVOS_18_6 180600
#define __TVOS_19_0 190000
#define __TVOS_26_0 260000
#define __TVOS_26_1 260100
/* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#define __BRIDGEOS_2_0 20000
@ -345,6 +349,7 @@
#define __BRIDGEOS_9_5 90500
#define __BRIDGEOS_9_6 90600
#define __BRIDGEOS_10_0 100000
#define __BRIDGEOS_10_1 100100
#define __DRIVERKIT_19_0 190000
@ -369,6 +374,7 @@
#define __DRIVERKIT_24_5 240500
#define __DRIVERKIT_24_6 240600
#define __DRIVERKIT_25_0 250000
#define __DRIVERKIT_25_1 250100
/* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
#define __VISIONOS_1_0 10000
@ -384,6 +390,7 @@
#define __VISIONOS_2_6 20600
#define __VISIONOS_3_0 30000
#define __VISIONOS_26_0 260000
#define __VISIONOS_26_1 260100
/* __VISIONOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */
@ -474,6 +481,7 @@
#define MAC_OS_VERSION_15_6 __MAC_15_6
#define MAC_OS_VERSION_16_0 __MAC_16_0
#define MAC_OS_VERSION_26_0 __MAC_26_0
#define MAC_OS_VERSION_26_1 __MAC_26_1
#endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */

View File

@ -0,0 +1,34 @@
/*
* Copyright (c) 2006-2012 Apple, Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef __COMMONCRYPTO_PUBLIC__
#define __COMMONCRYPTO_PUBLIC__
#include <CommonCrypto/CommonCryptor.h>
#include <CommonCrypto/CommonDigest.h>
#include <CommonCrypto/CommonHMAC.h>
#include <CommonCrypto/CommonKeyDerivation.h>
#include <CommonCrypto/CommonSymmetricKeywrap.h>
#endif /* __COMMONCRYPTO_PUBLIC__ */

View File

@ -0,0 +1,78 @@
//
// CommonCryptoError.h
// CommonCrypto
//
// Copyright (c) 2014 Platform Security. All rights reserved.
//
#ifndef CommonCrypto_CommonCryptoError_h
#define CommonCrypto_CommonCryptoError_h
/*
* Copyright (c) 2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#include <stdint.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*!
@enum CCCryptorStatus
@abstract Return values from CommonCryptor operations.
@constant kCCSuccess Operation completed normally.
@constant kCCParamError Illegal parameter value.
@constant kCCBufferTooSmall Insufficent buffer provided for specified
operation.
@constant kCCMemoryFailure Memory allocation failure.
@constant kCCAlignmentError Input size was not aligned properly.
@constant kCCDecodeError Input data did not decode or decrypt
properly.
@constant kCCUnimplemented Function not implemented for the current
algorithm.
@constant kCCInvalidKey Key is not valid.
*/
enum {
kCCSuccess = 0,
kCCParamError = -4300,
kCCBufferTooSmall = -4301,
kCCMemoryFailure = -4302,
kCCAlignmentError = -4303,
kCCDecodeError = -4304,
kCCUnimplemented = -4305,
kCCOverflow = -4306,
kCCRNGFailure = -4307,
kCCUnspecifiedError = -4308,
kCCCallSequenceError= -4309,
kCCKeySizeError = -4310,
kCCInvalidKey = -4311,
};
typedef int32_t CCStatus;
typedef int32_t CCCryptorStatus;
#if defined(__cplusplus)
}
#endif
#endif

View File

@ -0,0 +1,763 @@
/*
* Copyright (c) 2006-2010 Apple, Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header CommonCryptor.h
@abstract Generic interface for symmetric encryption.
@discussion This interface provides access to a number of symmetric
encryption algorithms. Symmetric encryption algorithms come
in two "flavors" - block ciphers, and stream ciphers. Block
ciphers process data (while both encrypting and decrypting)
in discrete chunks of data called blocks; stream ciphers
operate on arbitrary sized data.
The object declared in this interface, CCCryptor, provides
access to both block ciphers and stream ciphers with the same
API; however some options are available for block ciphers that
do not apply to stream ciphers.
The general operation of a CCCryptor is: initialize it
with raw key data and other optional fields with
CCCryptorCreate(); process input data via one or more calls to
CCCryptorUpdate(), each of which may result in output data
being written to caller-supplied memory; and obtain possible
remaining output data with CCCryptorFinal(). The CCCryptor is
disposed of via CCCryptorRelease(), or it can be reused (with
the same key data as provided to CCCryptorCreate()) by calling
CCCryptorReset(). The CCCryptorReset() function only works for
the CBC and CTR modes. In other block cipher modes, it returns error.
CCCryptors can be dynamically allocated by this module, or
their memory can be allocated by the caller. See discussion for
CCCryptorCreate() and CCCryptorCreateFromData() for information
on CCCryptor allocation.
One option for block ciphers is padding, as defined in PKCS7;
when padding is enabled, the total amount of data encrypted
does not have to be an even multiple of the block size, and
the actual length of plaintext is calculated during decryption.
Another option for block ciphers is Cipher Block Chaining, known
as CBC mode. When using CBC mode, an Initialization Vector (IV)
is provided along with the key when starting an encrypt
or decrypt operation. If CBC mode is selected and no IV is
provided, an IV of all zeroes will be used.
CCCryptor also implements block bufferring, so that individual
calls to CCCryptorUpdate() do not have to provide data whose
length is aligned to the block size. (If padding is disabled,
encrypting with block ciphers does require that the *total*
length of data input to CCCryptorUpdate() call(s) be aligned
to the block size.)
A given CCCryptor can only be used by one thread at a time;
multiple threads can use safely different CCCryptors at the
same time.
*/
#include <CommonCrypto/CommonCryptoError.h>
#ifndef _CC_COMMON_CRYPTOR_
#define _CC_COMMON_CRYPTOR_
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#if defined(_MSC_VER)
#include <availability.h>
#else
#include <os/availability.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*!
@typedef CCCryptorRef
@abstract Opaque reference to a CCCryptor object.
*/
typedef struct _CCCryptor *CCCryptorRef;
/*!
@enum CCOperation
@abstract Operations that an CCCryptor can perform.
@constant kCCEncrypt Symmetric encryption.
@constant kCCDecrypt Symmetric decryption.
*/
enum {
kCCEncrypt = 0,
kCCDecrypt,
};
typedef uint32_t CCOperation;
/*!
@enum CCAlgorithm
@abstract Encryption algorithms implemented by this module.
@constant kCCAlgorithmAES Advanced Encryption Standard, 128-bit block
@constant kCCAlgorithmAES128 Deprecated, name phased out due to ambiguity with key size
@constant kCCAlgorithmDES Data Encryption Standard
@constant kCCAlgorithm3DES Triple-DES, three key, EDE configuration
@constant kCCAlgorithmCAST CAST
@constant kCCAlgorithmRC4 RC4 stream cipher
@constant kCCAlgorithmBlowfish Blowfish block cipher
*/
enum {
kCCAlgorithmAES128 = 0, /* Deprecated, name phased out due to ambiguity with key size */
kCCAlgorithmAES = 0,
kCCAlgorithmDES,
kCCAlgorithm3DES,
kCCAlgorithmCAST,
kCCAlgorithmRC4,
kCCAlgorithmRC2,
kCCAlgorithmBlowfish
};
typedef uint32_t CCAlgorithm;
/*!
@enum CCOptions
@abstract Options flags, passed to CCCryptorCreate().
@constant kCCOptionPKCS7Padding Perform PKCS7 padding.
@constant kCCOptionECBMode Electronic Code Book Mode.
Default is CBC.
*/
enum {
/* options for block ciphers */
kCCOptionPKCS7Padding = 0x0001,
kCCOptionECBMode = 0x0002
/* stream ciphers currently have no options */
};
typedef uint32_t CCOptions;
/*!
@enum Key sizes
@discussion Key sizes, in bytes, for supported algorithms. Use these
constants to select any keysize variants you wish to use
for algorithms that support them (ie AES-128, AES-192, AES-256)
@constant kCCKeySizeAES128 128 bit AES key size.
@constant kCCKeySizeAES192 192 bit AES key size.
@constant kCCKeySizeAES256 256 bit AES key size.
@constant kCCKeySizeDES DES key size.
@constant kCCKeySize3DES Triple DES key size.
@constant kCCKeySizeMinCAST CAST minimum key size.
@constant kCCKeySizeMaxCAST CAST maximum key size.
@constant kCCKeySizeMinRC4 RC4 minimum key size.
@constant kCCKeySizeMaxRC4 RC4 maximum key size.
@discussion DES and TripleDES have fixed key sizes.
AES has three discrete key sizes.
CAST and RC4 have variable key sizes.
*/
enum {
kCCKeySizeAES128 = 16,
kCCKeySizeAES192 = 24,
kCCKeySizeAES256 = 32,
kCCKeySizeDES = 8,
kCCKeySize3DES = 24,
kCCKeySizeMinCAST = 5,
kCCKeySizeMaxCAST = 16,
kCCKeySizeMinRC4 = 1,
kCCKeySizeMaxRC4 = 512,
kCCKeySizeMinRC2 = 1,
kCCKeySizeMaxRC2 = 128,
kCCKeySizeMinBlowfish = 8,
kCCKeySizeMaxBlowfish = 56,
};
/*!
@enum Block sizes
@discussion Block sizes, in bytes, for supported algorithms.
@constant kCCBlockSizeAES128 AES block size (currently, only 128-bit
blocks are supported).
@constant kCCBlockSizeDES DES block size.
@constant kCCBlockSize3DES Triple DES block size.
@constant kCCBlockSizeCAST CAST block size.
*/
enum {
/* AES */
kCCBlockSizeAES128 = 16,
/* DES */
kCCBlockSizeDES = 8,
/* 3DES */
kCCBlockSize3DES = 8,
/* CAST */
kCCBlockSizeCAST = 8,
kCCBlockSizeRC2 = 8,
kCCBlockSizeBlowfish = 8,
};
/*!
@enum Minimum context sizes
@discussion Minimum context sizes, for caller-allocated CCCryptorRefs.
To minimize dynamic allocation memory, a caller can create
a CCCryptorRef by passing caller-supplied memory to the
CCCryptorCreateFromData() function.
These constants define the minimum amount of memory, in
bytes, needed for CCCryptorRefs for each supported algorithm.
Note: these constants are valid for the current version of
this library; they may change in subsequent releases, so
applications wishing to allocate their own memory for use
in creating CCCryptorRefs must be prepared to deal with
a kCCBufferTooSmall return from CCCryptorCreateFromData().
See discussion for the CCCryptorCreateFromData() function.
@constant kCCContextSizeAES128 - Minimum context size for kCCAlgorithmAES128.
@constant kCCContextSizeDES - Minimum context size for kCCAlgorithmDES.
@constant kCCContextSize3DES - Minimum context size for kCCAlgorithm3DES.
@constant kCCContextSizeCAST - Minimum context size for kCCAlgorithmCAST.
@constant kCCContextSizeRC4 - Minimum context size for kCCAlgorithmRC4.
*/
enum {
kCCContextSizeAES128 = 404,
kCCContextSizeDES = 240,
kCCContextSize3DES = 496,
kCCContextSizeCAST = 240,
kCCContextSizeRC4 = 1072
};
/*!
@function CCCryptorCreate
@abstract Create a cryptographic context.
@param op Defines the basic operation: kCCEncrypt or
kCCDecrypt.
@param alg Defines the algorithm.
@param options A word of flags defining options. See discussion
for the CCOptions type.
@param key Raw key material, length keyLength bytes.
@param keyLength Length of key material. Must be appropriate
for the selected operation and algorithm. Some
algorithms provide for varying key lengths.
@param iv Initialization vector, optional. Used by
block ciphers when Cipher Block Chaining (CBC)
mode is enabled. If present, must be the same
length as the selected algorithm's block size.
If CBC mode is selected (by the absence of the
kCCOptionECBMode bit in the options flags) and no
IV is present, a NULL (all zeroes) IV will be used.
This parameter is ignored if ECB mode is used or
if a stream cipher algorithm is selected. For sound
encryption, always initialize iv with random data.
@param cryptorRef A (required) pointer to the returned CCCryptorRef.
@result Possible error returns are kCCParamError and kCCMemoryFailure.
*/
CCCryptorStatus CCCryptorCreate(
CCOperation op, /* kCCEncrypt, etc. */
CCAlgorithm alg, /* kCCAlgorithmDES, etc. */
CCOptions options, /* kCCOptionPKCS7Padding, etc. */
const void *key, /* raw key material */
size_t keyLength,
const void *iv, /* optional initialization vector */
CCCryptorRef *cryptorRef) /* RETURNED */
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCCryptorCreateFromData
@abstract Create a cryptographic context using caller-supplied memory.
@param op Defines the basic operation: kCCEncrypt or
kCCDecrypt.
@param alg Defines the algorithm.
@param options A word of flags defining options. See discussion
for the CCOptions type.
@param key Raw key material, length keyLength bytes.
@param keyLength Length of key material. Must be appropriate
for the selected operation and algorithm. Some
algorithms provide for varying key lengths.
@param iv Initialization vector, optional. Used by
block ciphers when Cipher Block Chaining (CBC)
mode is enabled. If present, must be the same
length as the selected algorithm's block size.
If CBC mode is selected (by the absence of the
kCCOptionECBMode bit in the options flags) and no
IV is present, a NULL (all zeroes) IV will be used.
This parameter is ignored if ECB mode is used or
if a stream cipher algorithm is selected. For sound
encryption, always initialize iv with random data.
@param data A pointer to caller-supplied memory from which the
CCCryptorRef will be created.
@param dataLength The size of the caller-supplied memory in bytes.
@param cryptorRef A (required) pointer to the returned CCCryptorRef.
@param dataUsed Optional. If present, the actual number of bytes of
the caller-supplied memory which was consumed by
creation of the CCCryptorRef is returned here. Also,
if the supplied memory is of insufficent size to create
a CCCryptorRef, kCCBufferTooSmall is returned, and
the minimum required buffer size is returned via this
parameter if present.
@result Possible error returns are kCCParamError and kCCBufferTooSmall.
@discussion The CCCryptorRef created by this function must be disposed of
via CCCRyptorRelease which clears sensitive data and deallocates memory
when the caller is finished using the CCCryptorRef.
*/
CCCryptorStatus CCCryptorCreateFromData(
CCOperation op, /* kCCEncrypt, etc. */
CCAlgorithm alg, /* kCCAlgorithmDES, etc. */
CCOptions options, /* kCCOptionPKCS7Padding, etc. */
const void *key, /* raw key material */
size_t keyLength,
const void *iv, /* optional initialization vector */
const void *data, /* caller-supplied memory */
size_t dataLength, /* length of data in bytes */
CCCryptorRef *cryptorRef, /* RETURNED */
size_t *dataUsed) /* optional, RETURNED */
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCCryptorRelease
@abstract Free a context created by CCCryptorCreate or
CCCryptorCreateFromData().
@param cryptorRef The CCCryptorRef to release.
@result The only possible error return is kCCParamError resulting
from passing in a null CCCryptorRef.
*/
CCCryptorStatus CCCryptorRelease(
CCCryptorRef cryptorRef)
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCCryptorUpdate
@abstract Process (encrypt, decrypt) some data. The result, if any,
is written to a caller-provided buffer.
@param cryptorRef A CCCryptorRef created via CCCryptorCreate() or
CCCryptorCreateFromData().
@param dataIn Data to process, length dataInLength bytes.
@param dataInLength Length of data to process.
@param dataOut Result is written here. Allocated by caller.
Encryption and decryption can be performed
"in-place", with the same buffer used for
input and output. The in-place operation is not
suported for ciphers modes that work with blocks
of data such as CBC and ECB.
@param dataOutAvailable The size of the dataOut buffer in bytes.
@param dataOutMoved On successful return, the number of bytes
written to dataOut.
@result kCCBufferTooSmall indicates insufficent space in the dataOut
buffer. The caller can use
CCCryptorGetOutputLength() to determine the
required output buffer size in this case. The
operation can be retried; no state is lost
when this is returned.
@discussion This routine can be called multiple times. The caller does
not need to align input data lengths to block sizes; input is
bufferred as necessary for block ciphers.
When performing symmetric encryption with block ciphers,
and padding is enabled via kCCOptionPKCS7Padding, the total
number of bytes provided by all the calls to this function
when encrypting can be arbitrary (i.e., the total number
of bytes does not have to be block aligned). However if
padding is disabled, or when decrypting, the total number
of bytes does have to be aligned to the block size; otherwise
CCCryptFinal() will return kCCAlignmentError.
A general rule for the size of the output buffer which must be
provided by the caller is that for block ciphers, the output
length is never larger than the input length plus the block size.
For stream ciphers, the output length is always exactly the same
as the input length. See the discussion for
CCCryptorGetOutputLength() for more information on this topic.
Generally, when all data has been processed, call
CCCryptorFinal().
In the following cases, the CCCryptorFinal() is superfluous as
it will not yield any data nor return an error:
1. Encrypting or decrypting with a block cipher with padding
disabled, when the total amount of data provided to
CCCryptorUpdate() is an integral multiple of the block size.
2. Encrypting or decrypting with a stream cipher.
*/
CCCryptorStatus CCCryptorUpdate(
CCCryptorRef cryptorRef,
const void *dataIn,
size_t dataInLength,
void *dataOut, /* data RETURNED here */
size_t dataOutAvailable,
size_t *dataOutMoved) /* number of bytes written */
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCCryptorFinal
@abstract Finish an encrypt or decrypt operation, and obtain the (possible)
final data output.
@param cryptorRef A CCCryptorRef created via CCCryptorCreate() or
CCCryptorCreateFromData().
@param dataOut Result is written here. Allocated by caller.
@param dataOutAvailable The size of the dataOut buffer in bytes.
@param dataOutMoved On successful return, the number of bytes
written to dataOut.
@result kCCBufferTooSmall indicates insufficent space in the dataOut
buffer. The caller can use
CCCryptorGetOutputLength() to determine the
required output buffer size in this case. The
operation can be retried; no state is lost
when this is returned.
kCCAlignmentError When decrypting, or when encrypting with a
block cipher with padding disabled,
kCCAlignmentError will be returned if the total
number of bytes provided to CCCryptUpdate() is
not an integral multiple of the current
algorithm's block size.
kCCDecodeError Indicates garbled ciphertext or the
wrong key during decryption. This can only
be returned while decrypting with padding
enabled.
@discussion Except when kCCBufferTooSmall is returned, the CCCryptorRef
can no longer be used for subsequent operations unless
CCCryptorReset() is called on it.
It is not necessary to call CCCryptorFinal() when performing
symmetric encryption or decryption if padding is disabled, or
when using a stream cipher.
It is not necessary to call CCCryptorFinal() prior to
CCCryptorRelease() when aborting an operation.
*/
CCCryptorStatus CCCryptorFinal(
CCCryptorRef cryptorRef,
void *dataOut,
size_t dataOutAvailable,
size_t *dataOutMoved) /* number of bytes written */
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCCryptorGetOutputLength
@abstract Determine output buffer size required to process a given input
size.
@param cryptorRef A CCCryptorRef created via CCCryptorCreate() or
CCCryptorCreateFromData().
@param inputLength The length of data which will be provided to
CCCryptorUpdate().
@param final If false, the returned value will indicate the
output buffer space needed when 'inputLength'
bytes are provided to CCCryptorUpdate(). When
'final' is true, the returned value will indicate
the total combined buffer space needed when
'inputLength' bytes are provided to
CCCryptorUpdate() and then CCCryptorFinal() is
called.
@result The maximum buffer space need to perform CCCryptorUpdate() and
optionally CCCryptorFinal().
@discussion Some general rules apply that allow clients of this module to
know a priori how much output buffer space will be required
in a given situation. For stream ciphers, the output size is
always equal to the input size, and CCCryptorFinal() never
produces any data. For block ciphers, the output size will
always be less than or equal to the input size plus the size
of one block. For block ciphers, if the input size provided
to each call to CCCryptorUpdate() is is an integral multiple
of the block size, then the output size for each call to
CCCryptorUpdate() is less than or equal to the input size
for that call to CCCryptorUpdate(). CCCryptorFinal() only
produces output when using a block cipher with padding enabled.
*/
size_t CCCryptorGetOutputLength(
CCCryptorRef cryptorRef,
size_t inputLength,
bool final)
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCCryptorReset
@abstract Reinitializes an existing CCCryptorRef with a (possibly)
new initialization vector. The CCCryptorRef's key is
unchanged. Use only for CBC and CTR modes.
@param cryptorRef A CCCryptorRef created via CCCryptorCreate() or
CCCryptorCreateFromData().
@param iv Optional initialization vector; if present, must
be the same size as the current algorithm's block
size. For sound encryption, always initialize iv with
random data.
@result The only possible errors are kCCParamError and
kCCUnimplemented. On macOS 10.13, iOS 11, watchOS 4 and tvOS 11 returns kCCUnimplemented
for modes other than CBC. On prior SDKs, returns kCCSuccess to preserve compatibility
@discussion This can be called on a CCCryptorRef with data pending (i.e.
in a padded mode operation before CCCryptFinal is called);
however any pending data will be lost in that case.
*/
CCCryptorStatus CCCryptorReset(
CCCryptorRef cryptorRef,
const void *iv)
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCCrypt
@abstract Stateless, one-shot encrypt or decrypt operation.
This basically performs a sequence of CCCrytorCreate(),
CCCryptorUpdate(), CCCryptorFinal(), and CCCryptorRelease().
@param alg Defines the encryption algorithm.
@param op Defines the basic operation: kCCEncrypt or
kCCDecrypt.
@param options A word of flags defining options. See discussion
for the CCOptions type.
@param key Raw key material, length keyLength bytes.
@param keyLength Length of key material. Must be appropriate
for the select algorithm. Some algorithms may
provide for varying key lengths.
@param iv Initialization vector, optional. Used for
Cipher Block Chaining (CBC) mode. If present,
must be the same length as the selected
algorithm's block size. If CBC mode is
selected (by the absence of any mode bits in
the options flags) and no IV is present, a
NULL (all zeroes) IV will be used. This is
ignored if ECB mode is used or if a stream
cipher algorithm is selected. For sound encryption,
always initialize IV with random data.
@param dataIn Data to encrypt or decrypt, length dataInLength
bytes.
@param dataInLength Length of data to encrypt or decrypt.
@param dataOut Result is written here. Allocated by caller.
Encryption and decryption can be performed
"in-place", with the same buffer used for
input and output.
@param dataOutAvailable The size of the dataOut buffer in bytes.
@param dataOutMoved On successful return, the number of bytes
written to dataOut. If kCCBufferTooSmall is
returned as a result of insufficient buffer
space being provided, the required buffer space
is returned here.
@result kCCBufferTooSmall indicates insufficent space in the dataOut
buffer. In this case, the *dataOutMoved
parameter will indicate the size of the buffer
needed to complete the operation. The
operation can be retried with minimal runtime
penalty.
kCCAlignmentError indicates that dataInLength was not properly
aligned. This can only be returned for block
ciphers, and then only when decrypting or when
encrypting with block with padding disabled.
kCCDecodeError Indicates improperly formatted ciphertext or
a "wrong key" error; occurs only during decrypt
operations.
*/
CCCryptorStatus CCCrypt(
CCOperation op, /* kCCEncrypt, etc. */
CCAlgorithm alg, /* kCCAlgorithmAES128, etc. */
CCOptions options, /* kCCOptionPKCS7Padding, etc. */
const void *key,
size_t keyLength,
const void *iv, /* optional initialization vector */
const void *dataIn, /* optional per op and alg */
size_t dataInLength,
void *dataOut, /* data RETURNED here */
size_t dataOutAvailable,
size_t *dataOutMoved)
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@enum Cipher Modes
@discussion These are the selections available for modes of operation for
use with block ciphers. If RC4 is selected as the cipher (a stream
cipher) the only correct mode is kCCModeRC4.
@constant kCCModeECB - Electronic Code Book Mode.
@constant kCCModeCBC - Cipher Block Chaining Mode.
@constant kCCModeCFB - Cipher Feedback Mode.
@constant kCCModeOFB - Output Feedback Mode.
@constant kCCModeRC4 - RC4 as a streaming cipher is handled internally as a mode.
@constant kCCModeCFB8 - Cipher Feedback Mode producing 8 bits per round.
*/
enum {
kCCModeECB = 1,
kCCModeCBC = 2,
kCCModeCFB = 3,
kCCModeCTR = 4,
kCCModeOFB = 7,
kCCModeRC4 = 9,
kCCModeCFB8 = 10,
};
typedef uint32_t CCMode;
/*!
@enum Padding for Block Ciphers
@discussion These are the padding options available for block modes.
@constant ccNoPadding - No padding.
@constant ccPKCS7Padding - PKCS7 Padding.
*/
enum {
ccNoPadding = 0,
ccPKCS7Padding = 1,
};
typedef uint32_t CCPadding;
/*!
@enum Mode options - Not currently in use.
@discussion Values used to specify options for modes. This was used for counter
mode operations in 10.8, now only Big Endian mode is supported.
@constant kCCModeOptionCTR_BE - CTR Mode Big Endian.
*/
enum {
kCCModeOptionCTR_BE = 2
};
typedef uint32_t CCModeOptions;
/*!
@function CCCryptorCreateWithMode
@abstract Create a cryptographic context.
@param op Defines the basic operation: kCCEncrypt or
kCCDecrypt.
@param mode Specifies the cipher mode to use for operations.
@param alg Defines the algorithm.
@param padding Specifies the padding to use.
@param iv Initialization vector, optional. Used by
block ciphers with the following modes:
Cipher Block Chaining (CBC)
Cipher Feedback (CFB and CFB8)
Output Feedback (OFB)
Counter (CTR)
If present, must be the same length as the selected
algorithm's block size. If no IV is present, a NULL
(all zeroes) IV will be used. For sound encryption,
always initialize iv with random data.
This parameter is ignored if ECB mode is used or
if a stream cipher algorithm is selected.
@param key Raw key material, length keyLength bytes.
@param keyLength Length of key material. Must be appropriate
for the selected operation and algorithm. Some
algorithms provide for varying key lengths.
@param tweak Raw key material, length keyLength bytes. Used for the
tweak key in XEX-based Tweaked CodeBook (XTS) mode.
@param tweakLength Length of tweak key material. Must be appropriate
for the selected operation and algorithm. Some
algorithms provide for varying key lengths. For XTS
this is the same length as the encryption key.
@param numRounds The number of rounds of the cipher to use. 0 uses the default.
@param options A word of flags defining options. See discussion
for the CCModeOptions type.
@param cryptorRef A (required) pointer to the returned CCCryptorRef.
@result Possible error returns are kCCParamError and kCCMemoryFailure.
*/
CCCryptorStatus CCCryptorCreateWithMode(
CCOperation op, /* kCCEncrypt, kCCDecrypt */
CCMode mode,
CCAlgorithm alg,
CCPadding padding,
const void *iv, /* optional initialization vector */
const void *key, /* raw key material */
size_t keyLength,
const void *tweak, /* raw tweak material */
size_t tweakLength,
int numRounds, /* 0 == default */
CCModeOptions options,
CCCryptorRef *cryptorRef) /* RETURNED */
API_AVAILABLE(macos(10.7), ios(5.0));
#ifdef __cplusplus
}
#endif
#endif /* _CC_COMMON_CRYPTOR_ */

View File

@ -0,0 +1,162 @@
/*
* Copyright (c) 2004 Apple Computer, Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
/*!
@header CommonHMAC.h
@abstract Keyed Message Authentication Code (HMAC) functions.
*/
#ifndef _CC_COMMON_HMAC_H_
#define _CC_COMMON_HMAC_H_
#include <CommonCrypto/CommonDigest.h>
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
/*!
@enum CCHmacAlgorithm
@abstract Algorithms implemented in this module.
@constant kCCHmacAlgSHA1 HMAC with SHA1 digest
@constant kCCHmacAlgMD5 HMAC with MD5 digest
@constant kCCHmacAlgSHA256 HMAC with SHA256 digest
@constant kCCHmacAlgSHA384 HMAC with SHA384 digest
@constant kCCHmacAlgSHA512 HMAC with SHA512 digest
@constant kCCHmacAlgSHA224 HMAC with SHA224 digest
*/
enum {
kCCHmacAlgSHA1,
kCCHmacAlgMD5,
kCCHmacAlgSHA256,
kCCHmacAlgSHA384,
kCCHmacAlgSHA512,
kCCHmacAlgSHA224
};
typedef uint32_t CCHmacAlgorithm;
/*!
@typedef CCHmacContext
@abstract HMAC context.
*/
#define CC_HMAC_CONTEXT_SIZE 96
typedef struct {
uint32_t ctx[CC_HMAC_CONTEXT_SIZE];
} CCHmacContext;
/*!
@function CCHmacInit
@abstract Initialize an CCHmacContext with provided raw key bytes.
@param ctx An HMAC context.
@param algorithm HMAC algorithm to perform.
@param key Raw key bytes.
@param keyLength Length of raw key bytes; can be any
length including zero.
*/
void CCHmacInit(
CCHmacContext *ctx,
CCHmacAlgorithm algorithm,
const void *key,
size_t keyLength)
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCHmacUpdate
@abstract Process some data.
@param ctx An HMAC context.
@param data Data to process.
@param dataLength Length of data to process, in bytes.
@discussion This can be called multiple times.
*/
void CCHmacUpdate(
CCHmacContext *ctx,
const void *data,
size_t dataLength)
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCHmacFinal
@abstract Obtain the final Message Authentication Code.
@param ctx An HMAC context.
@param macOut Destination of MAC; allocated by caller.
@discussion The length of the MAC written to *macOut is the same as
the digest length associated with the HMAC algorithm:
kCCHmacAlgSHA1 : CC_SHA1_DIGEST_LENGTH
kCCHmacAlgSHA256 : CC_SHA256_DIGEST_LENGTH
The MAC must be verified by comparing the computed and expected values
using timingsafe_bcmp. Other comparison functions (e.g. memcmp)
must not be used as they may be vulnerable to practical timing attacks,
leading to MAC forgery.
*/
void CCHmacFinal(
CCHmacContext *ctx,
void *macOut)
API_AVAILABLE(macos(10.4), ios(2.0));
/*!
@function CCHmac
@abstract Stateless, one-shot HMAC function
@param algorithm HMAC algorithm to perform.
@param key Raw key bytes.
@param keyLength Length of raw key bytes; can be any
length including zero.
@param data Data to process.
@param dataLength Length of data to process, in bytes.
@param macOut Destination of MAC; allocated by caller.
@discussion The length of the MAC written to *macOut is the same as the digest length associated with the HMAC algorithm:
kCCHmacAlgSHA1 : CC_SHA1_DIGEST_LENGTH
kCCHmacAlgSHA256 : CC_SHA256_DIGEST_LENGTH
The MAC must be verified by comparing the computed and expected values
using timingsafe_bcmp. Other comparison functions (e.g. memcmp)
must not be used as they may be vulnerable to practical timing attacks,
leading to MAC forgery.
*/
void CCHmac(
CCHmacAlgorithm algorithm, /* kCCHmacAlgSHA256, kCCHmacAlgSHA1 */
const void *key,
size_t keyLength, /* length of key in bytes */
const void *data,
size_t dataLength, /* length of data in bytes */
void *macOut) /* MAC written here */
API_AVAILABLE(macos(10.4), ios(2.0));
#ifdef __cplusplus
}
#endif
#endif /* _CC_COMMON_HMAC_H_ */

View File

@ -0,0 +1,136 @@
/*
* Copyright (c) 2010 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _CC_PBKDF_H_
#define _CC_PBKDF_H_
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#include <CommonCrypto/CommonDigest.h>
#include <CommonCrypto/CommonHMAC.h>
#ifdef __cplusplus
extern "C" {
#endif
enum {
kCCPBKDF2 = 2,
};
typedef uint32_t CCPBKDFAlgorithm;
enum {
kCCPRFHmacAlgSHA1 = 1,
kCCPRFHmacAlgSHA224 = 2,
kCCPRFHmacAlgSHA256 = 3,
kCCPRFHmacAlgSHA384 = 4,
kCCPRFHmacAlgSHA512 = 5,
};
typedef uint32_t CCPseudoRandomAlgorithm;
/*
@function CCKeyDerivationPBKDF
@abstract Derive a key from a text password/passphrase
@param algorithm Currently only PBKDF2 is available via kCCPBKDF2
@param password The text password used as input to the derivation
function. The actual octets present in this string
will be used with no additional processing. It's
extremely important that the same encoding and
normalization be used each time this routine is
called if the same key is expected to be derived.
@param passwordLen The length of the text password in bytes.
@param salt The salt byte values used as input to the derivation
function. The pointer can be NULL, only when saltLen is zero.
@param saltLen The length of the salt in bytes. It can be zero.
@param prf The Pseudo Random Algorithm to use for the derivation
iterations.
@param rounds The number of rounds of the Pseudo Random Algorithm
to use. It cannot be zero.
@param derivedKey The resulting derived key produced by the function.
The space for this must be provided by the caller.
@param derivedKeyLen The expected length of the derived key in bytes. It cannot be zero.
@discussion The following values are used to designate the PRF:
* kCCPRFHmacAlgSHA1
* kCCPRFHmacAlgSHA224
* kCCPRFHmacAlgSHA256
* kCCPRFHmacAlgSHA384
* kCCPRFHmacAlgSHA512
@result kCCParamError can result from bad values for the password, salt,
and unwrapped key pointers as well as a bad value for the prf
function.
*/
int
CCKeyDerivationPBKDF( CCPBKDFAlgorithm algorithm, const char *password, size_t passwordLen,
const uint8_t *salt, size_t saltLen,
CCPseudoRandomAlgorithm prf, unsigned rounds,
uint8_t *derivedKey, size_t derivedKeyLen)
API_AVAILABLE(macos(10.7), ios(5.0));
/*
* All lengths are in bytes - not bits.
*/
/*
@function CCCalibratePBKDF
@abstract Determine the number of PRF rounds to use for a specific delay on
the current platform.
@param algorithm Currently only PBKDF2 is available via kCCPBKDF2
@param passwordLen The length of the text password in bytes.
@param saltLen The length of the salt in bytes. saltlen must be smaller than 133.
@param prf The Pseudo Random Algorithm to use for the derivation
iterations.
@param derivedKeyLen The expected length of the derived key in bytes.
@param msec The targetted duration we want to achieve for a key
derivation with these parameters.
@result the number of iterations to use for the desired processing time.
Returns a minimum of 10000 iterations (safety net, not a particularly recommended value)
The number of iterations is a trade-off of usability and security. If there is an error
the function returns (unsigned)(-1). The minimum return value is set to 10000.
*/
unsigned
CCCalibratePBKDF(CCPBKDFAlgorithm algorithm, size_t passwordLen, size_t saltLen,
CCPseudoRandomAlgorithm prf, size_t derivedKeyLen, uint32_t msec)
API_AVAILABLE(macos(10.7), ios(5.0));
#ifdef __cplusplus
}
#endif
#endif /* _CC_PBKDF_H_ */

View File

@ -0,0 +1,63 @@
/*
* Copyright (c) 2014 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
//
// CommonRandom.h
// CommonCrypto
#ifndef CommonCrypto_CommonRandom_h
#define CommonCrypto_CommonRandom_h
#include <sys/types.h>
#include <os/availability.h>
#include <CommonCrypto/CommonCryptoError.h>
#if defined(__cplusplus)
extern "C" {
#endif
typedef CCCryptorStatus CCRNGStatus;
/*!
@function CCRandomGenerateBytes
@abstract Return random bytes in a buffer allocated by the caller.
@discussion The PRNG returns cryptographically strong random
bits suitable for use as cryptographic keys, IVs, nonces etc.
@param bytes Pointer to the return buffer.
@param count Number of random bytes to return.
@result Return kCCSuccess on success.
*/
CCRNGStatus CCRandomGenerateBytes(void *bytes, size_t count)
API_AVAILABLE(macos(10.10), ios(8.0));
#if defined(__cplusplus)
}
#endif
#endif

View File

@ -0,0 +1,162 @@
/*
* Copyright (c) 2010 Apple Inc. All Rights Reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _CC_SYMKEYWRAP_H_
#define _CC_SYMKEYWRAP_H_
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <limits.h>
#include <stdlib.h>
#if defined(_MSC_VER)
#include <availability.h>
#else
#include <os/availability.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
enum {
kCCWRAPAES = 1,
};
extern const uint8_t * const CCrfc3394_iv API_AVAILABLE(macos(10.7), ios(5.0));
extern const size_t CCrfc3394_ivLen API_AVAILABLE(macos(10.7), ios(5.0));
typedef uint32_t CCWrappingAlgorithm;
/*!
@function CCSymmetricKeyWrap
@abstract Wrap a symmetric key with a Key Encryption Key (KEK).
@param algorithm Currently only AES Keywrapping (rfc3394) is available
via kCCWRAPAES
@param iv The initialization value to be used. CCrfc3394_iv is
available as a constant for the standard IV to use.
@param ivLen The length of the initialization value to be used.
CCrfc3394_ivLen is available as a constant for the
standard IV to use.
@param kek The Key Encryption Key to be used to wrap the raw key.
@param kekLen The length of the KEK in bytes.
@param rawKey The raw key bytes to be wrapped.
@param rawKeyLen The length of the key in bytes.
@param wrappedKey The resulting wrapped key produced by the function.
The space for this must be provided by the caller.
@param wrappedKeyLen The length of the wrapped key in bytes.
@discussion The algorithm chosen is determined by the algorithm parameter
and the size of the key being wrapped (ie aes128 for 128 bit
keys).
@result kCCBufferTooSmall indicates insufficent space in the wrappedKey
buffer.
kCCParamError can result from bad values for the kek, rawKey, and
wrappedKey key pointers.
*/
int
CCSymmetricKeyWrap(CCWrappingAlgorithm algorithm,
const uint8_t *iv, const size_t ivLen,
const uint8_t *kek, size_t kekLen,
const uint8_t *rawKey, size_t rawKeyLen,
uint8_t *wrappedKey, size_t *wrappedKeyLen)
API_AVAILABLE(macos(10.7), ios(5.0));
/*!
@function CCSymmetricKeyUnwrap
@abstract Unwrap a symmetric key with a Key Encryption Key (KEK).
@param algorithm Currently only AES Keywrapping (rfc3394) is available
via kCCWRAPAES
@param iv The initialization value to be used. CCrfc3394_iv is
available as a constant for the standard IV to use.
@param ivLen The length of the initialization value to be used.
CCrfc3394_ivLen is available as a constant for the
standard IV to use.
@param kek The Key Encryption Key to be used to unwrap the raw key.
@param kekLen The length of the KEK in bytes.
@param wrappedKey The wrapped key bytes.
@param wrappedKeyLen The length of the wrapped key in bytes.
@param rawKey The resulting raw key bytes. The space for this must
be provided by the caller.
@param rawKeyLen The length of the raw key in bytes.
@discussion The algorithm chosen is determined by the algorithm parameter
and the size of the key being wrapped (ie aes128 for 128 bit
keys).
@result kCCBufferTooSmall indicates insufficent space in the rawKey buffer.
kCCParamError can result from bad values for the kek, rawKey, and
wrappedKey key pointers.
*/
int
CCSymmetricKeyUnwrap(CCWrappingAlgorithm algorithm,
const uint8_t *iv, const size_t ivLen,
const uint8_t *kek, size_t kekLen,
const uint8_t *wrappedKey, size_t wrappedKeyLen,
uint8_t *rawKey, size_t *rawKeyLen)
API_AVAILABLE(macos(10.7), ios(5.0));
/*!
@function CCSymmetricWrappedSize
@abstract Determine the buffer size required to hold a key wrapped with
CCAESKeyWrap().
@param algorithm Currently only AES Keywrapping (rfc3394) is
available via kCCWRAPAES
@param rawKeyLen The length of the key in bytes.
@result The length of the resulting wrapped key.
*/
size_t
CCSymmetricWrappedSize(CCWrappingAlgorithm algorithm, size_t rawKeyLen)
API_AVAILABLE(macos(10.7), ios(5.0));
/*!
@function CCSymmetricUnwrappedSize
@abstract Determine the buffer size required to hold a key unwrapped with
CCAESKeyUnwrap().
@param algorithm Currently only AES Keywrapping (rfc3394) is
available via kCCWRAPAES
@param wrappedKeyLen The length of the wrapped key in bytes.
@result The length of the resulting raw key.
*/
size_t
CCSymmetricUnwrappedSize(CCWrappingAlgorithm algorithm, size_t wrappedKeyLen)
API_AVAILABLE(macos(10.7), ios(5.0));
#ifdef __cplusplus
}
#endif
#endif /* _CC_SYMKEYWRAP_H_ */

View File

@ -0,0 +1,151 @@
/*
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this
* file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef _MACH_O_GETSECT_H_
#define _MACH_O_GETSECT_H_
#include <stdint.h>
#include <mach-o/loader.h>
#include <Availability.h>
#include <TargetConditionals.h>
#ifndef __CCTOOLS_DEPRECATED
#define __CCTOOLS_DEPRECATED __API_DEPRECATED("No longer supported", macos(10.0, 13.0), ios(1.0, 16.0), watchos(1.0, 8.0), tvos(1.0, 16.0))
#define __CCTOOLS_DEPRECATED_MSG(_msg) __API_DEPRECATED_WITH_REPLACEMENT(_msg, macos(10.0, 13.0), ios(1.0, 16.0), watchos(1.0, 8.0), tvos(1.0, 16.0))
#endif
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* Runtime interfaces for Mach-O programs. For both 32-bit and 64-bit programs,
* where the sizes returned will be 32-bit or 64-bit based on the size of
* 'unsigned long'.
*/
extern char *getsectdata(
const char *segname,
const char *sectname,
unsigned long *size) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()");
extern char *getsectdatafromFramework(
const char *FrameworkName,
const char *segname,
const char *sectname,
unsigned long *size) __CCTOOLS_DEPRECATED;
extern unsigned long get_end(void) __CCTOOLS_DEPRECATED;
extern unsigned long get_etext(void) __CCTOOLS_DEPRECATED;
extern unsigned long get_edata(void) __CCTOOLS_DEPRECATED;
#ifndef __LP64__
/*
* Runtime interfaces for 32-bit Mach-O programs.
*/
extern const struct section *getsectbyname(
const char *segname,
const char *sectname) __CCTOOLS_DEPRECATED_MSG("use getsectiondata(&__dso_handle,)");
extern uint8_t *getsectiondata(
const struct mach_header *mhp,
const char *segname,
const char *sectname,
unsigned long *size);
extern const struct segment_command *getsegbyname(
const char *segname) __CCTOOLS_DEPRECATED;
extern uint8_t *getsegmentdata(
const struct mach_header *mhp,
const char *segname,
unsigned long *size);
#else /* defined(__LP64__) */
/*
* Runtime interfaces for 64-bit Mach-O programs.
*/
extern const struct section_64 *getsectbyname(
const char *segname,
const char *sectname);
extern uint8_t *getsectiondata(
const struct mach_header_64 *mhp,
const char *segname,
const char *sectname,
unsigned long *size);
extern const struct segment_command_64 *getsegbyname(
const char *segname) __CCTOOLS_DEPRECATED;
extern uint8_t *getsegmentdata(
const struct mach_header_64 *mhp,
const char *segname,
unsigned long *size);
#endif /* defined(__LP64__) */
/*
* Interfaces for tools working with 32-bit Mach-O files.
*/
extern char *getsectdatafromheader(
const struct mach_header *mhp,
const char *segname,
const char *sectname,
uint32_t *size) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()");
extern const struct section *getsectbynamefromheader(
const struct mach_header *mhp,
const char *segname,
const char *sectname) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()");
extern const struct section *getsectbynamefromheaderwithswap(
struct mach_header *mhp,
const char *segname,
const char *sectname,
int fSwap) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()");
/*
* Interfaces for tools working with 64-bit Mach-O files.
*/
extern char *getsectdatafromheader_64(
const struct mach_header_64 *mhp,
const char *segname,
const char *sectname,
uint64_t *size) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()");
extern const struct section_64 *getsectbynamefromheader_64(
const struct mach_header_64 *mhp,
const char *segname,
const char *sectname) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()");
extern const struct section *getsectbynamefromheaderwithswap_64(
struct mach_header_64 *mhp,
const char *segname,
const char *sectname,
int fSwap) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()");
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _MACH_O_GETSECT_H_ */

View File

@ -72,6 +72,8 @@
#define EXC_ARM_SWP 0x104 /* SWP instruction */
#define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */
#define EXC_ARM_MTE_TAGCHECK_FAIL 0x106 /* MTE Tag Check failure */
#define EXC_ARM_MTE_CANONICAL_FAIL 0x107 /* MTE Canonical Tag access fail */
/*
* EXC_BREAKPOINT

View File

@ -0,0 +1,62 @@
/*
* Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/*
* @OSF_COPYRIGHT@
*/
/*
* Mach Operating System
* Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*/
#ifndef _MACH_EXCEPTION_H_
#define _MACH_EXCEPTION_H_
#include <mach/exception_types.h>
#endif /* _MACH_EXCEPTION_H_ */

View File

@ -409,6 +409,7 @@ typedef integer_t cpu_threadtype_t;
#define CPUFAMILY_ARM_BRAVA 0x17d5b93a
#define CPUFAMILY_ARM_TAHITI 0x75d4acb9
#define CPUFAMILY_ARM_TUPAI 0x204526d0
#define CPUFAMILY_ARM_HIDRA 0x1d5a87e8
#define CPUFAMILY_ARM_THERA 0xab345f09
#define CPUFAMILY_ARM_TILOS 0x01d7a72b

View File

@ -487,7 +487,7 @@ enum mach_port_guard_exception_codes {
kGUARD_EXC_MOVE_PROVISIONAL_REPLY_PORT = 0x00100004,
kGUARD_EXC_REPLY_PORT_SINGLE_SO_RIGHT = 0x00100005,
kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21,
kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22,
kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22, /* unused*/
};
#define MAX_FATAL_kGUARD_EXC_CODE kGUARD_EXC_MSG_FILTERED

View File

@ -100,13 +100,6 @@ typedef int vm_prot_t;
#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
/*
* This is an alias to VM_PROT_EXECUTE to identify callers that
* want to allocate an hardware assisted Read-only/read-write
* trusted path in userland.
*/
#define VM_PROT_RORW_TP (VM_PROT_EXECUTE)
/*
* An invalid protection value.
* Used only by memory_object_lock_request to indicate no change

View File

@ -283,6 +283,7 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t;
#define VM_FLAGS_RESILIENT_MEDIA 0x00000040
#define VM_FLAGS_PERMANENT 0x00000080
#define VM_FLAGS_TPRO 0x00001000
#define VM_FLAGS_MTE 0x00002000
#define VM_FLAGS_OVERWRITE 0x00004000 /* delete any existing mappings first */
/*
* VM_FLAGS_SUPERPAGE_MASK
@ -299,7 +300,7 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t;
(flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \
(((alias) & ~VM_FLAGS_ALIAS_MASK) << 24))
#define VM_FLAGS_HW (VM_FLAGS_TPRO)
#define VM_FLAGS_HW (VM_FLAGS_TPRO | VM_FLAGS_MTE)
/* These are the flags that we accept from user-space */
#define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \
@ -358,8 +359,13 @@ __enum_decl(virtual_memory_guard_exception_code_t, uint32_t, {
kGUARD_EXC_SEC_COPY_DENIED = 100,
kGUARD_EXC_SEC_SHARING_DENIED = 101,
/* Fault-related exceptions. */
kGUARD_EXC_MTE_SYNC_FAULT = 200,
kGUARD_EXC_MTE_ASYNC_USER_FAULT = 201,
kGUARD_EXC_MTE_ASYNC_KERN_FAULT = 202
});
#define kGUARD_EXC_MTE_SOFT_MODE 0x100000
#pragma mark Ledger Tags

View File

@ -71,6 +71,12 @@ typedef uint32_t reg64_t;
typedef uint32_t ppnum_t __kernel_ptr_semantics; /* Physical page number */
#define PPNUM_MAX UINT32_MAX
/*
* For use with mach_vm_update_pointers_with_remote_tags.
* This definition must be kept in sync with the definition in mach_types.defs.
*/
#define VM_OFFSET_LIST_MAX 1024
typedef mach_port_t vm_map_t, vm_map_read_t, vm_map_inspect_t;
typedef mach_port_t upl_t;

View File

@ -110,6 +110,10 @@ __API_AVAILABLE(macos(26.0), ios(26.0), tvos(26.0), watchos(26.0), visionos(26.0
void * __sized_by_or_null(size) malloc_type_zone_malloc_with_options(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id, malloc_zone_malloc_options_t opts) __result_use_check __alloc_align(2) __alloc_size(3);
#endif /* __LP64__ */
#if defined(_MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING) && _MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING
static void * __sized_by_or_null(size) __attribute__((always_inline)) malloc_type_zone_malloc_with_options_backdeploy(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id, malloc_zone_malloc_options_t opts) __result_use_check __alloc_align(2) __alloc_size(3);
#endif /* defined(_MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING) && _MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING */
// The remainder of these functions are declared in malloc/_malloc_type.h, and
// the backdeployment variant definitions are at the bottom of this file.
@ -409,13 +413,16 @@ extern void * __sized_by_or_null(size) malloc_zone_malloc(malloc_zone_t *zone, s
* parameter may be NULL, in which case the default zone will be used.
*
* @param align
* The minimum alignment of the requested allocation. This parameter must be
* MALLOC_ZONE_MALLOC_DEFAULT_ALIGN to request default alignment, or a power
* of 2 >= sizeof(void *).
* The minimum alignment of the requested allocation. This non-zero parameter
* must be MALLOC_ZONE_MALLOC_DEFAULT_ALIGN to request default alignment, or a
* power of 2 > sizeof(void *).
*
* @param size
* The size, in bytes, of the requested allocation. Must be an integral
* multiple of align if align is non-zero.
* The size, in bytes, of the requested allocation, which must be an integral
* multiple of align. This requirement is relaxed slightly on OS versions
* strictly newer than 26.0, where a non-multiple size is permitted if and only
* if align is MALLOC_ZONE_MALLOC_DEFAULT_ALIGN. OS version 26.0 does not
* implement this exception.
*
* @param options
* A bitmask of options defining how the memory should be allocated. See the
@ -698,6 +705,15 @@ static void * __sized_by_or_null(size) __attribute__((always_inline)) malloc_typ
return func(zone, size);
}
static void * __sized_by_or_null(size) __attribute__((always_inline)) malloc_type_zone_malloc_with_options_backdeploy(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id, malloc_zone_malloc_options_t opts) __result_use_check __alloc_align(2) __alloc_size(3) {
__attribute__((weak_import)) void * __sized_by_or_null(size) malloc_type_zone_malloc_with_options(malloc_zone_t *zone, size_t alignment, size_t size, malloc_type_id_t type_id, malloc_zone_malloc_options_t opts) __result_use_check __alloc_align(2) __alloc_size(3);
__auto_type func = malloc_zone_malloc_with_options;
if (malloc_type_zone_malloc_with_options) {
return malloc_type_zone_malloc_with_options(zone, alignment, size, type_id, opts);
}
return func(zone, alignment, size, opts);
}
static void * __sized_by_or_null(count * size) __attribute__((always_inline)) malloc_type_zone_calloc_backdeploy(malloc_zone_t *zone, size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2,3) {
__attribute__((weak_import)) void * __sized_by_or_null(count * size) malloc_type_zone_calloc(malloc_zone_t *zone, size_t count, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2,3);
__auto_type func = malloc_zone_calloc;

View File

@ -563,6 +563,12 @@
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_26_0(x)
#endif
#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 260100
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_26_1(x) x
#else
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_26_1(x)
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000
#define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x
#else
@ -1001,3 +1007,9 @@
#define __DARWIN_ALIAS_STARTING_MAC___MAC_26_0(x)
#endif
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 260100
#define __DARWIN_ALIAS_STARTING_MAC___MAC_26_1(x) x
#else
#define __DARWIN_ALIAS_STARTING_MAC___MAC_26_1(x)
#endif

View File

@ -184,6 +184,7 @@
#define AT_SYMLINK_NOFOLLOW_ANY 0x0800 /* Path should not contain any symlinks */
#define AT_RESOLVE_BENEATH 0x2000 /* Path must reside in the hierarchy beneath the starting directory */
#define AT_NODELETEBUSY 0x4000 /* Don't delete busy files */
#define AT_UNIQUE 0x8000 /* prevent a path lookup from succeeding on a vnode with multiple links */
#endif
#endif

View File

@ -419,8 +419,9 @@ OS_ENUM(graftdmg_type, uint32_t,
GRAFTDMG_CRYPTEX_PDI_NONCE = 6,
GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7,
GRAFTDMG_CRYPTEX_MOBILE_ASSET = 8,
GRAFTDMG_CRYPTEX_MOBILE_ASSET_WITH_CODE = 9,
// Update this when a new type is added
GRAFTDMG_CRYPTEX_MAX = 8);
GRAFTDMG_CRYPTEX_MAX = 9);
OS_ENUM(cryptex_auth_type, uint32_t,
// Reserved: GRAFTDMG_CRYPTEX_BOOT = 1,
@ -431,8 +432,9 @@ OS_ENUM(cryptex_auth_type, uint32_t,
CRYPTEX_AUTH_PDI_NONCE = 6,
// Reserved: GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7,
CRYPTEX_AUTH_MOBILE_ASSET = 8,
CRYPTEX_AUTH_MOBILE_ASSET_WITH_CODE = 9,
// Update this when a new type is added
CRYPTEX_AUTH_MAX = 8);
CRYPTEX_AUTH_MAX = 9);
__BEGIN_DECLS

View File

@ -539,6 +539,9 @@ struct proc_rlimit_control_wakeupmon {
#define IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT 0
#define IOPOL_MATERIALIZE_DATALESS_FILES_OFF 1
#define IOPOL_MATERIALIZE_DATALESS_FILES_ON 2
#define IOPOL_MATERIALIZE_DATALESS_FILES_ORIG 4
#define IOPOL_MATERIALIZE_DATALESS_FILES_BASIC_MASK 3
#define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0
#define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1

View File

@ -135,7 +135,7 @@ typedef void (*xpc_finalizer_t)(void * _Nullable value);
*
* If NULL, an anonymous listener connection will be created. You can embed the
* ability to create new peer connections in an endpoint, which can be inserted
* into a message and sent to another process .
* into a message and sent to another process.
*
* @param targetq
* The GCD queue to which the event handler block will be submitted. This
@ -301,7 +301,7 @@ xpc_connection_set_target_queue(xpc_connection_t connection,
* A connection may receive different events depending upon whether it is a
* listener or not. Any connection may receive an error in its event handler.
* But while normal connections may receive messages in addition to errors,
* listener connections will receive connections and and not messages.
* listener connections will receive connections and not messages.
*
* Connections received by listeners are equivalent to those returned by
* xpc_connection_create() with a non-NULL name argument and a NULL targetq
@ -310,6 +310,17 @@ xpc_connection_set_target_queue(xpc_connection_t connection,
* to accept the connection, you may simply call xpc_connection_cancel() on it
* and return. The runtime will dispose of it for you.
*
* IMPORTANT: For peer connections received through a listener connection's
* event handler, you MUST either accept the connection by setting an event
* handler with xpc_connection_set_event_handler() and calling
* xpc_connection_resume(), or reject the connection by calling
* xpc_connection_cancel(). Failure to take one of these actions will result
* in the connection remaining in an undefined state, potentially causing
* resource leaks or preventing proper transaction cleanup. This requirement
* applies to all listener connections, including those created with
* xpc_connection_create_mach_service() and those managed automatically by
* xpc_main().
*
* If there is an error in the connection, this handler will be invoked with the
* error dictionary as its argument. This dictionary will be one of the well-
* known XPC_ERROR_* dictionaries.
@ -586,10 +597,11 @@ xpc_connection_send_message_with_reply_sync(xpc_connection_t connection,
* Cancellation is asynchronous and non-preemptive and therefore this method
* will not interrupt the execution of an already-running event handler block.
* If the event handler is executing at the time of this call, it will finish,
* and then the connection will be canceled, causing a final invocation of the
* event handler to be scheduled with the XPC_ERROR_CONNECTION_INVALID error.
* After that invocation, there will be no further invocations of the event
* handler.
* and then the connection will be canceled.
*
* Canceling the connection will cause a final invocation of the event handler
* to be scheduled with the XPC_ERROR_CONNECTION_INVALID error. After that
* invocation, there will be no further invocations of the event handler.
*
* The XPC runtime guarantees this non-preemptiveness even for concurrent target
* queues.
@ -601,7 +613,7 @@ xpc_connection_cancel(xpc_connection_t connection);
/*!
* @function xpc_connection_get_name
* Returns the name of the service with which the connections was created.
* Returns the name of the service with which the connection was created.
*
* @param connection
* The connection object which is to be examined.
@ -690,7 +702,7 @@ xpc_connection_get_asid(xpc_connection_t connection);
/*!
* @function xpc_connection_set_context
* Sets context on an connection.
* Sets context on a connection.
*
* @param connection
* The connection which is to be manipulated.
@ -764,8 +776,8 @@ xpc_connection_set_finalizer_f(xpc_connection_t connection,
* The connection object which is to be modified.
*
* @param requirement
* The code signing requirement to be satisfied by the peer
* It is safe to deallocate the requirement string after calling `xpc_connection_set_peer_code_signing_requirement`
* The code signing requirement to be satisfied by the peer.
* It is safe to deallocate the requirement string after calling `xpc_connection_set_peer_code_signing_requirement`.
*
* @result
* 0 on success, non-zero on error
@ -780,7 +792,7 @@ xpc_connection_set_finalizer_f(xpc_connection_t connection,
* are dropped. When a reply is expected on the connection and the peer does not satisfy the requirement
* `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT` will be delivered instead of the reply.
*
* This API is not supported on embedded platforms and will return ENOTSUP.
* This API is not supported on embedded platforms and will return ENOTSUP.
*
* @see https://developer.apple.com/documentation/technotes/tn3127-inside-code-signing-requirements
*/
@ -792,14 +804,14 @@ xpc_connection_set_peer_code_signing_requirement(xpc_connection_t connection, co
/*!
* @function xpc_connection_set_peer_entitlement_exists_requirement
* Requires that the connection peer has the specified entitlement
* Requires that the connection peer has the specified entitlement.
*
* @param connection
* The connection object which is to be modified
* The connection object which is to be modified.
*
* @param entitlement
* The entitlement the peer must have
* It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_exists_requirement`
* The entitlement the peer must have.
* It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_exists_requirement`.
*
* @result
* 0 on success, non-zero on error
@ -824,17 +836,17 @@ xpc_connection_set_peer_entitlement_exists_requirement(xpc_connection_t connecti
/*!
* @function xpc_connection_set_peer_entitlement_matches_value_requirement
* Requires that the connection peer has the specified entitlement with the matching value
* Requires that the connection peer has the specified entitlement with the matching value.
*
* @param connection
* The connection object which is to be modified
* The connection object which is to be modified.
*
* @param entitlement
* The entitlement the peer must have
* It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_matches_value_requirement`
* The entitlement the peer must have.
* It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_matches_value_requirement`.
*
* @param value
* The value that the entitlement must match
* The value that the entitlement must match.
* It is safe to deallocate the value object after calling
* `xpc_connection_set_peer_entitlement_matches_value_requirement`.
* Valid xpc types for this object are `XPC_TYPE_BOOL`, `XPC_TYPE_STRING` and `XPC_TYPE_INT64`.
@ -863,14 +875,14 @@ xpc_connection_set_peer_entitlement_matches_value_requirement(xpc_connection_t c
/*!
* @function xpc_connection_set_peer_team_identity_requirement
* Requires that the connection peer has the specified identity and is signed with the same team identifier
* as the current process
* as the current process.
*
* @param connection
* The connection object which is to be modified
* The connection object which is to be modified.
*
* @param signing_identifier
* The optional signing identifier the peer must have
* It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`
* The optional signing identifier the peer must have.
* It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`.
*
* @result
* 0 on success, non-zero on error
@ -879,7 +891,7 @@ xpc_connection_set_peer_entitlement_matches_value_requirement(xpc_connection_t c
* This function will return an error promptly if the identity requirement is invalid.
*
* The peer process must be signed as either a Testflight app or an App store app,
* or be signed by an apple issued development certificate, an enterprise distributed
* or be signed by an Apple-issued development certificate, an enterprise distributed
* certificate (embedded only), or a Developer ID certificate (macOS only)
*
* It is a programming error to call multiple of the `xpc_connection_set_peer_*_requirement` family of functions on the same
@ -899,14 +911,14 @@ xpc_connection_set_peer_team_identity_requirement(xpc_connection_t connection, c
/*!
* @function xpc_connection_set_peer_platform_identity_requirement
* Requires that the connection peer has the specified identity and is signed by Apple
* Requires that the connection peer has the specified identity and is signed by Apple.
*
* @param connection
* The connection object which is to be modified
* The connection object which is to be modified.
*
* @param signing_identifier
* The optional signing identifier the peer must have. If not specified, this function ensures that the peer is signed by Apple
* It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`
* The optional signing identifier the peer must have. If not specified, this function ensures that the peer is signed by Apple.
* It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`.
*
* @result
* 0 on success, non-zero on error
@ -934,14 +946,14 @@ xpc_connection_set_peer_platform_identity_requirement(xpc_connection_t connectio
/*!
* @function xpc_connection_set_peer_lightweight_code_requirement
* Requires that the connection peer has the specified lightweight code requirement
* Requires that the connection peer has the specified lightweight code requirement.
*
* @param connection
* The connection object which is to be modified
* The connection object which is to be modified.
*
* @param lwcr
* The lightweight code requirement the peer must have
* It is safe to deallocate the lightweight code requirement object after calling `xpc_connection_set_peer_lightweight_code_requirement`
* The lightweight code requirement the peer must have.
* It is safe to deallocate the lightweight code requirement object after calling `xpc_connection_set_peer_lightweight_code_requirement`.
*
* @result
* 0 on success, non-zero on error
@ -982,14 +994,14 @@ xpc_connection_set_peer_lightweight_code_requirement(xpc_connection_t connection
/*!
* @function xpc_connection_set_peer_requirement
* Requires that the connection peer has the specified requirement
* Requires that the connection peer has the specified requirement.
*
* @param connection
* The connection object which is to be modified
* The connection object which is to be modified.
*
* @param peer_requirement
* The requirement the peer must have
* It is safe to deallocate the peer requirement after calling `xpc_connection_set_peer_requirement`
* The requirement the peer must have.
* It is safe to deallocate the peer requirement after calling `xpc_connection_set_peer_requirement`.
*
* @discussion
* It is a programming error to call multiple of the `xpc_connection_set_peer_*_requirement` family of functions on the same
@ -1012,10 +1024,10 @@ xpc_connection_set_peer_requirement(xpc_connection_t connection,
* Returns a description of why the connection was invalidated.
*
* @param connection
* The connection object to inspect
* The connection object to inspect.
*
* @result
* Null if the connection has not been invalidated, otherwise a description for why the connection was invalidated.
* NULL if the connection has not been invalidated, otherwise a description for why the connection was invalidated.
*/
API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0))
XPC_EXPORT XPC_NONNULL1 XPC_WARN_RESULT

View File

@ -21,7 +21,7 @@ __BEGIN_DECLS
* Listeners represent the server side variant of an XPC Session.
*
* Listeners are activated and then begin receiving `xpc_session_t` from peers attempting to
* connect to the server
* connect to the server.
*
*/
OS_OBJECT_DECL_SENDABLE_CLASS(xpc_listener);
@ -38,10 +38,10 @@ OS_OBJECT_DECL_SENDABLE_CLASS(xpc_listener);
* {@link xpc_listener_activate} before it can be used.
*
* @const XPC_LISTENER_CREATE_FORCE_MACH
* Optional key to indicate to the runtime that this listener is for a Mach Service
* Optional key to indicate to the runtime that this listener is for a Mach Service.
*
* @const XPC_LISTENER_CREATE_FORCE_XPCSERVICE
* Optional key to indicate to the runtime that this listener is for a XPCService endpoint
* Optional key to indicate to the runtime that this listener is for a XPCService endpoint.
*/
XPC_SWIFT_NOEXPORT
XPC_FLAGS_ENUM(xpc_listener_create_flags, uint64_t,
@ -76,7 +76,7 @@ xpc_listener_copy_description(xpc_listener_t listener);
#pragma mark Server Session Creation
/*!
* @function xpc_listener_create
* Creates a listener with the service defined by the provided name
* Creates a listener with the service defined by the provided name.
*
* @param service
* The Mach service or XPC Service name to create the listener with.
@ -91,9 +91,14 @@ xpc_listener_copy_description(xpc_listener_t listener);
* Additional attributes to create the listener.
*
* @param incoming_session_handler
* The handler block to be called when a peer is attempting to establish a
* The handler block to be called when a peer is attempting to establish a
* connection with this listener. The incoming session handler is mandatory.
*
* Unlike XPC connection listeners that require explicit acceptance,
* xpc_listener automatically accepts and activates incoming peer sessions when
* the incoming_session_handler returns, unless the peer session was explicitly
* rejected using xpc_listener_reject_peer() or cancelled using xpc_session_cancel().
*
* @param error_out
* An out-parameter that, if set and in the event of an error, will point to an
* {@link xpc_rich_error_t} describing the details of any errors that occurred.
@ -176,17 +181,20 @@ xpc_listener_cancel(xpc_listener_t listener);
/*!
* @function xpc_listener_reject_peer
* Rejects the incoming peer session
* Rejects the incoming peer session.
*
* @param peer
* The peer session object to reject. This must be a session that was an argument
* from an incoming session handler block
* from an incoming session handler block.
*
* @param reason
* The reason that the peer was rejected
* The reason that the peer was rejected.
*
* @discussion
* The peer session will be cancelled and cannot be used after it has been rejected
* The peer session will be cancelled and cannot be used after it has been rejected.
*
* An incoming session that is not rejected will automatically be accepted
* after returning from the incoming peer handler.
*/
API_AVAILABLE(macos(14.0), macCatalyst(17.0))
API_UNAVAILABLE(ios, tvos, watchos)

View File

@ -221,7 +221,7 @@ XPC_TYPE(_xpc_type_date);
/*!
* @define XPC_TYPE_DATA
* A type representing a an arbitrary buffer of bytes.
* A type representing an arbitrary buffer of bytes.
*/
#define XPC_TYPE_DATA (&_xpc_type_data)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
@ -239,7 +239,7 @@ XPC_TYPE(_xpc_type_string);
/*!
* @define XPC_TYPE_UUID
* A type representing a Universally Unique Identifier as defined by uuid(3).
* A type representing a Universally Unique Identifier as defined by uuid(3).
*/
#define XPC_TYPE_UUID (&_xpc_type_uuid)
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
@ -487,7 +487,7 @@ xpc_copy(xpc_object_t object);
* Returns true if the objects are equal, otherwise false. Two objects must be
* of the same type in order to be equal.
*
* For two arrays to be equal, they must contain the same values at the
* For two arrays to be equal, they must contain the same values at the
* same indexes. For two dictionaries to be equal, they must contain the same
* values for the same keys.
*
@ -513,8 +513,8 @@ xpc_equal(xpc_object_t object1, xpc_object_t object2);
* The calculated hash value.
*
* @discussion
* Note that the computed hash values for any particular type and value of an
* object can change from across releases and platforms and should not be
* Note that the computed hash values for any particular type and value of an
* object can change across releases and platforms and should not be
* assumed to be constant across all time and space or stored persistently.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
@ -567,7 +567,7 @@ xpc_null_create(void);
* The Boolean primitive value which is to be boxed.
*
* @result
* A new Boolean object.
* A new Boolean object.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT
@ -710,7 +710,8 @@ xpc_double_get_value(xpc_object_t xdouble);
* @param interval
* The date interval which is to be boxed. Negative values indicate the number
* of nanoseconds before the epoch. Positive values indicate the number of
* nanoseconds after the epoch.
* nanoseconds after the epoch. The interval is with respect to the Unix epoch.
* XPC dates are in Unix time and are thus unaware of local time or leap seconds.
*
* @result
* A new date object.
@ -745,7 +746,8 @@ xpc_date_create_from_current(void);
*
* @result
* The underlying date interval or 0 if the given object was not an XPC date
* object.
* object. The interval is with respect to the Unix epoch. XPC dates are in
* Unix time and are thus unaware of local time or leap seconds.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
@ -768,7 +770,7 @@ xpc_date_get_value(xpc_object_t xdate);
* The number of bytes which are to be boxed.
*
* @result
* A new data object.
* A new data object.
*
* @discussion
* This method will copy the buffer given into internal storage. After calling
@ -791,7 +793,7 @@ xpc_data_create(const void * _Nullable XPC_SIZEDBY(length) bytes, size_t length)
* is retained by the data object.
*
* @result
* A new data object.
* A new data object.
*
* @discussion
* The object returned by this method will refer to the buffer returned by
@ -843,7 +845,7 @@ xpc_data_get_bytes_ptr(xpc_object_t xdata);
* @function xpc_data_get_bytes
*
* @abstract
* Copies the bytes stored in an data objects into the specified buffer.
* Copies the bytes stored in a data object into the specified buffer.
*
* @param xdata
* The data object which is to be examined.
@ -852,7 +854,7 @@ xpc_data_get_bytes_ptr(xpc_object_t xdata);
* The buffer in which to copy the data object's bytes.
*
* @param off
* The offset at which to begin the copy. If this offset is greater than the
* The offset at which to begin the copy. If this offset is greater than the
* length of the data element, nothing is copied. Pass 0 to start the copy
* at the beginning of the buffer.
*
@ -880,7 +882,7 @@ xpc_data_get_bytes(xpc_object_t xdata,
* The C-string which is to be boxed.
*
* @result
* A new string object.
* A new string object.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
@ -902,7 +904,7 @@ xpc_string_create(const char *string);
* The arguments which correspond to those specified in the format string.
*
* @result
* A new string object.
* A new string object.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
@ -926,7 +928,7 @@ xpc_string_create_with_format(const char *fmt, ...);
* string.
*
* @result
* A new string object.
* A new string object.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
@ -944,7 +946,7 @@ xpc_string_create_with_format_and_arguments(const char *fmt, va_list ap);
* The string object which is to be examined.
*
* @result
* The length of the underlying string, not including the NUL-terminator, or 0
* The length of the underlying string, not including the NUL-terminator, or 0
* if the given object was not an XPC string object.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
@ -982,7 +984,7 @@ xpc_string_get_string_ptr(xpc_object_t xstring);
* The UUID which is to be boxed.
*
* @result
* A new UUID object.
* A new UUID object.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1
@ -1444,9 +1446,11 @@ xpc_array_set_double(xpc_object_t xarray, size_t index, double value);
* undefined.
*
* @param value
* The date value to insert, represented as an <code>int64_t</code>. After
* calling this method, the XPC object corresponding to the primitive value
* inserted may be safely retrieved with {@link xpc_array_get_value()}.
* The date value to insert, represented as an <code>int64_t</code>. The
* interval is with respect to the Unix epoch. XPC dates are in Unix time and
* are thus unaware of local time or leap seconds. After calling this method,
* the XPC object corresponding to the primitive value inserted may be safely
* retrieved with {@link xpc_array_get_value()}.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_NONNULL1
@ -1624,7 +1628,7 @@ xpc_array_get_bool(xpc_object_t xarray, size_t index);
*
* @result
* The underlying <code>int64_t</code> value at the specified index. 0 if the
* value at the specified index is not a signed integer value.
* value at the specified index is not a signed integer value.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
@ -1692,8 +1696,10 @@ xpc_array_get_double(xpc_object_t xarray, size_t index);
* index is outside that range, the behavior is undefined.
*
* @result
* The underlying date interval at the specified index. 0 if the value at the
* specified index is not a date value.
* The underlying date interval at the specified index. The interval is with
* respect to the Unix epoch. XPC dates are in Unix time and are thus unaware
* of local time or leap seconds. 0 if the value at the specified index is not
* a date value.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1
@ -1715,7 +1721,7 @@ xpc_array_get_date(xpc_object_t xarray, size_t index);
* index is outside that range, the behavior is undefined.
*
* @param length
* Upon return output, will contain the length of the data corresponding to the
* Upon return, will contain the length of the data corresponding to the
* specified key.
*
* @result
@ -1842,7 +1848,7 @@ xpc_array_create_connection(xpc_object_t xarray, size_t index);
*
* @result
* The object at the specified index within the array or NULL if the given
* object was not an XPC array or if the the value at the specified index was
* object was not an XPC array or if the value at the specified index was
* not a dictionary.
*
* @discussion
@ -1869,7 +1875,7 @@ xpc_array_get_dictionary(xpc_object_t xarray, size_t index);
*
* @result
* The object at the specified index within the array or NULL if the given
* object was not an XPC array or if the the value at the specified index was
* object was not an XPC array or if the value at the specified index was
* not an array.
*
* @discussion
@ -1922,7 +1928,7 @@ typedef bool (^xpc_dictionary_applier_t)(const char * _Nonnull key,
* the actual count of values, only that many key/value pairs will be inserted
* into the dictionary.
*
* If the count is more than the the actual count of key/value pairs, the
* If the count is more than the actual count of key/value pairs, the
* behavior is undefined. If one array is NULL and the other is not, the
* behavior is undefined. If both arrays are NULL and the count is non-0, the
* behavior is undefined.
@ -2040,7 +2046,7 @@ xpc_dictionary_get_value(xpc_object_t xdict, const char *key);
* The dictionary object which is to be examined.
*
* @result
* The number of values stored in the dictionary or 0 if the given object was
* The number of values stored in the dictionary or 0 if the given object was
* not an XPC dictionary. Calling xpc_dictionary_set_value() with a non-NULL
* value will increment the count. Calling xpc_dictionary_set_value() with a
* NULL value will decrement the count.
@ -2192,18 +2198,20 @@ xpc_dictionary_set_double(xpc_object_t xdict, const char *key, double value);
* @function xpc_dictionary_set_date
*
* @abstract
* Inserts a date (primitive) value into a dictionary.
* Inserts a date value into a dictionary.
*
* @param xdict
* The dictionary which is to be manipulated.
*
* @param key
* The key for which the primitive value shall be set.
* The key for which the value shall be set.
*
* @param value
* The date value to insert. After calling this method, the XPC object
* corresponding to the primitive value inserted may be safely retrieved with
* {@link xpc_dictionary_get_value()}.
* The date value to insert, represented as an <code>int64_t</code>. The
* interval is with respect to the Unix epoch. XPC dates are in Unix time and
* are thus unaware of local time or leap seconds. After calling this method,
* the XPC object corresponding to the primitive value inserted may be safely
* retrieved with {@link xpc_dictionary_get_value()}.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2
@ -2263,7 +2271,7 @@ xpc_dictionary_set_string(xpc_object_t xdict, const char *key,
* @function xpc_dictionary_set_uuid
*
* @abstract
* Inserts a uuid (primitive) value into an array.
* Inserts a UUID (primitive) value into a dictionary.
*
* @param xdict
* The dictionary which is to be manipulated.
@ -2381,7 +2389,7 @@ xpc_dictionary_get_bool(xpc_object_t xdict, const char *key);
* @function xpc_dictionary_get_int64
*
* @abstract
* Gets an <code>int64</code> primitive value from a dictionary directly.
* Gets an <code>int64_t</code> primitive value from a dictionary directly.
*
* @param xdict
* The dictionary object which is to be examined.
@ -2403,7 +2411,7 @@ xpc_dictionary_get_int64(xpc_object_t xdict, const char *key);
* @function xpc_dictionary_get_uint64
*
* @abstract
* Gets a <code>uint64</code> primitive value from a dictionary directly.
* Gets a <code>uint64_t</code> primitive value from a dictionary directly.
*
* @param xdict
* The dictionary object which is to be examined.
@ -2456,9 +2464,10 @@ xpc_dictionary_get_double(xpc_object_t xdict, const char *key);
* The key whose value is to be obtained.
*
* @result
* The underlying date interval for the specified key. 0 if the value for the
* specified key is not a date value or if there is no value for the specified
* key.
* The underlying date interval for the specified key. The interval is with
* respect to the Unix epoch. XPC dates are in Unix time and are thus unaware
* of local time or leap seconds. 0 if the value for the specified key is not a
* date value or if there is no value for the specified key.
*/
__OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0)
XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL
@ -2674,7 +2683,13 @@ xpc_dictionary_copy_mach_send(xpc_object_t xdict, const char *key);
* bundle's Info.plist under the XPCService dictionary.
*
* @param handler
* The handler with which to accept new connections.
* The handler with which to accept new connections. This handler is called for
* each new connection established with the service. The handler must either
* accept the connection by setting an event handler with
* xpc_connection_set_event_handler() and calling xpc_connection_resume(), or
* reject the connection by calling xpc_connection_cancel(). Failure to take
* one of these actions will result in the connection remaining in an undefined
* state, potentially causing resource leaks or transaction issues.
*/
API_AVAILABLE(macos(10.7), macCatalyst(5.0))
API_UNAVAILABLE(ios)

View File

@ -124,6 +124,7 @@
// macOS system headers
#include <mach/clock.h>
#include <mach/exception.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <mach/thread_state.h>
@ -177,7 +178,8 @@
#include <os/lock.h>
#include <simd/simd.h>
#include <xpc/xpc.h>
#include <CommonCrypto/CommonDigest.h>
#include <CommonCrypto/CommonCrypto.h>
#include <CommonCrypto/CommonRandom.h> // Not included by CommonCrypto.h
#include <objc/message.h>
#include <objc/NSObject.h>
@ -195,6 +197,9 @@
#include <sys/file.h>
#include <malloc/malloc.h>
// Depended on by bdwgc
#include <mach-o/getsect.h>
// Provided by macOS LibC
#include <memory.h>
#include <zlib.h>