| author | |
| committer | |
| log | 74900e938a8ea28b6ea7aa35924a2dee9818056b |
| tree | bbbdc8bc246f91d9c45003c6c321f20c59af3097 |
| parent | 459f3b7edef14da7d9ec29a77329601469f08b36 |
| parent | f55eb18abbfc66f65823517619e6d23a8e185645 |
| signature |
libc: Update macOS headers to SDK 26.128 files changed, 1899 insertions(+), 195 deletions(-)
lib/libc/darwin/SDKSettings.json+1-1| ... | ... | @@ -1 +1 @@ |
| 1 | {"MinimalDisplayName":"26.0"} | |
| 1 | {"MinimalDisplayName":"26.1"} |
lib/libc/darwin/libSystem.tbd+82-79| ... | ... | @@ -400,7 +400,7 @@ tbd-version: 4 |
| 400 | 400 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 401 | 401 | arm64e-macos, arm64e-maccatalyst ] |
| 402 | 402 | install-name: '/usr/lib/system/libcorecrypto.dylib' |
| 403 | current-version: 1922.0.25 | |
| 403 | current-version: 1922.40.14 | |
| 404 | 404 | parent-umbrella: |
| 405 | 405 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 406 | 406 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -417,21 +417,21 @@ exports: |
| 417 | 417 | _ccsha256_vng_intel_SupplementalSSE3_di ] |
| 418 | 418 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 419 | 419 | arm64e-macos, arm64e-maccatalyst ] |
| 420 | symbols: [ _CCEC_FAULT_CANARY, _CCRSA_PKCS1_FAULT_CANARY, _CCRSA_PSS_FAULT_CANARY, | |
| 421 | _CCSS_PRIME_P192, _CCSS_PRIME_P224, _CCSS_PRIME_P256, _CCSS_PRIME_P384, | |
| 422 | _CCSS_PRIME_P521, _cc_abort, _cc_atfork_child, _cc_atfork_parent, | |
| 423 | _cc_atfork_prepare, _cc_clear, _cc_cmp_safe, _cc_impl_name, | |
| 424 | _cc_try_abort, _cc_try_abort_if, _ccaes_cbc_decrypt_mode, | |
| 425 | _ccaes_cbc_encrypt_mode, _ccaes_ccm_decrypt_mode, _ccaes_ccm_encrypt_mode, | |
| 426 | _ccaes_cfb8_decrypt_mode, _ccaes_cfb8_encrypt_mode, _ccaes_cfb_decrypt_mode, | |
| 427 | _ccaes_cfb_encrypt_mode, _ccaes_ctr_crypt_mode, _ccaes_ecb_decrypt_mode, | |
| 428 | _ccaes_ecb_encrypt_mode, _ccaes_gcm_decrypt_mode, _ccaes_gcm_encrypt_mode, | |
| 429 | _ccaes_gladman_cbc_decrypt_mode, _ccaes_gladman_cbc_encrypt_mode, | |
| 430 | _ccaes_ltc_ecb_decrypt_mode, _ccaes_ltc_ecb_encrypt_mode, | |
| 431 | _ccaes_ofb_crypt_mode, _ccaes_siv_decrypt_mode, _ccaes_siv_encrypt_mode, | |
| 432 | _ccaes_siv_hmac_sha256_decrypt_mode, _ccaes_siv_hmac_sha256_encrypt_mode, | |
| 433 | _ccaes_unwind, _ccaes_xts_decrypt_mode, _ccaes_xts_encrypt_mode, | |
| 434 | _ccansikdf_x963, _ccapsic_client_check_intersect_response, | |
| 420 | symbols: [ _CCEC_FAULT_CANARY, _CCMLDSA_FAULT_CANARY, _CCRSA_PKCS1_FAULT_CANARY, | |
| 421 | _CCRSA_PSS_FAULT_CANARY, _CCSS_PRIME_P192, _CCSS_PRIME_P224, | |
| 422 | _CCSS_PRIME_P256, _CCSS_PRIME_P384, _CCSS_PRIME_P521, _cc_abort, | |
| 423 | _cc_atfork_child, _cc_atfork_parent, _cc_atfork_prepare, _cc_clear, | |
| 424 | _cc_cmp_safe, _cc_impl_name, _cc_try_abort, _cc_try_abort_if, | |
| 425 | _ccaes_cbc_decrypt_mode, _ccaes_cbc_encrypt_mode, _ccaes_ccm_decrypt_mode, | |
| 426 | _ccaes_ccm_encrypt_mode, _ccaes_cfb8_decrypt_mode, _ccaes_cfb8_encrypt_mode, | |
| 427 | _ccaes_cfb_decrypt_mode, _ccaes_cfb_encrypt_mode, _ccaes_ctr_crypt_mode, | |
| 428 | _ccaes_ecb_decrypt_mode, _ccaes_ecb_encrypt_mode, _ccaes_gcm_decrypt_mode, | |
| 429 | _ccaes_gcm_encrypt_mode, _ccaes_gladman_cbc_decrypt_mode, | |
| 430 | _ccaes_gladman_cbc_encrypt_mode, _ccaes_ltc_ecb_decrypt_mode, | |
| 431 | _ccaes_ltc_ecb_encrypt_mode, _ccaes_ofb_crypt_mode, _ccaes_siv_decrypt_mode, | |
| 432 | _ccaes_siv_encrypt_mode, _ccaes_siv_hmac_sha256_decrypt_mode, | |
| 433 | _ccaes_siv_hmac_sha256_encrypt_mode, _ccaes_unwind, _ccaes_xts_decrypt_mode, | |
| 434 | _ccaes_xts_encrypt_mode, _ccansikdf_x963, _ccapsic_client_check_intersect_response, | |
| 435 | 435 | _ccapsic_client_generate_match_response, _ccapsic_client_init, |
| 436 | 436 | _ccapsic_client_state_sizeof, _ccapsic_server_determine_intersection, |
| 437 | 437 | _ccapsic_server_encode_element, _ccapsic_server_init, _ccapsic_server_state_sizeof, |
| ... | ... | @@ -650,19 +650,20 @@ exports: |
| 650 | 650 | _ccmldsa_sign_with_context, _ccmldsa_signature_nbytes_ctx, |
| 651 | 651 | _ccmldsa_signature_nbytes_params, _ccmldsa_sizeof_full_ctx, |
| 652 | 652 | _ccmldsa_sizeof_pub_ctx, _ccmldsa_verify, _ccmldsa_verify_prehashed, |
| 653 | _ccmldsa_verify_with_context, _ccmode_factory_cbc_decrypt, | |
| 654 | _ccmode_factory_cbc_encrypt, _ccmode_factory_ccm_decrypt, | |
| 655 | _ccmode_factory_ccm_encrypt, _ccmode_factory_cfb8_decrypt, | |
| 656 | _ccmode_factory_cfb8_encrypt, _ccmode_factory_cfb_decrypt, | |
| 657 | _ccmode_factory_cfb_encrypt, _ccmode_factory_ctr_crypt, _ccmode_factory_gcm_decrypt, | |
| 658 | _ccmode_factory_gcm_encrypt, _ccmode_factory_ofb_crypt, _ccmode_factory_siv_decrypt, | |
| 659 | _ccmode_factory_siv_encrypt, _ccmode_factory_xts_decrypt, | |
| 660 | _ccmode_factory_xts_encrypt, _ccn_add, _ccn_add1, _ccn_bitlen, | |
| 661 | _ccn_cmp, _ccn_cmpn, _ccn_lprint, _ccn_print, _ccn_read_uint, | |
| 662 | _ccn_set_bit, _ccn_seti, _ccn_sub, _ccn_swap, _ccn_write_int, | |
| 663 | _ccn_write_int_size, _ccn_write_uint, _ccn_write_uint_padded, | |
| 664 | _ccn_write_uint_padded_ct, _ccn_write_uint_size, _ccn_xor, | |
| 665 | _ccn_zero, _ccnistkdf_ctr_cmac, _ccnistkdf_ctr_cmac_fixed, | |
| 653 | _ccmldsa_verify_prehashed_with_canary, _ccmldsa_verify_with_canary, | |
| 654 | _ccmldsa_verify_with_context, _ccmldsa_verify_with_context_and_canary, | |
| 655 | _ccmode_factory_cbc_decrypt, _ccmode_factory_cbc_encrypt, | |
| 656 | _ccmode_factory_ccm_decrypt, _ccmode_factory_ccm_encrypt, | |
| 657 | _ccmode_factory_cfb8_decrypt, _ccmode_factory_cfb8_encrypt, | |
| 658 | _ccmode_factory_cfb_decrypt, _ccmode_factory_cfb_encrypt, | |
| 659 | _ccmode_factory_ctr_crypt, _ccmode_factory_gcm_decrypt, _ccmode_factory_gcm_encrypt, | |
| 660 | _ccmode_factory_ofb_crypt, _ccmode_factory_siv_decrypt, _ccmode_factory_siv_encrypt, | |
| 661 | _ccmode_factory_xts_decrypt, _ccmode_factory_xts_encrypt, | |
| 662 | _ccn_add, _ccn_add1, _ccn_bitlen, _ccn_cmp, _ccn_cmpn, _ccn_lprint, | |
| 663 | _ccn_print, _ccn_read_uint, _ccn_set_bit, _ccn_seti, _ccn_sub, | |
| 664 | _ccn_swap, _ccn_write_int, _ccn_write_int_size, _ccn_write_uint, | |
| 665 | _ccn_write_uint_padded, _ccn_write_uint_padded_ct, _ccn_write_uint_size, | |
| 666 | _ccn_xor, _ccn_zero, _ccnistkdf_ctr_cmac, _ccnistkdf_ctr_cmac_fixed, | |
| 666 | 667 | _ccnistkdf_ctr_hmac, _ccnistkdf_ctr_hmac_fixed, _ccofb_block_size, |
| 667 | 668 | _ccofb_context_size, _ccofb_init, _ccofb_one_shot, _ccofb_update, |
| 668 | 669 | _ccoid_equal, _ccoid_payload, _ccoid_size, _ccpad_cts1_decrypt, |
| ... | ... | @@ -1116,7 +1117,7 @@ tbd-version: 4 |
| 1116 | 1117 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1117 | 1118 | arm64e-macos, arm64e-maccatalyst ] |
| 1118 | 1119 | install-name: '/usr/lib/system/libquarantine.dylib' |
| 1119 | current-version: 196.0.1 | |
| 1120 | current-version: 196.40.3 | |
| 1120 | 1121 | parent-umbrella: |
| 1121 | 1122 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1122 | 1123 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -1281,7 +1282,7 @@ tbd-version: 4 |
| 1281 | 1282 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1282 | 1283 | arm64e-macos, arm64e-maccatalyst ] |
| 1283 | 1284 | install-name: '/usr/lib/system/libsystem_c.dylib' |
| 1284 | current-version: 1725.0.11 | |
| 1285 | current-version: 1725.40.4 | |
| 1285 | 1286 | parent-umbrella: |
| 1286 | 1287 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1287 | 1288 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -1578,7 +1579,7 @@ tbd-version: 4 |
| 1578 | 1579 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1579 | 1580 | arm64e-macos, arm64e-maccatalyst ] |
| 1580 | 1581 | install-name: '/usr/lib/system/libsystem_collections.dylib' |
| 1581 | current-version: 1725.0.11 | |
| 1582 | current-version: 1725.40.4 | |
| 1582 | 1583 | parent-umbrella: |
| 1583 | 1584 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1584 | 1585 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -1608,7 +1609,7 @@ tbd-version: 4 |
| 1608 | 1609 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1609 | 1610 | arm64e-macos, arm64e-maccatalyst ] |
| 1610 | 1611 | install-name: '/usr/lib/system/libsystem_configuration.dylib' |
| 1611 | current-version: 1385.0.7 | |
| 1612 | current-version: 1385.40.9 | |
| 1612 | 1613 | parent-umbrella: |
| 1613 | 1614 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1614 | 1615 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -1643,8 +1644,8 @@ exports: |
| 1643 | 1644 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1644 | 1645 | arm64e-macos, arm64e-maccatalyst ] |
| 1645 | 1646 | symbols: [ _CMCONTAINERSEAM_DEFAULT, _CMDISPATCHSEAM_DEFAULT, _CMFSSEAM_DEFAULT, |
| 1646 | _CMNOTIFYSEAM_DEFAULT, _CMPWDSEAM_DEFAULT, _CMSANDBOXSEAM_DEFAULT, | |
| 1647 | _CONTAINER_CLASS_NAMES, _CONTAINER_NOTIFY_GENERATION_INITIAL, | |
| 1647 | _CMNOTIFYSEAM_DEFAULT, _CMPWDSEAM_DEFAULT, _CMQUARANTINESEAM_DEFAULT, | |
| 1648 | _CMSANDBOXSEAM_DEFAULT, _CONTAINER_CLASS_NAMES, _CONTAINER_NOTIFY_GENERATION_INITIAL, | |
| 1648 | 1649 | _CONTAINER_NOTIFY_GENERATION_INVALID, _CONTAINER_NOTIFY_USER_INVALIDATED, |
| 1649 | 1650 | _CONTAINER_PERSONA_CURRENT, _CONTAINER_PERSONA_PRIMARY, __container_init, |
| 1650 | 1651 | __container_notify_copy_notify_name, __container_query_get_next_result_sync, |
| ... | ... | @@ -1658,17 +1659,17 @@ exports: |
| 1658 | 1659 | _container_acquire_sandbox_extension, _container_audit_token_copy_codesign_hash, |
| 1659 | 1660 | _container_audit_token_copy_codesign_identifier, _container_audit_token_copy_codesign_team_identifier, |
| 1660 | 1661 | _container_audit_token_copy_entitlement, _container_audit_token_copy_executable_name, |
| 1661 | _container_audit_token_for_pid, _container_audit_token_get_codesign_status, | |
| 1662 | _container_audit_token_get_egid, _container_audit_token_get_euid, | |
| 1663 | _container_audit_token_get_pid, _container_audit_token_get_platform, | |
| 1664 | _container_audit_token_is_valid, _container_authorize, _container_authorize_container, | |
| 1665 | _container_authorize_container_for_self, _container_authorize_get_result_description, | |
| 1666 | _container_base64_decode, _container_base64_decode_string, | |
| 1667 | _container_base64_encode, _container_base64_encode_string, | |
| 1668 | _container_bundle_copy_data_container, _container_bundle_copy_data_container_path, | |
| 1669 | _container_class_for_each_normalized_class, _container_class_normalized, | |
| 1670 | _container_class_supports_data_subdirectory, _container_class_supports_randomized_path, | |
| 1671 | _container_class_supports_randomized_path_on_current_platform, | |
| 1662 | _container_audit_token_copy_executable_name_with_pid, _container_audit_token_for_pid, | |
| 1663 | _container_audit_token_get_codesign_status, _container_audit_token_get_egid, | |
| 1664 | _container_audit_token_get_euid, _container_audit_token_get_pid, | |
| 1665 | _container_audit_token_get_platform, _container_audit_token_is_valid, | |
| 1666 | _container_authorize, _container_authorize_container, _container_authorize_container_for_self, | |
| 1667 | _container_authorize_get_result_description, _container_base64_decode, | |
| 1668 | _container_base64_decode_string, _container_base64_encode, | |
| 1669 | _container_base64_encode_string, _container_bundle_copy_data_container, | |
| 1670 | _container_bundle_copy_data_container_path, _container_class_for_each_normalized_class, | |
| 1671 | _container_class_normalized, _container_class_supports_data_subdirectory, | |
| 1672 | _container_class_supports_randomized_path, _container_class_supports_randomized_path_on_current_platform, | |
| 1672 | 1673 | _container_client_copy_decoded_from_xpc_object, _container_client_copy_encoded_xpc_object, |
| 1673 | 1674 | _container_client_copy_entitlement, _container_client_create_from_audit_token, |
| 1674 | 1675 | _container_client_get_audit_token, _container_client_get_codesign_identifier, |
| ... | ... | @@ -1680,7 +1681,7 @@ exports: |
| 1680 | 1681 | _container_client_is_signature_valid, _container_client_is_signed, |
| 1681 | 1682 | _container_client_is_test_client, _container_codesign_copy_cdhash, |
| 1682 | 1683 | _container_codesign_copy_cs_identity, _container_codesign_copy_cs_team_identifier, |
| 1683 | _container_codesign_copy_current_identifier, _container_codesign_get_self_audit_token, | |
| 1684 | _container_codesign_get_current_identifier, _container_codesign_get_self_audit_token, | |
| 1684 | 1685 | _container_codesign_get_status, _container_copy_client, _container_copy_code_signing_info_for_identifier, |
| 1685 | 1686 | _container_copy_from_path, _container_copy_info, _container_copy_info_value_for_key, |
| 1686 | 1687 | _container_copy_object, _container_copy_path, _container_copy_persona_unique_strings, |
| ... | ... | @@ -1794,7 +1795,8 @@ exports: |
| 1794 | 1795 | _container_seam_dispatch_set_common, _container_seam_fs_ensure_lazy_loaded, |
| 1795 | 1796 | _container_seam_fs_reset, _container_seam_fs_set_common, _container_seam_notify_reset, |
| 1796 | 1797 | _container_seam_notify_set_common, _container_seam_pwd_reset, |
| 1797 | _container_seam_pwd_set_common, _container_seam_sandbox_reset, | |
| 1798 | _container_seam_pwd_set_common, _container_seam_quarantine_reset, | |
| 1799 | _container_seam_quarantine_set_common, _container_seam_sandbox_reset, | |
| 1798 | 1800 | _container_seam_sandbox_set_common, _container_serialize_copy_deserialized_reference, |
| 1799 | 1801 | _container_serialize_copy_serialized_reference, _container_set_code_signing_info_for_identifier, |
| 1800 | 1802 | _container_set_data_protection_for_current_user, _container_set_info_value, |
| ... | ... | @@ -1831,7 +1833,7 @@ exports: |
| 1831 | 1833 | _container_xpc_set_outgoing_message_send_block, _container_xpc_set_use_shared_connection, |
| 1832 | 1834 | _container_xpc_shared_copy_connection, _gCMContainerSeam, |
| 1833 | 1835 | _gCMDispatchSeam, _gCMFSSeam, _gCMNotifySeam, _gCMPWDSeam, |
| 1834 | _gCMSandboxSeam ] | |
| 1836 | _gCMQuarantineSeam, _gCMSandboxSeam ] | |
| 1835 | 1837 | - targets: [ x86_64-maccatalyst, arm64-maccatalyst, arm64e-maccatalyst ] |
| 1836 | 1838 | symbols: [ _CONTAINER_CURRENT_MOBILE_UID, _CONTAINER_INSTALLATION_UID, |
| 1837 | 1839 | _CONTAINER_SYSTEM_UID, _container_create_or_lookup, _container_create_or_lookup_app_group_paths, |
| ... | ... | @@ -1925,7 +1927,7 @@ tbd-version: 4 |
| 1925 | 1927 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1926 | 1928 | arm64e-macos, arm64e-maccatalyst ] |
| 1927 | 1929 | install-name: '/usr/lib/system/libsystem_dnssd.dylib' |
| 1928 | current-version: 2881.0.25 | |
| 1930 | current-version: 2881.40.18 | |
| 1929 | 1931 | parent-umbrella: |
| 1930 | 1932 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 1931 | 1933 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -1962,7 +1964,7 @@ exports: |
| 1962 | 1964 | tbd-version: 4 |
| 1963 | 1965 | targets: [ x86_64-macos, arm64-macos, arm64e-macos ] |
| 1964 | 1966 | install-name: '/usr/lib/system/libsystem_eligibility.dylib' |
| 1965 | current-version: 286 | |
| 1967 | current-version: 286.40.9 | |
| 1966 | 1968 | parent-umbrella: |
| 1967 | 1969 | - targets: [ x86_64-macos, arm64-macos, arm64e-macos ] |
| 1968 | 1970 | umbrella: System |
| ... | ... | @@ -2118,7 +2120,7 @@ tbd-version: 4 |
| 2118 | 2120 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 2119 | 2121 | arm64e-macos, arm64e-maccatalyst ] |
| 2120 | 2122 | install-name: '/usr/lib/system/libsystem_kernel.dylib' |
| 2121 | current-version: 12377.1.9 | |
| 2123 | current-version: 12377.41.6 | |
| 2122 | 2124 | parent-umbrella: |
| 2123 | 2125 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 2124 | 2126 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -2254,7 +2256,7 @@ exports: |
| 2254 | 2256 | _clock_alarm, _clock_alarm_reply, _clock_get_attributes, _clock_get_time, |
| 2255 | 2257 | _clock_set_attributes, _clock_set_time, _clock_sleep, _clock_sleep_trap, |
| 2256 | 2258 | _clonefile, _clonefileat, _close, '_close$NOCANCEL', _coalition_create, |
| 2257 | _coalition_info_debug_info, _coalition_info_resource_usage, | |
| 2259 | _coalition_info_debug_info, _coalition_info_pid_list, _coalition_info_resource_usage, | |
| 2258 | 2260 | _coalition_info_set_efficiency, _coalition_info_set_name, |
| 2259 | 2261 | _coalition_ledger_set_logical_writes_limit, _coalition_policy_get, |
| 2260 | 2262 | _coalition_policy_set, _coalition_reap, _coalition_terminate, |
| ... | ... | @@ -2636,7 +2638,7 @@ tbd-version: 4 |
| 2636 | 2638 | targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst, |
| 2637 | 2639 | arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ] |
| 2638 | 2640 | install-name: '/usr/lib/system/libsystem_m.dylib' |
| 2639 | current-version: 3307.0.1 | |
| 2641 | current-version: 3309 | |
| 2640 | 2642 | parent-umbrella: |
| 2641 | 2643 | - targets: [ x86_64-macos, x86_64-maccatalyst, x86_64h-macos, x86_64h-maccatalyst, |
| 2642 | 2644 | arm64-macos, arm64-maccatalyst, arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -2858,7 +2860,7 @@ tbd-version: 4 |
| 2858 | 2860 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 2859 | 2861 | arm64e-macos, arm64e-maccatalyst ] |
| 2860 | 2862 | install-name: '/usr/lib/system/libsystem_malloc.dylib' |
| 2861 | current-version: 792.1.1 | |
| 2863 | current-version: 792.41.1 | |
| 2862 | 2864 | parent-umbrella: |
| 2863 | 2865 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 2864 | 2866 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -2983,11 +2985,12 @@ exports: |
| 2983 | 2985 | _ne_session_status_to_string, _ne_session_stop, _ne_session_stop_all_with_plugin_type, |
| 2984 | 2986 | _ne_session_stop_reason_to_string, _ne_session_type_to_string, |
| 2985 | 2987 | _ne_session_urlfilter_configs_present, _ne_session_use_as_system_vpn, |
| 2986 | _ne_session_vod_evaluate_connection_present, _ne_session_vpn_include_all_networks_configs_present, | |
| 2987 | _ne_socket_set_attribution, _ne_socket_set_domains, _ne_socket_set_is_app_initiated, | |
| 2988 | _ne_socket_set_website_attribution, _ne_tracker_build_cache, | |
| 2989 | _ne_tracker_build_trie, _ne_tracker_check_info_changed, _ne_tracker_check_is_hostname_blocked, | |
| 2990 | _ne_tracker_check_tcc, _ne_tracker_clear_cache, _ne_tracker_context_can_block_request, | |
| 2988 | _ne_session_vod_evaluate_connection_present, _ne_session_vpn_configs_present, | |
| 2989 | _ne_session_vpn_include_all_networks_configs_present, _ne_socket_set_attribution, | |
| 2990 | _ne_socket_set_domains, _ne_socket_set_is_app_initiated, _ne_socket_set_website_attribution, | |
| 2991 | _ne_tracker_build_cache, _ne_tracker_build_trie, _ne_tracker_check_info_changed, | |
| 2992 | _ne_tracker_check_is_hostname_blocked, _ne_tracker_check_tcc, | |
| 2993 | _ne_tracker_clear_cache, _ne_tracker_context_can_block_request, | |
| 2991 | 2994 | _ne_tracker_context_get_domain, _ne_tracker_context_get_domain_owner, |
| 2992 | 2995 | _ne_tracker_context_is_from_app_list, _ne_tracker_context_is_from_web_list, |
| 2993 | 2996 | _ne_tracker_copy_current_stacktrace, _ne_tracker_create_xcode_issue, |
| ... | ... | @@ -3024,7 +3027,7 @@ tbd-version: 4 |
| 3024 | 3027 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3025 | 3028 | arm64e-macos, arm64e-maccatalyst ] |
| 3026 | 3029 | install-name: '/usr/lib/system/libsystem_platform.dylib' |
| 3027 | current-version: 359.1.2 | |
| 3030 | current-version: 359.40.3 | |
| 3028 | 3031 | parent-umbrella: |
| 3029 | 3032 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3030 | 3033 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -3200,7 +3203,7 @@ tbd-version: 4 |
| 3200 | 3203 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3201 | 3204 | arm64e-macos, arm64e-maccatalyst ] |
| 3202 | 3205 | install-name: '/usr/lib/system/libsystem_sandbox.dylib' |
| 3203 | current-version: 2680.0.50 | |
| 3206 | current-version: 2680.41.1 | |
| 3204 | 3207 | parent-umbrella: |
| 3205 | 3208 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3206 | 3209 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -3321,7 +3324,7 @@ tbd-version: 4 |
| 3321 | 3324 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3322 | 3325 | arm64e-macos, arm64e-maccatalyst ] |
| 3323 | 3326 | install-name: '/usr/lib/system/libsystem_secinit.dylib' |
| 3324 | current-version: 168.0.3 | |
| 3327 | current-version: 168.40.2 | |
| 3325 | 3328 | parent-umbrella: |
| 3326 | 3329 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3327 | 3330 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -3354,7 +3357,7 @@ tbd-version: 4 |
| 3354 | 3357 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3355 | 3358 | arm64e-macos, arm64e-maccatalyst ] |
| 3356 | 3359 | install-name: '/usr/lib/system/libsystem_trace.dylib' |
| 3357 | current-version: 1815.0.16 | |
| 3360 | current-version: 1815.40.20 | |
| 3358 | 3361 | parent-umbrella: |
| 3359 | 3362 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3360 | 3363 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -3441,7 +3444,7 @@ exports: |
| 3441 | 3444 | tbd-version: 4 |
| 3442 | 3445 | targets: [ x86_64-macos, arm64-macos, arm64e-macos ] |
| 3443 | 3446 | install-name: '/usr/lib/system/libsystem_trial.dylib' |
| 3444 | current-version: 474 | |
| 3447 | current-version: 474.3 | |
| 3445 | 3448 | parent-umbrella: |
| 3446 | 3449 | - targets: [ x86_64-macos, arm64-macos, arm64e-macos ] |
| 3447 | 3450 | umbrella: System |
| ... | ... | @@ -3484,7 +3487,7 @@ tbd-version: 4 |
| 3484 | 3487 | targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3485 | 3488 | arm64e-macos, arm64e-maccatalyst ] |
| 3486 | 3489 | install-name: '/usr/lib/system/libxpc.dylib' |
| 3487 | current-version: 3089.0.11 | |
| 3490 | current-version: 3089.41.2 | |
| 3488 | 3491 | parent-umbrella: |
| 3489 | 3492 | - targets: [ x86_64-macos, x86_64-maccatalyst, arm64-macos, arm64-maccatalyst, |
| 3490 | 3493 | arm64e-macos, arm64e-maccatalyst ] |
| ... | ... | @@ -3670,10 +3673,10 @@ exports: |
| 3670 | 3673 | _xpc_binprefs_equal, _xpc_binprefs_init, _xpc_binprefs_is_noop, |
| 3671 | 3674 | _xpc_binprefs_set_psattr, _xpc_bool_create, _xpc_bool_get_value, |
| 3672 | 3675 | _xpc_bs_main, _xpc_bundle_copy_info_dictionary, _xpc_bundle_copy_normalized_cryptex_path, |
| 3673 | _xpc_bundle_copy_resource_path, _xpc_bundle_copy_services, | |
| 3674 | _xpc_bundle_create, _xpc_bundle_create_from_origin, _xpc_bundle_create_from_origin_with_string_cache, | |
| 3675 | _xpc_bundle_create_main, _xpc_bundle_create_with_string_cache, | |
| 3676 | _xpc_bundle_get_error, _xpc_bundle_get_executable_path, _xpc_bundle_get_info_dictionary, | |
| 3676 | _xpc_bundle_copy_services, _xpc_bundle_create, _xpc_bundle_create_from_origin, | |
| 3677 | _xpc_bundle_create_from_origin_with_string_cache, _xpc_bundle_create_main, | |
| 3678 | _xpc_bundle_create_with_string_cache, _xpc_bundle_get_error, | |
| 3679 | _xpc_bundle_get_executable_path, _xpc_bundle_get_info_dictionary, | |
| 3677 | 3680 | _xpc_bundle_get_path, _xpc_bundle_get_property, _xpc_bundle_get_xpcservice_dictionary, |
| 3678 | 3681 | _xpc_bundle_populate, _xpc_bundle_resolve, _xpc_bundle_resolve_on_queue, |
| 3679 | 3682 | _xpc_bundle_resolve_sync, _xpc_coalition_copy_info, _xpc_coalition_history_pipe_async, |
| ... | ... | @@ -3752,15 +3755,15 @@ exports: |
| 3752 | 3755 | _xpc_event_publisher_set_error_handler, _xpc_event_publisher_set_event, |
| 3753 | 3756 | _xpc_event_publisher_set_handler, _xpc_event_publisher_set_initial_load_completed_handler_4remoted, |
| 3754 | 3757 | _xpc_event_publisher_set_subscriber_keepalive, _xpc_event_publisher_set_throttling, |
| 3755 | _xpc_event_stream_check_in, _xpc_event_stream_check_in2, _xpc_exit_reason_get_label, | |
| 3756 | _xpc_extension_type_init, _xpc_fd_create, _xpc_fd_dup, _xpc_file_transfer_cancel, | |
| 3757 | _xpc_file_transfer_copy_io, _xpc_file_transfer_create_with_fd, | |
| 3758 | _xpc_file_transfer_create_with_path, _xpc_file_transfer_get_size, | |
| 3759 | _xpc_file_transfer_get_transfer_id, _xpc_file_transfer_send_finished, | |
| 3760 | _xpc_file_transfer_set_transport_writing_callbacks, _xpc_file_transfer_write_finished, | |
| 3761 | _xpc_file_transfer_write_to_fd, _xpc_file_transfer_write_to_path, | |
| 3762 | _xpc_generate_audit_token, _xpc_get_attachment_endpoint, _xpc_get_class4NSXPC, | |
| 3763 | _xpc_get_event_name, _xpc_get_instance, _xpc_get_service_identifier_for_token, | |
| 3758 | _xpc_exit_reason_get_label, _xpc_extension_type_init, _xpc_fd_create, | |
| 3759 | _xpc_fd_dup, _xpc_file_transfer_cancel, _xpc_file_transfer_copy_io, | |
| 3760 | _xpc_file_transfer_create_with_fd, _xpc_file_transfer_create_with_path, | |
| 3761 | _xpc_file_transfer_get_size, _xpc_file_transfer_get_transfer_id, | |
| 3762 | _xpc_file_transfer_send_finished, _xpc_file_transfer_set_transport_writing_callbacks, | |
| 3763 | _xpc_file_transfer_write_finished, _xpc_file_transfer_write_to_fd, | |
| 3764 | _xpc_file_transfer_write_to_path, _xpc_generate_audit_token, | |
| 3765 | _xpc_get_attachment_endpoint, _xpc_get_class4NSXPC, _xpc_get_event_name, | |
| 3766 | _xpc_get_instance, _xpc_get_service_identifier_for_token, | |
| 3764 | 3767 | _xpc_get_service_name_from_pid, _xpc_get_service_uid_for_token, |
| 3765 | 3768 | _xpc_get_type, _xpc_handle_service, _xpc_handle_subservice, |
| 3766 | 3769 | _xpc_hash, _xpc_impersonate_user, _xpc_init_services, _xpc_inspect_copy_description, |
lib/libc/include/any-macos-any/AvailabilityInternal.h+10-10| ... | ... | @@ -37,11 +37,11 @@ |
| 37 | 37 | #if __has_builtin(__is_target_os) |
| 38 | 38 | #if __is_target_os(macos) |
| 39 | 39 | #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ |
| 40 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_0 | |
| 40 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_1 | |
| 41 | 41 | #endif |
| 42 | 42 | #elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ |
| 43 | 43 | #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ |
| 44 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_0 | |
| 44 | #define __MAC_OS_X_VERSION_MAX_ALLOWED __MAC_26_1 | |
| 45 | 45 | #endif /* __has_builtin(__is_target_os) */ |
| 46 | 46 | #endif /* defined(__has_builtin) */ |
| 47 | 47 | #endif /* __MAC_OS_X_VERSION_MIN_REQUIRED */ |
| ... | ... | @@ -51,11 +51,11 @@ |
| 51 | 51 | #if __has_builtin(__is_target_os) |
| 52 | 52 | #if __is_target_os(ios) |
| 53 | 53 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ |
| 54 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_0 | |
| 54 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_1 | |
| 55 | 55 | #endif |
| 56 | 56 | #elif __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ |
| 57 | 57 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ |
| 58 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_0 | |
| 58 | #define __IPHONE_OS_VERSION_MAX_ALLOWED __IPHONE_26_1 | |
| 59 | 59 | #endif /* __has_builtin(__is_target_os) */ |
| 60 | 60 | #endif /* defined(__has_builtin) */ |
| 61 | 61 | #endif /* __IPHONE_OS_VERSION_MIN_REQUIRED */ |
| ... | ... | @@ -65,13 +65,13 @@ |
| 65 | 65 | #if __has_builtin(__is_target_os) |
| 66 | 66 | #if __is_target_os(watchos) |
| 67 | 67 | #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ |
| 68 | #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_0 | |
| 68 | #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_1 | |
| 69 | 69 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 70 | 70 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0 |
| 71 | 71 | #endif |
| 72 | 72 | #elif __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ |
| 73 | 73 | #define __WATCH_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ |
| 74 | #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_0 | |
| 74 | #define __WATCH_OS_VERSION_MAX_ALLOWED __WATCHOS_26_1 | |
| 75 | 75 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 76 | 76 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0 |
| 77 | 77 | #endif /* __has_builtin(__is_target_os) */ |
| ... | ... | @@ -83,13 +83,13 @@ |
| 83 | 83 | #if __has_builtin(__is_target_os) |
| 84 | 84 | #if __is_target_os(tvos) |
| 85 | 85 | #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ |
| 86 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_0 | |
| 86 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_1 | |
| 87 | 87 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 88 | 88 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0 |
| 89 | 89 | #endif |
| 90 | 90 | #elif __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ |
| 91 | 91 | #define __TV_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ |
| 92 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_0 | |
| 92 | #define __TV_OS_VERSION_MAX_ALLOWED __TVOS_26_1 | |
| 93 | 93 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 94 | 94 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_9_0 |
| 95 | 95 | #endif /* __has_builtin(__is_target_os) */ |
| ... | ... | @@ -103,7 +103,7 @@ |
| 103 | 103 | #if __has_builtin(__is_target_os) |
| 104 | 104 | #if __is_target_os(driverkit) |
| 105 | 105 | #define __DRIVERKIT_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ |
| 106 | #define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_25_0 | |
| 106 | #define __DRIVERKIT_VERSION_MAX_ALLOWED __DRIVERKIT_25_1 | |
| 107 | 107 | #endif |
| 108 | 108 | #endif /* __has_builtin(__is_target_os) */ |
| 109 | 109 | #endif /* defined(__has_builtin) */ |
| ... | ... | @@ -114,7 +114,7 @@ |
| 114 | 114 | #if __has_builtin(__is_target_os) |
| 115 | 115 | #if __is_target_os(visionos) |
| 116 | 116 | #define __VISION_OS_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ |
| 117 | #define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_26_0 | |
| 117 | #define __VISION_OS_VERSION_MAX_ALLOWED __VISIONOS_26_1 | |
| 118 | 118 | /* for compatibility with existing code. New code should use platform specific checks */ |
| 119 | 119 | #define __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_17_1 |
| 120 | 120 | #endif |
lib/libc/include/any-macos-any/AvailabilityVersions.h+8| ... | ... | @@ -97,6 +97,7 @@ |
| 97 | 97 | #define __MAC_15_6 150600 |
| 98 | 98 | #define __MAC_16_0 160000 |
| 99 | 99 | #define __MAC_26_0 260000 |
| 100 | #define __MAC_26_1 260100 | |
| 100 | 101 | /* __MAC__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 101 | 102 | |
| 102 | 103 | #define __IPHONE_2_0 20000 |
| ... | ... | @@ -188,6 +189,7 @@ |
| 188 | 189 | #define __IPHONE_18_6 180600 |
| 189 | 190 | #define __IPHONE_19_0 190000 |
| 190 | 191 | #define __IPHONE_26_0 260000 |
| 192 | #define __IPHONE_26_1 260100 | |
| 191 | 193 | /* __IPHONE__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 192 | 194 | |
| 193 | 195 | #define __WATCHOS_1_0 10000 |
| ... | ... | @@ -248,6 +250,7 @@ |
| 248 | 250 | #define __WATCHOS_11_6 110600 |
| 249 | 251 | #define __WATCHOS_12_0 120000 |
| 250 | 252 | #define __WATCHOS_26_0 260000 |
| 253 | #define __WATCHOS_26_1 260100 | |
| 251 | 254 | /* __WATCHOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 252 | 255 | |
| 253 | 256 | #define __TVOS_9_0 90000 |
| ... | ... | @@ -308,6 +311,7 @@ |
| 308 | 311 | #define __TVOS_18_6 180600 |
| 309 | 312 | #define __TVOS_19_0 190000 |
| 310 | 313 | #define __TVOS_26_0 260000 |
| 314 | #define __TVOS_26_1 260100 | |
| 311 | 315 | /* __TVOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 312 | 316 | |
| 313 | 317 | #define __BRIDGEOS_2_0 20000 |
| ... | ... | @@ -345,6 +349,7 @@ |
| 345 | 349 | #define __BRIDGEOS_9_5 90500 |
| 346 | 350 | #define __BRIDGEOS_9_6 90600 |
| 347 | 351 | #define __BRIDGEOS_10_0 100000 |
| 352 | #define __BRIDGEOS_10_1 100100 | |
| 348 | 353 | |
| 349 | 354 | |
| 350 | 355 | #define __DRIVERKIT_19_0 190000 |
| ... | ... | @@ -369,6 +374,7 @@ |
| 369 | 374 | #define __DRIVERKIT_24_5 240500 |
| 370 | 375 | #define __DRIVERKIT_24_6 240600 |
| 371 | 376 | #define __DRIVERKIT_25_0 250000 |
| 377 | #define __DRIVERKIT_25_1 250100 | |
| 372 | 378 | /* __DRIVERKIT__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 373 | 379 | |
| 374 | 380 | #define __VISIONOS_1_0 10000 |
| ... | ... | @@ -384,6 +390,7 @@ |
| 384 | 390 | #define __VISIONOS_2_6 20600 |
| 385 | 391 | #define __VISIONOS_3_0 30000 |
| 386 | 392 | #define __VISIONOS_26_0 260000 |
| 393 | #define __VISIONOS_26_1 260100 | |
| 387 | 394 | /* __VISIONOS__NA is not defined to a value but is used as a token by macros to indicate that the API is unavailable */ |
| 388 | 395 | |
| 389 | 396 | |
| ... | ... | @@ -474,6 +481,7 @@ |
| 474 | 481 | #define MAC_OS_VERSION_15_6 __MAC_15_6 |
| 475 | 482 | #define MAC_OS_VERSION_16_0 __MAC_16_0 |
| 476 | 483 | #define MAC_OS_VERSION_26_0 __MAC_26_0 |
| 484 | #define MAC_OS_VERSION_26_1 __MAC_26_1 | |
| 477 | 485 | |
| 478 | 486 | #endif /* #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) */ |
| 479 | 487 |
lib/libc/include/any-macos-any/CommonCrypto/CommonCrypto.h created+34| ... | ... | @@ -0,0 +1,34 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2006-2012 Apple, Inc. All Rights Reserved. | |
| 3 | * | |
| 4 | * @APPLE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. Please obtain a copy of the License at | |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 11 | * file. | |
| 12 | * | |
| 13 | * The Original Code and all software distributed under the License are | |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 18 | * Please see the License for the specific language governing rights and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * @APPLE_LICENSE_HEADER_END@ | |
| 22 | */ | |
| 23 | ||
| 24 | #ifndef __COMMONCRYPTO_PUBLIC__ | |
| 25 | #define __COMMONCRYPTO_PUBLIC__ | |
| 26 | ||
| 27 | #include <CommonCrypto/CommonCryptor.h> | |
| 28 | #include <CommonCrypto/CommonDigest.h> | |
| 29 | #include <CommonCrypto/CommonHMAC.h> | |
| 30 | #include <CommonCrypto/CommonKeyDerivation.h> | |
| 31 | #include <CommonCrypto/CommonSymmetricKeywrap.h> | |
| 32 | ||
| 33 | #endif /* __COMMONCRYPTO_PUBLIC__ */ | |
| 34 |
lib/libc/include/any-macos-any/CommonCrypto/CommonCryptoError.h created+78| ... | ... | @@ -0,0 +1,78 @@ |
| 1 | // | |
| 2 | // CommonCryptoError.h | |
| 3 | // CommonCrypto | |
| 4 | // | |
| 5 | // Copyright (c) 2014 Platform Security. All rights reserved. | |
| 6 | // | |
| 7 | ||
| 8 | #ifndef CommonCrypto_CommonCryptoError_h | |
| 9 | #define CommonCrypto_CommonCryptoError_h | |
| 10 | ||
| 11 | /* | |
| 12 | * Copyright (c) 2014 Apple Inc. All Rights Reserved. | |
| 13 | * | |
| 14 | * @APPLE_LICENSE_HEADER_START@ | |
| 15 | * | |
| 16 | * This file contains Original Code and/or Modifications of Original Code | |
| 17 | * as defined in and that are subject to the Apple Public Source License | |
| 18 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 19 | * compliance with the License. Please obtain a copy of the License at | |
| 20 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 21 | * file. | |
| 22 | * | |
| 23 | * The Original Code and all software distributed under the License are | |
| 24 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 25 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 26 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 27 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 28 | * Please see the License for the specific language governing rights and | |
| 29 | * limitations under the License. | |
| 30 | * | |
| 31 | * @APPLE_LICENSE_HEADER_END@ | |
| 32 | */ | |
| 33 | ||
| 34 | #include <stdint.h> | |
| 35 | ||
| 36 | #if defined(__cplusplus) | |
| 37 | extern "C" { | |
| 38 | #endif	 | |
| 39 | ||
| 40 | /*! | |
| 41 | @enum CCCryptorStatus | |
| 42 | @abstract Return values from CommonCryptor operations. | |
| 43 | ||
| 44 | @constant kCCSuccess Operation completed normally. | |
| 45 | @constant kCCParamError Illegal parameter value. | |
| 46 | @constant kCCBufferTooSmall Insufficent buffer provided for specified | |
| 47 | operation. | |
| 48 | @constant kCCMemoryFailure Memory allocation failure. | |
| 49 | @constant kCCAlignmentError Input size was not aligned properly. | |
| 50 | @constant kCCDecodeError Input data did not decode or decrypt | |
| 51 | properly. | |
| 52 | @constant kCCUnimplemented Function not implemented for the current | |
| 53 | algorithm. | |
| 54 | @constant kCCInvalidKey Key is not valid. | |
| 55 | */ | |
| 56 | enum { | |
| 57 | kCCSuccess = 0, | |
| 58 | kCCParamError = -4300, | |
| 59 | kCCBufferTooSmall = -4301, | |
| 60 | kCCMemoryFailure = -4302, | |
| 61 | kCCAlignmentError = -4303, | |
| 62 | kCCDecodeError = -4304, | |
| 63 | kCCUnimplemented = -4305, | |
| 64 | kCCOverflow = -4306, | |
| 65 | kCCRNGFailure = -4307, | |
| 66 | kCCUnspecifiedError = -4308, | |
| 67 | kCCCallSequenceError= -4309, | |
| 68 | kCCKeySizeError = -4310, | |
| 69 | kCCInvalidKey = -4311, | |
| 70 | }; | |
| 71 | typedef int32_t CCStatus; | |
| 72 | typedef int32_t CCCryptorStatus; | |
| 73 | ||
| 74 | #if defined(__cplusplus) | |
| 75 | } | |
| 76 | #endif | |
| 77 | ||
| 78 | #endif |
lib/libc/include/any-macos-any/CommonCrypto/CommonCryptor.h created+763| ... | ... | @@ -0,0 +1,763 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2006-2010 Apple, Inc. All Rights Reserved. | |
| 3 | * | |
| 4 | * @APPLE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. Please obtain a copy of the License at | |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 11 | * file. | |
| 12 | * | |
| 13 | * The Original Code and all software distributed under the License are | |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 18 | * Please see the License for the specific language governing rights and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * @APPLE_LICENSE_HEADER_END@ | |
| 22 | */ | |
| 23 | ||
| 24 | /*! | |
| 25 | @header CommonCryptor.h | |
| 26 | @abstract Generic interface for symmetric encryption. | |
| 27 | ||
| 28 | @discussion This interface provides access to a number of symmetric | |
| 29 | encryption algorithms. Symmetric encryption algorithms come | |
| 30 | in two "flavors" - block ciphers, and stream ciphers. Block | |
| 31 | ciphers process data (while both encrypting and decrypting) | |
| 32 | in discrete chunks of data called blocks; stream ciphers | |
| 33 | operate on arbitrary sized data. | |
| 34 | ||
| 35 | The object declared in this interface, CCCryptor, provides | |
| 36 | access to both block ciphers and stream ciphers with the same | |
| 37 | API; however some options are available for block ciphers that | |
| 38 | do not apply to stream ciphers. | |
| 39 | ||
| 40 | The general operation of a CCCryptor is: initialize it | |
| 41 | with raw key data and other optional fields with | |
| 42 | CCCryptorCreate(); process input data via one or more calls to | |
| 43 | CCCryptorUpdate(), each of which may result in output data | |
| 44 | being written to caller-supplied memory; and obtain possible | |
| 45 | remaining output data with CCCryptorFinal(). The CCCryptor is | |
| 46 | disposed of via CCCryptorRelease(), or it can be reused (with | |
| 47 | the same key data as provided to CCCryptorCreate()) by calling | |
| 48 | CCCryptorReset(). The CCCryptorReset() function only works for | |
| 49 | the CBC and CTR modes. In other block cipher modes, it returns error. | |
| 50 | ||
| 51 | ||
| 52 | CCCryptors can be dynamically allocated by this module, or | |
| 53 | their memory can be allocated by the caller. See discussion for | |
| 54 | CCCryptorCreate() and CCCryptorCreateFromData() for information | |
| 55 | on CCCryptor allocation. | |
| 56 | ||
| 57 | One option for block ciphers is padding, as defined in PKCS7; | |
| 58 | when padding is enabled, the total amount of data encrypted | |
| 59 | does not have to be an even multiple of the block size, and | |
| 60 | the actual length of plaintext is calculated during decryption. | |
| 61 | ||
| 62 | Another option for block ciphers is Cipher Block Chaining, known | |
| 63 | as CBC mode. When using CBC mode, an Initialization Vector (IV) | |
| 64 | is provided along with the key when starting an encrypt | |
| 65 | or decrypt operation. If CBC mode is selected and no IV is | |
| 66 | provided, an IV of all zeroes will be used. | |
| 67 | ||
| 68 | CCCryptor also implements block bufferring, so that individual | |
| 69 | calls to CCCryptorUpdate() do not have to provide data whose | |
| 70 | length is aligned to the block size. (If padding is disabled, | |
| 71 | encrypting with block ciphers does require that the *total* | |
| 72 | length of data input to CCCryptorUpdate() call(s) be aligned | |
| 73 | to the block size.) | |
| 74 | ||
| 75 | A given CCCryptor can only be used by one thread at a time; | |
| 76 | multiple threads can use safely different CCCryptors at the | |
| 77 | same time. | |
| 78 | */ | |
| 79 | ||
| 80 | #include <CommonCrypto/CommonCryptoError.h> | |
| 81 | ||
| 82 | #ifndef _CC_COMMON_CRYPTOR_ | |
| 83 | #define _CC_COMMON_CRYPTOR_ | |
| 84 | ||
| 85 | #include <stdbool.h> | |
| 86 | #include <stdint.h> | |
| 87 | #include <stddef.h> | |
| 88 | ||
| 89 | #if defined(_MSC_VER) | |
| 90 | #include <availability.h> | |
| 91 | #else | |
| 92 | #include <os/availability.h> | |
| 93 | #endif | |
| 94 | ||
| 95 | ||
| 96 | #ifdef __cplusplus | |
| 97 | extern "C" { | |
| 98 | #endif | |
| 99 | ||
| 100 | /*! | |
| 101 | @typedef CCCryptorRef | |
| 102 | @abstract Opaque reference to a CCCryptor object. | |
| 103 | */ | |
| 104 | typedef struct _CCCryptor *CCCryptorRef; | |
| 105 | ||
| 106 | ||
| 107 | /*! | |
| 108 | @enum CCOperation | |
| 109 | @abstract Operations that an CCCryptor can perform. | |
| 110 | ||
| 111 | @constant kCCEncrypt Symmetric encryption. | |
| 112 | @constant kCCDecrypt Symmetric decryption. | |
| 113 | */ | |
| 114 | enum { | |
| 115 | kCCEncrypt = 0, | |
| 116 | kCCDecrypt, | |
| 117 | }; | |
| 118 | typedef uint32_t CCOperation; | |
| 119 | ||
| 120 | /*! | |
| 121 | @enum CCAlgorithm | |
| 122 | @abstract Encryption algorithms implemented by this module. | |
| 123 | @constant kCCAlgorithmAES Advanced Encryption Standard, 128-bit block | |
| 124 | @constant kCCAlgorithmAES128 Deprecated, name phased out due to ambiguity with key size | |
| 125 | @constant kCCAlgorithmDES Data Encryption Standard | |
| 126 | @constant kCCAlgorithm3DES Triple-DES, three key, EDE configuration | |
| 127 | @constant kCCAlgorithmCAST CAST | |
| 128 | 	@constant kCCAlgorithmRC4 RC4 stream cipher | |
| 129 | 	@constant kCCAlgorithmBlowfish Blowfish block cipher | |
| 130 | */ | |
| 131 | enum { | |
| 132 | kCCAlgorithmAES128 = 0, /* Deprecated, name phased out due to ambiguity with key size */ | |
| 133 | kCCAlgorithmAES = 0, | |
| 134 | kCCAlgorithmDES, | |
| 135 | kCCAlgorithm3DES, | |
| 136 | kCCAlgorithmCAST, | |
| 137 | kCCAlgorithmRC4, | |
| 138 | kCCAlgorithmRC2, | |
| 139 | kCCAlgorithmBlowfish | |
| 140 | }; | |
| 141 | typedef uint32_t CCAlgorithm; | |
| 142 | ||
| 143 | /*! | |
| 144 | @enum CCOptions | |
| 145 | @abstract Options flags, passed to CCCryptorCreate(). | |
| 146 | ||
| 147 | @constant kCCOptionPKCS7Padding Perform PKCS7 padding. | |
| 148 | @constant kCCOptionECBMode Electronic Code Book Mode. | |
| 149 | Default is CBC. | |
| 150 | */ | |
| 151 | enum { | |
| 152 | /* options for block ciphers */ | |
| 153 | kCCOptionPKCS7Padding = 0x0001, | |
| 154 | kCCOptionECBMode = 0x0002 | |
| 155 | /* stream ciphers currently have no options */ | |
| 156 | }; | |
| 157 | typedef uint32_t CCOptions; | |
| 158 | ||
| 159 | /*! | |
| 160 | @enum Key sizes | |
| 161 | ||
| 162 | @discussion Key sizes, in bytes, for supported algorithms. Use these | |
| 163 | constants to select any keysize variants you wish to use | |
| 164 | for algorithms that support them (ie AES-128, AES-192, AES-256) | |
| 165 | ||
| 166 | @constant kCCKeySizeAES128 128 bit AES key size. | |
| 167 | @constant kCCKeySizeAES192 192 bit AES key size. | |
| 168 | @constant kCCKeySizeAES256 256 bit AES key size. | |
| 169 | @constant kCCKeySizeDES DES key size. | |
| 170 | @constant kCCKeySize3DES Triple DES key size. | |
| 171 | @constant kCCKeySizeMinCAST CAST minimum key size. | |
| 172 | @constant kCCKeySizeMaxCAST CAST maximum key size. | |
| 173 | @constant kCCKeySizeMinRC4 RC4 minimum key size. | |
| 174 | @constant kCCKeySizeMaxRC4 RC4 maximum key size. | |
| 175 | ||
| 176 | @discussion DES and TripleDES have fixed key sizes. | |
| 177 | AES has three discrete key sizes. | |
| 178 | CAST and RC4 have variable key sizes. | |
| 179 | */ | |
| 180 | enum { | |
| 181 | kCCKeySizeAES128 = 16, | |
| 182 | kCCKeySizeAES192 = 24, | |
| 183 | kCCKeySizeAES256 = 32, | |
| 184 | kCCKeySizeDES = 8, | |
| 185 | kCCKeySize3DES = 24, | |
| 186 | kCCKeySizeMinCAST = 5, | |
| 187 | kCCKeySizeMaxCAST = 16, | |
| 188 | kCCKeySizeMinRC4 = 1, | |
| 189 | kCCKeySizeMaxRC4 = 512, | |
| 190 | kCCKeySizeMinRC2 = 1, | |
| 191 | kCCKeySizeMaxRC2 = 128, | |
| 192 | kCCKeySizeMinBlowfish = 8, | |
| 193 | kCCKeySizeMaxBlowfish = 56, | |
| 194 | }; | |
| 195 | ||
| 196 | /*! | |
| 197 | @enum Block sizes | |
| 198 | ||
| 199 | @discussion Block sizes, in bytes, for supported algorithms. | |
| 200 | ||
| 201 | @constant kCCBlockSizeAES128 AES block size (currently, only 128-bit | |
| 202 | blocks are supported). | |
| 203 | @constant kCCBlockSizeDES DES block size. | |
| 204 | @constant kCCBlockSize3DES Triple DES block size. | |
| 205 | @constant kCCBlockSizeCAST CAST block size. | |
| 206 | */ | |
| 207 | enum { | |
| 208 | /* AES */ | |
| 209 | kCCBlockSizeAES128 = 16, | |
| 210 | /* DES */ | |
| 211 | kCCBlockSizeDES = 8, | |
| 212 | /* 3DES */ | |
| 213 | kCCBlockSize3DES = 8, | |
| 214 | /* CAST */ | |
| 215 | kCCBlockSizeCAST = 8, | |
| 216 | kCCBlockSizeRC2 = 8, | |
| 217 | kCCBlockSizeBlowfish = 8, | |
| 218 | }; | |
| 219 | ||
| 220 | /*! | |
| 221 | @enum Minimum context sizes | |
| 222 | @discussion Minimum context sizes, for caller-allocated CCCryptorRefs. | |
| 223 | To minimize dynamic allocation memory, a caller can create | |
| 224 | a CCCryptorRef by passing caller-supplied memory to the | |
| 225 | CCCryptorCreateFromData() function. | |
| 226 | ||
| 227 | These constants define the minimum amount of memory, in | |
| 228 | bytes, needed for CCCryptorRefs for each supported algorithm. | |
| 229 | ||
| 230 | Note: these constants are valid for the current version of | |
| 231 | this library; they may change in subsequent releases, so | |
| 232 | applications wishing to allocate their own memory for use | |
| 233 | in creating CCCryptorRefs must be prepared to deal with | |
| 234 | a kCCBufferTooSmall return from CCCryptorCreateFromData(). | |
| 235 | See discussion for the CCCryptorCreateFromData() function. | |
| 236 | ||
| 237 | @constant kCCContextSizeAES128 - Minimum context size for kCCAlgorithmAES128. | |
| 238 | @constant kCCContextSizeDES - Minimum context size for kCCAlgorithmDES. | |
| 239 | @constant kCCContextSize3DES - Minimum context size for kCCAlgorithm3DES. | |
| 240 | @constant kCCContextSizeCAST - Minimum context size for kCCAlgorithmCAST. | |
| 241 | @constant kCCContextSizeRC4 - Minimum context size for kCCAlgorithmRC4. | |
| 242 | */ | |
| 243 | ||
| 244 | enum { | |
| 245 | kCCContextSizeAES128	= 404, | |
| 246 | kCCContextSizeDES		= 240, | |
| 247 | kCCContextSize3DES		= 496, | |
| 248 | kCCContextSizeCAST		= 240, | |
| 249 | kCCContextSizeRC4		= 1072 | |
| 250 | }; | |
| 251 | ||
| 252 | ||
| 253 | ||
| 254 | /*! | |
| 255 | @function CCCryptorCreate | |
| 256 | @abstract Create a cryptographic context. | |
| 257 | ||
| 258 | @param op Defines the basic operation: kCCEncrypt or | |
| 259 | kCCDecrypt. | |
| 260 | ||
| 261 | @param alg Defines the algorithm. | |
| 262 | ||
| 263 | @param options A word of flags defining options. See discussion | |
| 264 | for the CCOptions type. | |
| 265 | ||
| 266 | @param key Raw key material, length keyLength bytes. | |
| 267 | ||
| 268 | @param keyLength Length of key material. Must be appropriate | |
| 269 | for the selected operation and algorithm. Some | |
| 270 | algorithms provide for varying key lengths. | |
| 271 | ||
| 272 | @param iv Initialization vector, optional. Used by | |
| 273 | block ciphers when Cipher Block Chaining (CBC) | |
| 274 | mode is enabled. If present, must be the same | |
| 275 | length as the selected algorithm's block size. | |
| 276 | If CBC mode is selected (by the absence of the | |
| 277 | kCCOptionECBMode bit in the options flags) and no | |
| 278 | IV is present, a NULL (all zeroes) IV will be used. | |
| 279 | This parameter is ignored if ECB mode is used or | |
| 280 | if a stream cipher algorithm is selected. For sound | |
| 281 | encryption, always initialize iv with random data. | |
| 282 | ||
| 283 | @param cryptorRef A (required) pointer to the returned CCCryptorRef. | |
| 284 | ||
| 285 | @result Possible error returns are kCCParamError and kCCMemoryFailure. | |
| 286 | */ | |
| 287 | CCCryptorStatus CCCryptorCreate( | |
| 288 | CCOperation op, /* kCCEncrypt, etc. */ | |
| 289 | CCAlgorithm alg, /* kCCAlgorithmDES, etc. */ | |
| 290 | CCOptions options, /* kCCOptionPKCS7Padding, etc. */ | |
| 291 | const void *key, /* raw key material */ | |
| 292 | size_t keyLength, | |
| 293 | const void *iv, /* optional initialization vector */ | |
| 294 | CCCryptorRef *cryptorRef) /* RETURNED */ | |
| 295 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 296 | ||
| 297 | /*! | |
| 298 | @function CCCryptorCreateFromData | |
| 299 | @abstract Create a cryptographic context using caller-supplied memory. | |
| 300 | ||
| 301 | @param op Defines the basic operation: kCCEncrypt or | |
| 302 | kCCDecrypt. | |
| 303 | ||
| 304 | @param alg Defines the algorithm. | |
| 305 | ||
| 306 | @param options A word of flags defining options. See discussion | |
| 307 | for the CCOptions type. | |
| 308 | ||
| 309 | @param key Raw key material, length keyLength bytes. | |
| 310 | ||
| 311 | @param keyLength Length of key material. Must be appropriate | |
| 312 | for the selected operation and algorithm. Some | |
| 313 | algorithms provide for varying key lengths. | |
| 314 | ||
| 315 | @param iv Initialization vector, optional. Used by | |
| 316 | block ciphers when Cipher Block Chaining (CBC) | |
| 317 | mode is enabled. If present, must be the same | |
| 318 | length as the selected algorithm's block size. | |
| 319 | If CBC mode is selected (by the absence of the | |
| 320 | kCCOptionECBMode bit in the options flags) and no | |
| 321 | IV is present, a NULL (all zeroes) IV will be used. | |
| 322 | This parameter is ignored if ECB mode is used or | |
| 323 | if a stream cipher algorithm is selected. For sound | |
| 324 | encryption, always initialize iv with random data. | |
| 325 | ||
| 326 | @param data A pointer to caller-supplied memory from which the | |
| 327 | CCCryptorRef will be created. | |
| 328 | ||
| 329 | @param dataLength The size of the caller-supplied memory in bytes. | |
| 330 | ||
| 331 | @param cryptorRef A (required) pointer to the returned CCCryptorRef. | |
| 332 | ||
| 333 | @param dataUsed Optional. If present, the actual number of bytes of | |
| 334 | the caller-supplied memory which was consumed by | |
| 335 | creation of the CCCryptorRef is returned here. Also, | |
| 336 | if the supplied memory is of insufficent size to create | |
| 337 | a CCCryptorRef, kCCBufferTooSmall is returned, and | |
| 338 | the minimum required buffer size is returned via this | |
| 339 | parameter if present. | |
| 340 | ||
| 341 | @result Possible error returns are kCCParamError and kCCBufferTooSmall. | |
| 342 | ||
| 343 | @discussion The CCCryptorRef created by this function must be disposed of | |
| 344 | via CCCRyptorRelease which clears sensitive data and deallocates memory | |
| 345 | when the caller is finished using the CCCryptorRef. | |
| 346 | */ | |
| 347 | CCCryptorStatus CCCryptorCreateFromData( | |
| 348 | CCOperation op, /* kCCEncrypt, etc. */ | |
| 349 | CCAlgorithm alg, /* kCCAlgorithmDES, etc. */ | |
| 350 | CCOptions options, /* kCCOptionPKCS7Padding, etc. */ | |
| 351 | const void *key, /* raw key material */ | |
| 352 | size_t keyLength, | |
| 353 | const void *iv, /* optional initialization vector */ | |
| 354 | const void *data, /* caller-supplied memory */ | |
| 355 | size_t dataLength, /* length of data in bytes */ | |
| 356 | CCCryptorRef *cryptorRef, /* RETURNED */ | |
| 357 | size_t *dataUsed) /* optional, RETURNED */ | |
| 358 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 359 | ||
| 360 | /*! | |
| 361 | @function CCCryptorRelease | |
| 362 | @abstract Free a context created by CCCryptorCreate or | |
| 363 | CCCryptorCreateFromData(). | |
| 364 | ||
| 365 | @param cryptorRef The CCCryptorRef to release. | |
| 366 | ||
| 367 | @result The only possible error return is kCCParamError resulting | |
| 368 | from passing in a null CCCryptorRef. | |
| 369 | */ | |
| 370 | CCCryptorStatus CCCryptorRelease( | |
| 371 | CCCryptorRef cryptorRef) | |
| 372 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 373 | ||
| 374 | /*! | |
| 375 | @function CCCryptorUpdate | |
| 376 | @abstract Process (encrypt, decrypt) some data. The result, if any, | |
| 377 | is written to a caller-provided buffer. | |
| 378 | ||
| 379 | @param cryptorRef A CCCryptorRef created via CCCryptorCreate() or | |
| 380 | CCCryptorCreateFromData(). | |
| 381 | @param dataIn Data to process, length dataInLength bytes. | |
| 382 | @param dataInLength Length of data to process. | |
| 383 | @param dataOut Result is written here. Allocated by caller. | |
| 384 | Encryption and decryption can be performed | |
| 385 | "in-place", with the same buffer used for | |
| 386 | input and output. The in-place operation is not | |
| 387 | suported for ciphers modes that work with blocks | |
| 388 | of data such as CBC and ECB. | |
| 389 | ||
| 390 | @param dataOutAvailable The size of the dataOut buffer in bytes. | |
| 391 | @param dataOutMoved On successful return, the number of bytes | |
| 392 | 				written to dataOut. | |
| 393 | ||
| 394 | @result kCCBufferTooSmall indicates insufficent space in the dataOut | |
| 395 | buffer. The caller can use | |
| 396 | 				CCCryptorGetOutputLength() to determine the | |
| 397 | 				required output buffer size in this case. The | |
| 398 | 				operation can be retried; no state is lost | |
| 399 | when this is returned. | |
| 400 | ||
| 401 | @discussion This routine can be called multiple times. The caller does | |
| 402 | not need to align input data lengths to block sizes; input is | |
| 403 | bufferred as necessary for block ciphers. | |
| 404 | ||
| 405 | When performing symmetric encryption with block ciphers, | |
| 406 | and padding is enabled via kCCOptionPKCS7Padding, the total | |
| 407 | number of bytes provided by all the calls to this function | |
| 408 | when encrypting can be arbitrary (i.e., the total number | |
| 409 | of bytes does not have to be block aligned). However if | |
| 410 | padding is disabled, or when decrypting, the total number | |
| 411 | of bytes does have to be aligned to the block size; otherwise | |
| 412 | CCCryptFinal() will return kCCAlignmentError. | |
| 413 | ||
| 414 | A general rule for the size of the output buffer which must be | |
| 415 | provided by the caller is that for block ciphers, the output | |
| 416 | length is never larger than the input length plus the block size. | |
| 417 | For stream ciphers, the output length is always exactly the same | |
| 418 | as the input length. See the discussion for | |
| 419 | 		CCCryptorGetOutputLength() for more information on this topic. | |
| 420 | ||
| 421 | Generally, when all data has been processed, call | |
| 422 | 		CCCryptorFinal(). | |
| 423 | ||
| 424 | In the following cases, the CCCryptorFinal() is superfluous as | |
| 425 | it will not yield any data nor return an error: | |
| 426 | 1. Encrypting or decrypting with a block cipher with padding | |
| 427 | disabled, when the total amount of data provided to | |
| 428 | CCCryptorUpdate() is an integral multiple of the block size. | |
| 429 | 2. Encrypting or decrypting with a stream cipher. | |
| 430 | */ | |
| 431 | CCCryptorStatus CCCryptorUpdate( | |
| 432 | CCCryptorRef cryptorRef, | |
| 433 | const void *dataIn, | |
| 434 | size_t dataInLength, | |
| 435 | void *dataOut, /* data RETURNED here */ | |
| 436 | size_t dataOutAvailable, | |
| 437 | size_t *dataOutMoved) /* number of bytes written */ | |
| 438 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 439 | ||
| 440 | /*! | |
| 441 | @function CCCryptorFinal | |
| 442 | @abstract Finish an encrypt or decrypt operation, and obtain the (possible) | |
| 443 | final data output. | |
| 444 | ||
| 445 | @param cryptorRef A CCCryptorRef created via CCCryptorCreate() or | |
| 446 | CCCryptorCreateFromData(). | |
| 447 | @param dataOut Result is written here. Allocated by caller. | |
| 448 | @param dataOutAvailable The size of the dataOut buffer in bytes. | |
| 449 | @param dataOutMoved On successful return, the number of bytes | |
| 450 | 				written to dataOut. | |
| 451 | ||
| 452 | @result kCCBufferTooSmall indicates insufficent space in the dataOut | |
| 453 | buffer. The caller can use | |
| 454 | 				CCCryptorGetOutputLength() to determine the | |
| 455 | 				required output buffer size in this case. The | |
| 456 | 				operation can be retried; no state is lost | |
| 457 | when this is returned. | |
| 458 | kCCAlignmentError When decrypting, or when encrypting with a | |
| 459 | block cipher with padding disabled, | |
| 460 | kCCAlignmentError will be returned if the total | |
| 461 | number of bytes provided to CCCryptUpdate() is | |
| 462 | not an integral multiple of the current | |
| 463 | algorithm's block size. | |
| 464 | kCCDecodeError Indicates garbled ciphertext or the | |
| 465 | wrong key during decryption. This can only | |
| 466 | be returned while decrypting with padding | |
| 467 | enabled. | |
| 468 | ||
| 469 | @discussion Except when kCCBufferTooSmall is returned, the CCCryptorRef | |
| 470 | can no longer be used for subsequent operations unless | |
| 471 | CCCryptorReset() is called on it. | |
| 472 | ||
| 473 | It is not necessary to call CCCryptorFinal() when performing | |
| 474 | symmetric encryption or decryption if padding is disabled, or | |
| 475 | when using a stream cipher. | |
| 476 | ||
| 477 | It is not necessary to call CCCryptorFinal() prior to | |
| 478 | CCCryptorRelease() when aborting an operation. | |
| 479 | */ | |
| 480 | CCCryptorStatus CCCryptorFinal( | |
| 481 | CCCryptorRef cryptorRef, | |
| 482 | void *dataOut, | |
| 483 | size_t dataOutAvailable, | |
| 484 | size_t *dataOutMoved) /* number of bytes written */ | |
| 485 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 486 | ||
| 487 | /*! | |
| 488 | @function CCCryptorGetOutputLength | |
| 489 | @abstract Determine output buffer size required to process a given input | |
| 490 | 		size. | |
| 491 | ||
| 492 | @param cryptorRef A CCCryptorRef created via CCCryptorCreate() or | |
| 493 | CCCryptorCreateFromData(). | |
| 494 | @param inputLength The length of data which will be provided to | |
| 495 | CCCryptorUpdate(). | |
| 496 | @param final If false, the returned value will indicate the | |
| 497 | 			 output buffer space needed when 'inputLength' | |
| 498 | 			 bytes are provided to CCCryptorUpdate(). When | |
| 499 | 			 'final' is true, the returned value will indicate | |
| 500 | 			 the total combined buffer space needed when | |
| 501 | 			 'inputLength' bytes are provided to | |
| 502 | 			 CCCryptorUpdate() and then CCCryptorFinal() is | |
| 503 | 			 called. | |
| 504 | ||
| 505 | @result The maximum buffer space need to perform CCCryptorUpdate() and | |
| 506 | 	 optionally CCCryptorFinal(). | |
| 507 | ||
| 508 | @discussion Some general rules apply that allow clients of this module to | |
| 509 | know a priori how much output buffer space will be required | |
| 510 | in a given situation. For stream ciphers, the output size is | |
| 511 | always equal to the input size, and CCCryptorFinal() never | |
| 512 | produces any data. For block ciphers, the output size will | |
| 513 | always be less than or equal to the input size plus the size | |
| 514 | of one block. For block ciphers, if the input size provided | |
| 515 | to each call to CCCryptorUpdate() is is an integral multiple | |
| 516 | of the block size, then the output size for each call to | |
| 517 | CCCryptorUpdate() is less than or equal to the input size | |
| 518 | for that call to CCCryptorUpdate(). CCCryptorFinal() only | |
| 519 | produces output when using a block cipher with padding enabled. | |
| 520 | */ | |
| 521 | size_t CCCryptorGetOutputLength( | |
| 522 | CCCryptorRef cryptorRef, | |
| 523 | size_t inputLength, | |
| 524 | bool final) | |
| 525 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 526 | ||
| 527 | ||
| 528 | /*! | |
| 529 | @function CCCryptorReset | |
| 530 | @abstract Reinitializes an existing CCCryptorRef with a (possibly) | |
| 531 | new initialization vector. The CCCryptorRef's key is | |
| 532 | unchanged. Use only for CBC and CTR modes. | |
| 533 | ||
| 534 | @param cryptorRef A CCCryptorRef created via CCCryptorCreate() or | |
| 535 | CCCryptorCreateFromData(). | |
| 536 | @param iv Optional initialization vector; if present, must | |
| 537 | be the same size as the current algorithm's block | |
| 538 | size. For sound encryption, always initialize iv with | |
| 539 | random data. | |
| 540 | ||
| 541 | @result The only possible errors are kCCParamError and | |
| 542 | kCCUnimplemented. On macOS 10.13, iOS 11, watchOS 4 and tvOS 11 returns kCCUnimplemented | |
| 543 | for modes other than CBC. On prior SDKs, returns kCCSuccess to preserve compatibility | |
| 544 | ||
| 545 | @discussion This can be called on a CCCryptorRef with data pending (i.e. | |
| 546 | in a padded mode operation before CCCryptFinal is called); | |
| 547 | however any pending data will be lost in that case. | |
| 548 | */ | |
| 549 | CCCryptorStatus CCCryptorReset( | |
| 550 | CCCryptorRef cryptorRef, | |
| 551 | const void *iv) | |
| 552 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 553 | ||
| 554 | ||
| 555 | /*! | |
| 556 | @function CCCrypt | |
| 557 | @abstract Stateless, one-shot encrypt or decrypt operation. | |
| 558 | This basically performs a sequence of CCCrytorCreate(), | |
| 559 | CCCryptorUpdate(), CCCryptorFinal(), and CCCryptorRelease(). | |
| 560 | ||
| 561 | @param alg Defines the encryption algorithm. | |
| 562 | ||
| 563 | ||
| 564 | @param op Defines the basic operation: kCCEncrypt or | |
| 565 | 				kCCDecrypt. | |
| 566 | ||
| 567 | @param options A word of flags defining options. See discussion | |
| 568 | for the CCOptions type. | |
| 569 | ||
| 570 | @param key Raw key material, length keyLength bytes. | |
| 571 | ||
| 572 | @param keyLength Length of key material. Must be appropriate | |
| 573 | for the select algorithm. Some algorithms may | |
| 574 | provide for varying key lengths. | |
| 575 | ||
| 576 | @param iv Initialization vector, optional. Used for | |
| 577 | Cipher Block Chaining (CBC) mode. If present, | |
| 578 | must be the same length as the selected | |
| 579 | algorithm's block size. If CBC mode is | |
| 580 | selected (by the absence of any mode bits in | |
| 581 | the options flags) and no IV is present, a | |
| 582 | NULL (all zeroes) IV will be used. This is | |
| 583 | ignored if ECB mode is used or if a stream | |
| 584 | cipher algorithm is selected. For sound encryption, | |
| 585 | always initialize IV with random data. | |
| 586 | ||
| 587 | @param dataIn Data to encrypt or decrypt, length dataInLength | |
| 588 | bytes. | |
| 589 | ||
| 590 | @param dataInLength Length of data to encrypt or decrypt. | |
| 591 | ||
| 592 | @param dataOut Result is written here. Allocated by caller. | |
| 593 | Encryption and decryption can be performed | |
| 594 | "in-place", with the same buffer used for | |
| 595 | input and output. | |
| 596 | ||
| 597 | @param dataOutAvailable The size of the dataOut buffer in bytes. | |
| 598 | ||
| 599 | @param dataOutMoved On successful return, the number of bytes | |
| 600 | 				written to dataOut. If kCCBufferTooSmall is | |
| 601 | 				returned as a result of insufficient buffer | |
| 602 | 				space being provided, the required buffer space | |
| 603 | 				is returned here. | |
| 604 | ||
| 605 | @result kCCBufferTooSmall indicates insufficent space in the dataOut | |
| 606 | buffer. In this case, the *dataOutMoved | |
| 607 | parameter will indicate the size of the buffer | |
| 608 | needed to complete the operation. The | |
| 609 | operation can be retried with minimal runtime | |
| 610 | penalty. | |
| 611 | kCCAlignmentError indicates that dataInLength was not properly | |
| 612 | aligned. This can only be returned for block | |
| 613 | ciphers, and then only when decrypting or when | |
| 614 | encrypting with block with padding disabled. | |
| 615 | kCCDecodeError Indicates improperly formatted ciphertext or | |
| 616 | a "wrong key" error; occurs only during decrypt | |
| 617 | operations. | |
| 618 | */ | |
| 619 | ||
| 620 | CCCryptorStatus CCCrypt( | |
| 621 | CCOperation op, /* kCCEncrypt, etc. */ | |
| 622 | CCAlgorithm alg, /* kCCAlgorithmAES128, etc. */ | |
| 623 | CCOptions options, /* kCCOptionPKCS7Padding, etc. */ | |
| 624 | const void *key, | |
| 625 | size_t keyLength, | |
| 626 | const void *iv, /* optional initialization vector */ | |
| 627 | const void *dataIn, /* optional per op and alg */ | |
| 628 | size_t dataInLength, | |
| 629 | void *dataOut, /* data RETURNED here */ | |
| 630 | size_t dataOutAvailable, | |
| 631 | size_t *dataOutMoved) | |
| 632 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 633 | ||
| 634 | ||
| 635 | /*! | |
| 636 | @enum Cipher Modes | |
| 637 | @discussion These are the selections available for modes of operation for | |
| 638 | 				use with block ciphers. If RC4 is selected as the cipher (a stream | |
| 639 | 				cipher) the only correct mode is kCCModeRC4. | |
| 640 | ||
| 641 | @constant kCCModeECB - Electronic Code Book Mode. | |
| 642 | @constant kCCModeCBC - Cipher Block Chaining Mode. | |
| 643 | @constant kCCModeCFB - Cipher Feedback Mode. | |
| 644 | @constant kCCModeOFB - Output Feedback Mode. | |
| 645 | @constant kCCModeRC4 - RC4 as a streaming cipher is handled internally as a mode. | |
| 646 | @constant kCCModeCFB8 - Cipher Feedback Mode producing 8 bits per round. | |
| 647 | */ | |
| 648 | ||
| 649 | ||
| 650 | enum { | |
| 651 | 	kCCModeECB		= 1, | |
| 652 | 	kCCModeCBC		= 2, | |
| 653 | 	kCCModeCFB		= 3, | |
| 654 | 	kCCModeCTR		= 4, | |
| 655 | 	kCCModeOFB		= 7, | |
| 656 | 	kCCModeRC4		= 9, | |
| 657 | 	kCCModeCFB8		= 10, | |
| 658 | }; | |
| 659 | typedef uint32_t CCMode; | |
| 660 | ||
| 661 | /*! | |
| 662 | @enum Padding for Block Ciphers | |
| 663 | @discussion These are the padding options available for block modes. | |
| 664 | ||
| 665 | @constant ccNoPadding - No padding. | |
| 666 | @constant ccPKCS7Padding - PKCS7 Padding. | |
| 667 | */ | |
| 668 | ||
| 669 | enum { | |
| 670 | 	ccNoPadding			= 0, | |
| 671 | 	ccPKCS7Padding		= 1, | |
| 672 | }; | |
| 673 | typedef uint32_t CCPadding; | |
| 674 | ||
| 675 | /*! | |
| 676 | @enum Mode options - Not currently in use. | |
| 677 | ||
| 678 | @discussion Values used to specify options for modes. This was used for counter | |
| 679 | mode operations in 10.8, now only Big Endian mode is supported. | |
| 680 | ||
| 681 | @constant kCCModeOptionCTR_BE - CTR Mode Big Endian. | |
| 682 | */ | |
| 683 | ||
| 684 | enum { | |
| 685 | kCCModeOptionCTR_BE = 2 | |
| 686 | }; | |
| 687 | ||
| 688 | typedef uint32_t CCModeOptions; | |
| 689 | ||
| 690 | /*! | |
| 691 | @function CCCryptorCreateWithMode | |
| 692 | @abstract Create a cryptographic context. | |
| 693 | ||
| 694 | @param op Defines the basic operation: kCCEncrypt or | |
| 695 | kCCDecrypt. | |
| 696 | ||
| 697 | @param mode		Specifies the cipher mode to use for operations. | |
| 698 | ||
| 699 | @param alg Defines the algorithm. | |
| 700 | ||
| 701 | @param		padding		Specifies the padding to use. | |
| 702 | ||
| 703 | @param iv Initialization vector, optional. Used by | |
| 704 | block ciphers with the following modes: | |
| 705 | ||
| 706 | Cipher Block Chaining (CBC) | |
| 707 | Cipher Feedback (CFB and CFB8) | |
| 708 | Output Feedback (OFB) | |
| 709 | Counter (CTR) | |
| 710 | ||
| 711 | If present, must be the same length as the selected | |
| 712 | algorithm's block size. If no IV is present, a NULL | |
| 713 | (all zeroes) IV will be used. For sound encryption, | |
| 714 | always initialize iv with random data. | |
| 715 | ||
| 716 | This parameter is ignored if ECB mode is used or | |
| 717 | if a stream cipher algorithm is selected. | |
| 718 | ||
| 719 | @param key Raw key material, length keyLength bytes. | |
| 720 | ||
| 721 | @param keyLength Length of key material. Must be appropriate | |
| 722 | for the selected operation and algorithm. Some | |
| 723 | algorithms provide for varying key lengths. | |
| 724 | ||
| 725 | @param tweak Raw key material, length keyLength bytes. Used for the | |
| 726 | tweak key in XEX-based Tweaked CodeBook (XTS) mode. | |
| 727 | ||
| 728 | @param tweakLength Length of tweak key material. Must be appropriate | |
| 729 | for the selected operation and algorithm. Some | |
| 730 | algorithms provide for varying key lengths. For XTS | |
| 731 | this is the same length as the encryption key. | |
| 732 | ||
| 733 | @param		numRounds	The number of rounds of the cipher to use. 0 uses the default. | |
| 734 | ||
| 735 | @param options A word of flags defining options. See discussion | |
| 736 | for the CCModeOptions type. | |
| 737 | ||
| 738 | @param cryptorRef A (required) pointer to the returned CCCryptorRef. | |
| 739 | ||
| 740 | @result Possible error returns are kCCParamError and kCCMemoryFailure. | |
| 741 | */ | |
| 742 | ||
| 743 | ||
| 744 | CCCryptorStatus CCCryptorCreateWithMode( | |
| 745 | CCOperation 	op,				/* kCCEncrypt, kCCDecrypt */ | |
| 746 | CCMode			mode, | |
| 747 | CCAlgorithm		alg, | |
| 748 | CCPadding		padding, | |
| 749 | const void 		*iv,			/* optional initialization vector */ | |
| 750 | const void 		*key,			/* raw key material */ | |
| 751 | size_t 			keyLength, | |
| 752 | const void 		*tweak,			/* raw tweak material */ | |
| 753 | size_t 			tweakLength, | |
| 754 | int				numRounds,		/* 0 == default */ | |
| 755 | CCModeOptions 	options, | |
| 756 | CCCryptorRef	*cryptorRef)	/* RETURNED */ | |
| 757 | API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 758 | ||
| 759 | #ifdef __cplusplus | |
| 760 | } | |
| 761 | #endif | |
| 762 | ||
| 763 | #endif /* _CC_COMMON_CRYPTOR_ */ |
lib/libc/include/any-macos-any/CommonCrypto/CommonHMAC.h created+162| ... | ... | @@ -0,0 +1,162 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2004 Apple Computer, Inc. All Rights Reserved. | |
| 3 | * | |
| 4 | * @APPLE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. Please obtain a copy of the License at | |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 11 | * file. | |
| 12 | * | |
| 13 | * The Original Code and all software distributed under the License are | |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 18 | * Please see the License for the specific language governing rights and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * @APPLE_LICENSE_HEADER_END@ | |
| 22 | */ | |
| 23 | ||
| 24 | /*! | |
| 25 | @header CommonHMAC.h | |
| 26 | @abstract Keyed Message Authentication Code (HMAC) functions. | |
| 27 | */ | |
| 28 | ||
| 29 | #ifndef _CC_COMMON_HMAC_H_ | |
| 30 | #define _CC_COMMON_HMAC_H_ | |
| 31 | ||
| 32 | #include <CommonCrypto/CommonDigest.h> | |
| 33 | #include <sys/types.h> | |
| 34 | ||
| 35 | #ifdef __cplusplus | |
| 36 | extern "C" { | |
| 37 | #endif | |
| 38 | ||
| 39 | /*! | |
| 40 | @enum CCHmacAlgorithm | |
| 41 | @abstract Algorithms implemented in this module. | |
| 42 | ||
| 43 | @constant kCCHmacAlgSHA1 HMAC with SHA1 digest | |
| 44 | @constant kCCHmacAlgMD5 HMAC with MD5 digest | |
| 45 | @constant kCCHmacAlgSHA256 HMAC with SHA256 digest | |
| 46 | @constant kCCHmacAlgSHA384 HMAC with SHA384 digest | |
| 47 | @constant kCCHmacAlgSHA512 HMAC with SHA512 digest | |
| 48 | @constant kCCHmacAlgSHA224 HMAC with SHA224 digest | |
| 49 | */ | |
| 50 | enum { | |
| 51 | kCCHmacAlgSHA1, | |
| 52 | kCCHmacAlgMD5, | |
| 53 | kCCHmacAlgSHA256, | |
| 54 | kCCHmacAlgSHA384, | |
| 55 | kCCHmacAlgSHA512, | |
| 56 | kCCHmacAlgSHA224 | |
| 57 | }; | |
| 58 | typedef uint32_t CCHmacAlgorithm; | |
| 59 | ||
| 60 | /*! | |
| 61 | @typedef CCHmacContext | |
| 62 | @abstract HMAC context. | |
| 63 | */ | |
| 64 | #define CC_HMAC_CONTEXT_SIZE 96 | |
| 65 | typedef struct { | |
| 66 | uint32_t ctx[CC_HMAC_CONTEXT_SIZE]; | |
| 67 | } CCHmacContext; | |
| 68 | ||
| 69 | /*! | |
| 70 | @function CCHmacInit | |
| 71 | @abstract Initialize an CCHmacContext with provided raw key bytes. | |
| 72 | ||
| 73 | @param ctx An HMAC context. | |
| 74 | @param algorithm HMAC algorithm to perform. | |
| 75 | @param key Raw key bytes. | |
| 76 | @param keyLength Length of raw key bytes; can be any | |
| 77 | length including zero. | |
| 78 | */ | |
| 79 | void CCHmacInit( | |
| 80 | CCHmacContext *ctx, | |
| 81 | CCHmacAlgorithm algorithm, | |
| 82 | const void *key, | |
| 83 | size_t keyLength) | |
| 84 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 85 | ||
| 86 | ||
| 87 | /*! | |
| 88 | @function CCHmacUpdate | |
| 89 | @abstract Process some data. | |
| 90 | ||
| 91 | @param ctx An HMAC context. | |
| 92 | @param data Data to process. | |
| 93 | @param dataLength Length of data to process, in bytes. | |
| 94 | ||
| 95 | @discussion This can be called multiple times. | |
| 96 | */ | |
| 97 | void CCHmacUpdate( | |
| 98 | CCHmacContext *ctx, | |
| 99 | const void *data, | |
| 100 | size_t dataLength) | |
| 101 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 102 | ||
| 103 | ||
| 104 | /*! | |
| 105 | @function CCHmacFinal | |
| 106 | @abstract Obtain the final Message Authentication Code. | |
| 107 | ||
| 108 | @param ctx An HMAC context. | |
| 109 | @param macOut Destination of MAC; allocated by caller. | |
| 110 | ||
| 111 | @discussion The length of the MAC written to *macOut is the same as | |
| 112 | the digest length associated with the HMAC algorithm: | |
| 113 | ||
| 114 | kCCHmacAlgSHA1 : CC_SHA1_DIGEST_LENGTH | |
| 115 | kCCHmacAlgSHA256 : CC_SHA256_DIGEST_LENGTH | |
| 116 | ||
| 117 | The MAC must be verified by comparing the computed and expected values | |
| 118 | using timingsafe_bcmp. Other comparison functions (e.g. memcmp) | |
| 119 | must not be used as they may be vulnerable to practical timing attacks, | |
| 120 | leading to MAC forgery. | |
| 121 | */ | |
| 122 | void CCHmacFinal( | |
| 123 | CCHmacContext *ctx, | |
| 124 | void *macOut) | |
| 125 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 126 | ||
| 127 | /*! | |
| 128 | @function CCHmac | |
| 129 | @abstract Stateless, one-shot HMAC function | |
| 130 | ||
| 131 | @param algorithm HMAC algorithm to perform. | |
| 132 | @param key Raw key bytes. | |
| 133 | @param keyLength Length of raw key bytes; can be any | |
| 134 | length including zero. | |
| 135 | @param data Data to process. | |
| 136 | @param dataLength Length of data to process, in bytes. | |
| 137 | @param macOut Destination of MAC; allocated by caller. | |
| 138 | ||
| 139 | @discussion The length of the MAC written to *macOut is the same as the digest length associated with the HMAC algorithm: | |
| 140 | kCCHmacAlgSHA1 : CC_SHA1_DIGEST_LENGTH | |
| 141 | kCCHmacAlgSHA256 : CC_SHA256_DIGEST_LENGTH | |
| 142 | ||
| 143 | The MAC must be verified by comparing the computed and expected values | |
| 144 | using timingsafe_bcmp. Other comparison functions (e.g. memcmp) | |
| 145 | must not be used as they may be vulnerable to practical timing attacks, | |
| 146 | leading to MAC forgery. | |
| 147 | */ | |
| 148 | ||
| 149 | void CCHmac( | |
| 150 | CCHmacAlgorithm algorithm, /* kCCHmacAlgSHA256, kCCHmacAlgSHA1 */ | |
| 151 | const void *key, | |
| 152 | size_t keyLength, /* length of key in bytes */ | |
| 153 | const void *data, | |
| 154 | size_t dataLength, /* length of data in bytes */ | |
| 155 | void *macOut) /* MAC written here */ | |
| 156 | API_AVAILABLE(macos(10.4), ios(2.0)); | |
| 157 | ||
| 158 | #ifdef __cplusplus | |
| 159 | } | |
| 160 | #endif | |
| 161 | ||
| 162 | #endif /* _CC_COMMON_HMAC_H_ */ |
lib/libc/include/any-macos-any/CommonCrypto/CommonKeyDerivation.h created+136| ... | ... | @@ -0,0 +1,136 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2010 Apple Inc. All Rights Reserved. | |
| 3 | * | |
| 4 | * @APPLE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. Please obtain a copy of the License at | |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 11 | * file. | |
| 12 | * | |
| 13 | * The Original Code and all software distributed under the License are | |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 18 | * Please see the License for the specific language governing rights and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * @APPLE_LICENSE_HEADER_END@ | |
| 22 | */ | |
| 23 | ||
| 24 | #ifndef _CC_PBKDF_H_ | |
| 25 | #define _CC_PBKDF_H_ | |
| 26 | ||
| 27 | #include <string.h> | |
| 28 | #include <limits.h> | |
| 29 | #include <stdlib.h> | |
| 30 | #include <CommonCrypto/CommonDigest.h> | |
| 31 | #include <CommonCrypto/CommonHMAC.h> | |
| 32 | ||
| 33 | ||
| 34 | #ifdef __cplusplus | |
| 35 | extern "C" { | |
| 36 | #endif | |
| 37 | ||
| 38 | enum { | |
| 39 | kCCPBKDF2 = 2, | |
| 40 | }; | |
| 41 | ||
| 42 | ||
| 43 | typedef uint32_t CCPBKDFAlgorithm; | |
| 44 | ||
| 45 | ||
| 46 | enum { | |
| 47 | kCCPRFHmacAlgSHA1 = 1, | |
| 48 | kCCPRFHmacAlgSHA224 = 2, | |
| 49 | kCCPRFHmacAlgSHA256 = 3, | |
| 50 | kCCPRFHmacAlgSHA384 = 4, | |
| 51 | kCCPRFHmacAlgSHA512 = 5, | |
| 52 | }; | |
| 53 | ||
| 54 | ||
| 55 | typedef uint32_t CCPseudoRandomAlgorithm; | |
| 56 | ||
| 57 | /* | |
| 58 | ||
| 59 | @function CCKeyDerivationPBKDF | |
| 60 | @abstract Derive a key from a text password/passphrase | |
| 61 | ||
| 62 | @param algorithm Currently only PBKDF2 is available via kCCPBKDF2 | |
| 63 | @param password The text password used as input to the derivation | |
| 64 | function. The actual octets present in this string | |
| 65 | will be used with no additional processing. It's | |
| 66 | extremely important that the same encoding and | |
| 67 | normalization be used each time this routine is | |
| 68 | called if the same key is expected to be derived. | |
| 69 | @param passwordLen The length of the text password in bytes. | |
| 70 | @param salt The salt byte values used as input to the derivation | |
| 71 | function. The pointer can be NULL, only when saltLen is zero. | |
| 72 | @param saltLen The length of the salt in bytes. It can be zero. | |
| 73 | @param prf The Pseudo Random Algorithm to use for the derivation | |
| 74 | iterations. | |
| 75 | @param rounds The number of rounds of the Pseudo Random Algorithm | |
| 76 | to use. It cannot be zero. | |
| 77 | @param derivedKey The resulting derived key produced by the function. | |
| 78 | The space for this must be provided by the caller. | |
| 79 | @param derivedKeyLen The expected length of the derived key in bytes. It cannot be zero. | |
| 80 | ||
| 81 | @discussion The following values are used to designate the PRF: | |
| 82 | ||
| 83 | * kCCPRFHmacAlgSHA1 | |
| 84 | * kCCPRFHmacAlgSHA224 | |
| 85 | * kCCPRFHmacAlgSHA256 | |
| 86 | * kCCPRFHmacAlgSHA384 | |
| 87 | * kCCPRFHmacAlgSHA512 | |
| 88 | ||
| 89 | @result kCCParamError can result from bad values for the password, salt, | |
| 90 | 	 and unwrapped key pointers as well as a bad value for the prf | |
| 91 | 	 function. | |
| 92 | ||
| 93 | */ | |
| 94 | ||
| 95 | int | |
| 96 | CCKeyDerivationPBKDF( CCPBKDFAlgorithm algorithm, const char *password, size_t passwordLen, | |
| 97 | const uint8_t *salt, size_t saltLen, | |
| 98 | CCPseudoRandomAlgorithm prf, unsigned rounds, | |
| 99 | uint8_t *derivedKey, size_t derivedKeyLen) | |
| 100 | API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 101 | ||
| 102 | /* | |
| 103 | * All lengths are in bytes - not bits. | |
| 104 | */ | |
| 105 | ||
| 106 | /* | |
| 107 | ||
| 108 | @function CCCalibratePBKDF | |
| 109 | @abstract Determine the number of PRF rounds to use for a specific delay on | |
| 110 | the current platform. | |
| 111 | @param algorithm Currently only PBKDF2 is available via kCCPBKDF2 | |
| 112 | @param passwordLen The length of the text password in bytes. | |
| 113 | @param saltLen The length of the salt in bytes. saltlen must be smaller than 133. | |
| 114 | @param prf The Pseudo Random Algorithm to use for the derivation | |
| 115 | iterations. | |
| 116 | @param derivedKeyLen The expected length of the derived key in bytes. | |
| 117 | @param msec The targetted duration we want to achieve for a key | |
| 118 | derivation with these parameters. | |
| 119 | ||
| 120 | @result the number of iterations to use for the desired processing time. | |
| 121 | Returns a minimum of 10000 iterations (safety net, not a particularly recommended value) | |
| 122 | The number of iterations is a trade-off of usability and security. If there is an error | |
| 123 | the function returns (unsigned)(-1). The minimum return value is set to 10000. | |
| 124 | ||
| 125 | */ | |
| 126 | ||
| 127 | unsigned | |
| 128 | CCCalibratePBKDF(CCPBKDFAlgorithm algorithm, size_t passwordLen, size_t saltLen, | |
| 129 | CCPseudoRandomAlgorithm prf, size_t derivedKeyLen, uint32_t msec) | |
| 130 | API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 131 | ||
| 132 | #ifdef __cplusplus | |
| 133 | } | |
| 134 | #endif | |
| 135 | ||
| 136 | #endif /* _CC_PBKDF_H_ */ |
lib/libc/include/any-macos-any/CommonCrypto/CommonRandom.h created+63| ... | ... | @@ -0,0 +1,63 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2014 Apple Inc. All Rights Reserved. | |
| 3 | * | |
| 4 | * @APPLE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. Please obtain a copy of the License at | |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 11 | * file. | |
| 12 | * | |
| 13 | * The Original Code and all software distributed under the License are | |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 18 | * Please see the License for the specific language governing rights and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * @APPLE_LICENSE_HEADER_END@ | |
| 22 | */ | |
| 23 | ||
| 24 | // | |
| 25 | // CommonRandom.h | |
| 26 | // CommonCrypto | |
| 27 | ||
| 28 | #ifndef CommonCrypto_CommonRandom_h | |
| 29 | #define CommonCrypto_CommonRandom_h | |
| 30 | ||
| 31 | #include <sys/types.h> | |
| 32 | #include <os/availability.h> | |
| 33 | ||
| 34 | #include <CommonCrypto/CommonCryptoError.h> | |
| 35 | ||
| 36 | #if defined(__cplusplus) | |
| 37 | extern "C" { | |
| 38 | #endif | |
| 39 | ||
| 40 | typedef CCCryptorStatus CCRNGStatus; | |
| 41 | ||
| 42 | /*! | |
| 43 | @function CCRandomGenerateBytes | |
| 44 | ||
| 45 | @abstract Return random bytes in a buffer allocated by the caller. | |
| 46 | ||
| 47 | @discussion The PRNG returns cryptographically strong random | |
| 48 | bits suitable for use as cryptographic keys, IVs, nonces etc. | |
| 49 | ||
| 50 | @param bytes Pointer to the return buffer. | |
| 51 | @param count Number of random bytes to return. | |
| 52 | ||
| 53 | @result Return kCCSuccess on success. | |
| 54 | */ | |
| 55 | ||
| 56 | CCRNGStatus CCRandomGenerateBytes(void *bytes, size_t count) | |
| 57 | API_AVAILABLE(macos(10.10), ios(8.0)); | |
| 58 | ||
| 59 | #if defined(__cplusplus) | |
| 60 | } | |
| 61 | #endif | |
| 62 | ||
| 63 | #endif |
lib/libc/include/any-macos-any/CommonCrypto/CommonSymmetricKeywrap.h created+162| ... | ... | @@ -0,0 +1,162 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2010 Apple Inc. All Rights Reserved. | |
| 3 | * | |
| 4 | * @APPLE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. Please obtain a copy of the License at | |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 11 | * file. | |
| 12 | * | |
| 13 | * The Original Code and all software distributed under the License are | |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 18 | * Please see the License for the specific language governing rights and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * @APPLE_LICENSE_HEADER_END@ | |
| 22 | */ | |
| 23 | ||
| 24 | #ifndef _CC_SYMKEYWRAP_H_ | |
| 25 | #define _CC_SYMKEYWRAP_H_ | |
| 26 | ||
| 27 | #include <sys/types.h> | |
| 28 | #include <stdint.h> | |
| 29 | ||
| 30 | #include <string.h> | |
| 31 | #include <limits.h> | |
| 32 | #include <stdlib.h> | |
| 33 | ||
| 34 | #if defined(_MSC_VER) | |
| 35 | #include <availability.h> | |
| 36 | #else | |
| 37 | #include <os/availability.h> | |
| 38 | #endif | |
| 39 | ||
| 40 | ||
| 41 | #ifdef __cplusplus | |
| 42 | extern "C" { | |
| 43 | #endif | |
| 44 | ||
| 45 | enum { | |
| 46 | kCCWRAPAES = 1, | |
| 47 | }; | |
| 48 | ||
| 49 | extern const uint8_t * const CCrfc3394_iv API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 50 | extern const size_t CCrfc3394_ivLen API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 51 | ||
| 52 | typedef uint32_t CCWrappingAlgorithm; | |
| 53 | ||
| 54 | /*! | |
| 55 | @function CCSymmetricKeyWrap | |
| 56 | @abstract Wrap a symmetric key with a Key Encryption Key (KEK). | |
| 57 | ||
| 58 | @param algorithm Currently only AES Keywrapping (rfc3394) is available | |
| 59 | via kCCWRAPAES | |
| 60 | @param iv The initialization value to be used. CCrfc3394_iv is | |
| 61 | available as a constant for the standard IV to use. | |
| 62 | @param ivLen The length of the initialization value to be used. | |
| 63 | CCrfc3394_ivLen is available as a constant for the | |
| 64 | standard IV to use. | |
| 65 | @param kek The Key Encryption Key to be used to wrap the raw key. | |
| 66 | @param kekLen The length of the KEK in bytes. | |
| 67 | @param rawKey The raw key bytes to be wrapped. | |
| 68 | @param rawKeyLen The length of the key in bytes. | |
| 69 | @param wrappedKey The resulting wrapped key produced by the function. | |
| 70 | The space for this must be provided by the caller. | |
| 71 | @param wrappedKeyLen The length of the wrapped key in bytes. | |
| 72 | ||
| 73 | @discussion The algorithm chosen is determined by the algorithm parameter | |
| 74 | and the size of the key being wrapped (ie aes128 for 128 bit | |
| 75 | keys). | |
| 76 | ||
| 77 | @result kCCBufferTooSmall indicates insufficent space in the wrappedKey | |
| 78 | buffer. | |
| 79 | kCCParamError can result from bad values for the kek, rawKey, and | |
| 80 | wrappedKey key pointers. | |
| 81 | */ | |
| 82 | ||
| 83 | int | |
| 84 | CCSymmetricKeyWrap(CCWrappingAlgorithm algorithm, | |
| 85 | const uint8_t *iv, const size_t ivLen, | |
| 86 | const uint8_t *kek, size_t kekLen, | |
| 87 | const uint8_t *rawKey, size_t rawKeyLen, | |
| 88 | uint8_t *wrappedKey, size_t *wrappedKeyLen) | |
| 89 | API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 90 | ||
| 91 | /*! | |
| 92 | @function CCSymmetricKeyUnwrap | |
| 93 | @abstract Unwrap a symmetric key with a Key Encryption Key (KEK). | |
| 94 | ||
| 95 | @param algorithm Currently only AES Keywrapping (rfc3394) is available | |
| 96 | via kCCWRAPAES | |
| 97 | @param iv The initialization value to be used. CCrfc3394_iv is | |
| 98 | available as a constant for the standard IV to use. | |
| 99 | @param ivLen The length of the initialization value to be used. | |
| 100 | CCrfc3394_ivLen is available as a constant for the | |
| 101 | standard IV to use. | |
| 102 | @param kek The Key Encryption Key to be used to unwrap the raw key. | |
| 103 | @param kekLen The length of the KEK in bytes. | |
| 104 | @param wrappedKey The wrapped key bytes. | |
| 105 | @param wrappedKeyLen The length of the wrapped key in bytes. | |
| 106 | @param rawKey The resulting raw key bytes. The space for this must | |
| 107 | be provided by the caller. | |
| 108 | @param rawKeyLen The length of the raw key in bytes. | |
| 109 | ||
| 110 | @discussion The algorithm chosen is determined by the algorithm parameter | |
| 111 | and the size of the key being wrapped (ie aes128 for 128 bit | |
| 112 | keys). | |
| 113 | ||
| 114 | @result kCCBufferTooSmall indicates insufficent space in the rawKey buffer. | |
| 115 | kCCParamError can result from bad values for the kek, rawKey, and | |
| 116 | wrappedKey key pointers. | |
| 117 | */ | |
| 118 | ||
| 119 | ||
| 120 | int | |
| 121 | CCSymmetricKeyUnwrap(CCWrappingAlgorithm algorithm, | |
| 122 | const uint8_t *iv, const size_t ivLen, | |
| 123 | const uint8_t *kek, size_t kekLen, | |
| 124 | const uint8_t *wrappedKey, size_t wrappedKeyLen, | |
| 125 | uint8_t *rawKey, size_t *rawKeyLen) | |
| 126 | API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 127 | ||
| 128 | /*! | |
| 129 | @function CCSymmetricWrappedSize | |
| 130 | @abstract Determine the buffer size required to hold a key wrapped with | |
| 131 | CCAESKeyWrap(). | |
| 132 | ||
| 133 | @param algorithm Currently only AES Keywrapping (rfc3394) is | |
| 134 | available via kCCWRAPAES | |
| 135 | @param rawKeyLen The length of the key in bytes. | |
| 136 | @result The length of the resulting wrapped key. | |
| 137 | */ | |
| 138 | ||
| 139 | size_t | |
| 140 | CCSymmetricWrappedSize(CCWrappingAlgorithm algorithm, size_t rawKeyLen) | |
| 141 | API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 142 | ||
| 143 | /*! | |
| 144 | @function CCSymmetricUnwrappedSize | |
| 145 | @abstract Determine the buffer size required to hold a key unwrapped with | |
| 146 | CCAESKeyUnwrap(). | |
| 147 | ||
| 148 | @param algorithm Currently only AES Keywrapping (rfc3394) is | |
| 149 | available via kCCWRAPAES | |
| 150 | @param wrappedKeyLen The length of the wrapped key in bytes. | |
| 151 | @result The length of the resulting raw key. | |
| 152 | */ | |
| 153 | ||
| 154 | size_t | |
| 155 | CCSymmetricUnwrappedSize(CCWrappingAlgorithm algorithm, size_t wrappedKeyLen) | |
| 156 | API_AVAILABLE(macos(10.7), ios(5.0)); | |
| 157 | ||
| 158 | #ifdef __cplusplus | |
| 159 | } | |
| 160 | #endif | |
| 161 | ||
| 162 | #endif /* _CC_SYMKEYWRAP_H_ */ |
lib/libc/include/any-macos-any/mach-o/getsect.h created+151| ... | ... | @@ -0,0 +1,151 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. | |
| 3 | * | |
| 4 | * @APPLE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. Please obtain a copy of the License at | |
| 10 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
| 11 | * file. | |
| 12 | * | |
| 13 | * The Original Code and all software distributed under the License are | |
| 14 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 15 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 16 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 17 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 18 | * Please see the License for the specific language governing rights and | |
| 19 | * limitations under the License. | |
| 20 | * | |
| 21 | * @APPLE_LICENSE_HEADER_END@ | |
| 22 | */ | |
| 23 | #ifndef _MACH_O_GETSECT_H_ | |
| 24 | #define _MACH_O_GETSECT_H_ | |
| 25 | ||
| 26 | #include <stdint.h> | |
| 27 | #include <mach-o/loader.h> | |
| 28 | #include <Availability.h> | |
| 29 | #include <TargetConditionals.h> | |
| 30 | ||
| 31 | #ifndef __CCTOOLS_DEPRECATED | |
| 32 | #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)) | |
| 33 | #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)) | |
| 34 | #endif | |
| 35 | ||
| 36 | ||
| 37 | #ifdef __cplusplus | |
| 38 | extern "C" { | |
| 39 | #endif /* __cplusplus */ | |
| 40 | ||
| 41 | /* | |
| 42 | * Runtime interfaces for Mach-O programs. For both 32-bit and 64-bit programs, | |
| 43 | * where the sizes returned will be 32-bit or 64-bit based on the size of | |
| 44 | * 'unsigned long'. | |
| 45 | */ | |
| 46 | extern char *getsectdata( | |
| 47 | const char *segname, | |
| 48 | const char *sectname, | |
| 49 | unsigned long *size) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()"); | |
| 50 | ||
| 51 | extern char *getsectdatafromFramework( | |
| 52 | const char *FrameworkName, | |
| 53 | const char *segname, | |
| 54 | const char *sectname, | |
| 55 | unsigned long *size) __CCTOOLS_DEPRECATED; | |
| 56 | ||
| 57 | extern unsigned long get_end(void) __CCTOOLS_DEPRECATED; | |
| 58 | extern unsigned long get_etext(void) __CCTOOLS_DEPRECATED; | |
| 59 | extern unsigned long get_edata(void) __CCTOOLS_DEPRECATED; | |
| 60 | ||
| 61 | #ifndef __LP64__ | |
| 62 | /* | |
| 63 | * Runtime interfaces for 32-bit Mach-O programs. | |
| 64 | */ | |
| 65 | extern const struct section *getsectbyname( | |
| 66 | const char *segname, | |
| 67 | const char *sectname) __CCTOOLS_DEPRECATED_MSG("use getsectiondata(&__dso_handle,)"); | |
| 68 | ||
| 69 | extern uint8_t *getsectiondata( | |
| 70 | const struct mach_header *mhp, | |
| 71 | const char *segname, | |
| 72 | const char *sectname, | |
| 73 | unsigned long *size); | |
| 74 | ||
| 75 | extern const struct segment_command *getsegbyname( | |
| 76 | const char *segname) __CCTOOLS_DEPRECATED; | |
| 77 | ||
| 78 | extern uint8_t *getsegmentdata( | |
| 79 | const struct mach_header *mhp, | |
| 80 | const char *segname, | |
| 81 | unsigned long *size); | |
| 82 | ||
| 83 | #else /* defined(__LP64__) */ | |
| 84 | /* | |
| 85 | * Runtime interfaces for 64-bit Mach-O programs. | |
| 86 | */ | |
| 87 | extern const struct section_64 *getsectbyname( | |
| 88 | const char *segname, | |
| 89 | const char *sectname); | |
| 90 | ||
| 91 | extern uint8_t *getsectiondata( | |
| 92 | const struct mach_header_64 *mhp, | |
| 93 | const char *segname, | |
| 94 | const char *sectname, | |
| 95 | unsigned long *size); | |
| 96 | ||
| 97 | extern const struct segment_command_64 *getsegbyname( | |
| 98 | const char *segname) __CCTOOLS_DEPRECATED; | |
| 99 | ||
| 100 | extern uint8_t *getsegmentdata( | |
| 101 | const struct mach_header_64 *mhp, | |
| 102 | const char *segname, | |
| 103 | unsigned long *size); | |
| 104 | ||
| 105 | #endif /* defined(__LP64__) */ | |
| 106 | ||
| 107 | /* | |
| 108 | * Interfaces for tools working with 32-bit Mach-O files. | |
| 109 | */ | |
| 110 | extern char *getsectdatafromheader( | |
| 111 | const struct mach_header *mhp, | |
| 112 | const char *segname, | |
| 113 | const char *sectname, | |
| 114 | uint32_t *size) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()"); | |
| 115 | ||
| 116 | extern const struct section *getsectbynamefromheader( | |
| 117 | const struct mach_header *mhp, | |
| 118 | const char *segname, | |
| 119 | const char *sectname) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()"); | |
| 120 | ||
| 121 | extern const struct section *getsectbynamefromheaderwithswap( | |
| 122 | struct mach_header *mhp, | |
| 123 | const char *segname, | |
| 124 | const char *sectname, | |
| 125 | int fSwap) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()"); | |
| 126 | ||
| 127 | /* | |
| 128 | * Interfaces for tools working with 64-bit Mach-O files. | |
| 129 | */ | |
| 130 | extern char *getsectdatafromheader_64( | |
| 131 | const struct mach_header_64 *mhp, | |
| 132 | const char *segname, | |
| 133 | const char *sectname, | |
| 134 | uint64_t *size) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()"); | |
| 135 | ||
| 136 | extern const struct section_64 *getsectbynamefromheader_64( | |
| 137 | const struct mach_header_64 *mhp, | |
| 138 | const char *segname, | |
| 139 | const char *sectname) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()"); | |
| 140 | ||
| 141 | extern const struct section *getsectbynamefromheaderwithswap_64( | |
| 142 | struct mach_header_64 *mhp, | |
| 143 | const char *segname, | |
| 144 | const char *sectname, | |
| 145 | int fSwap) __CCTOOLS_DEPRECATED_MSG("use getsectiondata()"); | |
| 146 | ||
| 147 | #ifdef __cplusplus | |
| 148 | } | |
| 149 | #endif /* __cplusplus */ | |
| 150 | ||
| 151 | #endif /* _MACH_O_GETSECT_H_ */ |
lib/libc/include/any-macos-any/mach/arm/exception.h+2| ... | ... | @@ -72,6 +72,8 @@ |
| 72 | 72 | #define EXC_ARM_SWP 0x104 /* SWP instruction */ |
| 73 | 73 | #define EXC_ARM_PAC_FAIL 0x105 /* PAC authentication failure */ |
| 74 | 74 | |
| 75 | #define EXC_ARM_MTE_TAGCHECK_FAIL 0x106 /* MTE Tag Check failure */ | |
| 76 | #define EXC_ARM_MTE_CANONICAL_FAIL 0x107 /* MTE Canonical Tag access fail */ | |
| 75 | 77 | |
| 76 | 78 | /* |
| 77 | 79 | *	EXC_BREAKPOINT |
lib/libc/include/any-macos-any/mach/exception.h created+62| ... | ... | @@ -0,0 +1,62 @@ |
| 1 | /* | |
| 2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
| 3 | * | |
| 4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
| 5 | * | |
| 6 | * This file contains Original Code and/or Modifications of Original Code | |
| 7 | * as defined in and that are subject to the Apple Public Source License | |
| 8 | * Version 2.0 (the 'License'). You may not use this file except in | |
| 9 | * compliance with the License. The rights granted to you under the License | |
| 10 | * may not be used to create, or enable the creation or redistribution of, | |
| 11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
| 12 | * circumvent, violate, or enable the circumvention or violation of, any | |
| 13 | * terms of an Apple operating system software license agreement. | |
| 14 | * | |
| 15 | * Please obtain a copy of the License at | |
| 16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
| 17 | * | |
| 18 | * The Original Code and all software distributed under the License are | |
| 19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
| 20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
| 21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
| 22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
| 23 | * Please see the License for the specific language governing rights and | |
| 24 | * limitations under the License. | |
| 25 | * | |
| 26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
| 27 | */ | |
| 28 | /* | |
| 29 | * @OSF_COPYRIGHT@ | |
| 30 | */ | |
| 31 | /* | |
| 32 | * Mach Operating System | |
| 33 | * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University | |
| 34 | * All Rights Reserved. | |
| 35 | * | |
| 36 | * Permission to use, copy, modify and distribute this software and its | |
| 37 | * documentation is hereby granted, provided that both the copyright | |
| 38 | * notice and this permission notice appear in all copies of the | |
| 39 | * software, derivative works or modified versions, and any portions | |
| 40 | * thereof, and that both notices appear in supporting documentation. | |
| 41 | * | |
| 42 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | |
| 43 | * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR | |
| 44 | * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | |
| 45 | * | |
| 46 | * Carnegie Mellon requests users of this software to return to | |
| 47 | * | |
| 48 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | |
| 49 | * School of Computer Science | |
| 50 | * Carnegie Mellon University | |
| 51 | * Pittsburgh PA 15213-3890 | |
| 52 | * | |
| 53 | * any improvements or extensions that they make and grant Carnegie Mellon | |
| 54 | * the rights to redistribute these changes. | |
| 55 | */ | |
| 56 | ||
| 57 | #ifndef _MACH_EXCEPTION_H_ | |
| 58 | #define _MACH_EXCEPTION_H_ | |
| 59 | ||
| 60 | #include <mach/exception_types.h> | |
| 61 | ||
| 62 | #endif /* _MACH_EXCEPTION_H_ */ |
lib/libc/include/any-macos-any/mach/machine.h+1| ... | ... | @@ -409,6 +409,7 @@ typedef integer_t cpu_threadtype_t; |
| 409 | 409 | #define CPUFAMILY_ARM_BRAVA 0x17d5b93a |
| 410 | 410 | #define CPUFAMILY_ARM_TAHITI 0x75d4acb9 |
| 411 | 411 | #define CPUFAMILY_ARM_TUPAI 0x204526d0 |
| 412 | #define CPUFAMILY_ARM_HIDRA 0x1d5a87e8 | |
| 412 | 413 | #define CPUFAMILY_ARM_THERA 0xab345f09 |
| 413 | 414 | #define CPUFAMILY_ARM_TILOS 0x01d7a72b |
| 414 | 415 |
lib/libc/include/any-macos-any/mach/port.h+1-1| ... | ... | @@ -487,7 +487,7 @@ enum mach_port_guard_exception_codes { |
| 487 | 487 | 	kGUARD_EXC_MOVE_PROVISIONAL_REPLY_PORT = 0x00100004, |
| 488 | 488 | 	kGUARD_EXC_REPLY_PORT_SINGLE_SO_RIGHT = 0x00100005, |
| 489 | 489 | 	kGUARD_EXC_MOD_REFS_NON_FATAL = 1u << 21, |
| 490 | 	kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22, | |
| 490 | 	kGUARD_EXC_IMMOVABLE_NON_FATAL = 1u << 22, /* unused*/ | |
| 491 | 491 | }; |
| 492 | 492 | |
| 493 | 493 | #define MAX_FATAL_kGUARD_EXC_CODE kGUARD_EXC_MSG_FILTERED |
lib/libc/include/any-macos-any/mach/vm_prot.h-7| ... | ... | @@ -100,13 +100,6 @@ typedef int vm_prot_t; |
| 100 | 100 | |
| 101 | 101 | #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) |
| 102 | 102 | |
| 103 | /* | |
| 104 | *	This is an alias to VM_PROT_EXECUTE to identify callers that | |
| 105 | *	want to allocate an hardware assisted Read-only/read-write | |
| 106 | *	trusted path in userland. | |
| 107 | */ | |
| 108 | #define VM_PROT_RORW_TP (VM_PROT_EXECUTE) | |
| 109 | ||
| 110 | 103 | /* |
| 111 | 104 | *	An invalid protection value. |
| 112 | 105 | *	Used only by memory_object_lock_request to indicate no change |
lib/libc/include/any-macos-any/mach/vm_statistics.h+7-1| ... | ... | @@ -283,6 +283,7 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t; |
| 283 | 283 | #define VM_FLAGS_RESILIENT_MEDIA 0x00000040 |
| 284 | 284 | #define VM_FLAGS_PERMANENT 0x00000080 |
| 285 | 285 | #define VM_FLAGS_TPRO 0x00001000 |
| 286 | #define VM_FLAGS_MTE 0x00002000 | |
| 286 | 287 | #define VM_FLAGS_OVERWRITE 0x00004000 /* delete any existing mappings first */ |
| 287 | 288 | /* |
| 288 | 289 | * VM_FLAGS_SUPERPAGE_MASK |
| ... | ... | @@ -299,7 +300,7 @@ typedef struct vm_purgeable_info *vm_purgeable_info_t; |
| 299 | 300 | 	 (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) | \ |
| 300 | 301 | 	 (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24)) |
| 301 | 302 | |
| 302 | #define VM_FLAGS_HW (VM_FLAGS_TPRO) | |
| 303 | #define VM_FLAGS_HW (VM_FLAGS_TPRO | VM_FLAGS_MTE) | |
| 303 | 304 | |
| 304 | 305 | /* These are the flags that we accept from user-space */ |
| 305 | 306 | #define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED | \ |
| ... | ... | @@ -358,8 +359,13 @@ __enum_decl(virtual_memory_guard_exception_code_t, uint32_t, { |
| 358 | 359 | 	kGUARD_EXC_SEC_COPY_DENIED = 100, |
| 359 | 360 | 	kGUARD_EXC_SEC_SHARING_DENIED = 101, |
| 360 | 361 | |
| 362 | 	/* Fault-related exceptions. */ | |
| 363 | 	kGUARD_EXC_MTE_SYNC_FAULT = 200, | |
| 364 | 	kGUARD_EXC_MTE_ASYNC_USER_FAULT = 201, | |
| 365 | 	kGUARD_EXC_MTE_ASYNC_KERN_FAULT = 202 | |
| 361 | 366 | }); |
| 362 | 367 | |
| 368 | #define kGUARD_EXC_MTE_SOFT_MODE 0x100000 | |
| 363 | 369 | |
| 364 | 370 | |
| 365 | 371 | #pragma mark Ledger Tags |
lib/libc/include/any-macos-any/mach/vm_types.h+6| ... | ... | @@ -71,6 +71,12 @@ typedef uint32_t reg64_t; |
| 71 | 71 | typedef uint32_t ppnum_t __kernel_ptr_semantics; /* Physical page number */ |
| 72 | 72 | #define PPNUM_MAX UINT32_MAX |
| 73 | 73 | |
| 74 | /* | |
| 75 | * For use with mach_vm_update_pointers_with_remote_tags. | |
| 76 | * This definition must be kept in sync with the definition in mach_types.defs. | |
| 77 | */ | |
| 78 | #define VM_OFFSET_LIST_MAX 1024 | |
| 79 | ||
| 74 | 80 | |
| 75 | 81 | typedef mach_port_t vm_map_t, vm_map_read_t, vm_map_inspect_t; |
| 76 | 82 | typedef mach_port_t upl_t; |
lib/libc/include/any-macos-any/malloc/malloc.h+21-5| ... | ... | @@ -110,6 +110,10 @@ __API_AVAILABLE(macos(26.0), ios(26.0), tvos(26.0), watchos(26.0), visionos(26.0 |
| 110 | 110 | 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); |
| 111 | 111 | #endif /* __LP64__ */ |
| 112 | 112 | |
| 113 | #if defined(_MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING) && _MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING | |
| 114 | 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); | |
| 115 | #endif /* defined(_MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING) && _MALLOC_TYPE_MALLOC_IS_BACKDEPLOYING */ | |
| 116 | ||
| 113 | 117 | // The remainder of these functions are declared in malloc/_malloc_type.h, and |
| 114 | 118 | // the backdeployment variant definitions are at the bottom of this file. |
| 115 | 119 | |
| ... | ... | @@ -409,13 +413,16 @@ extern void * __sized_by_or_null(size) malloc_zone_malloc(malloc_zone_t *zone, s |
| 409 | 413 | * parameter may be NULL, in which case the default zone will be used. |
| 410 | 414 | * |
| 411 | 415 | * @param align |
| 412 | * The minimum alignment of the requested allocation. This parameter must be | |
| 413 | * MALLOC_ZONE_MALLOC_DEFAULT_ALIGN to request default alignment, or a power | |
| 414 | * of 2 >= sizeof(void *). | |
| 416 | * The minimum alignment of the requested allocation. This non-zero parameter | |
| 417 | * must be MALLOC_ZONE_MALLOC_DEFAULT_ALIGN to request default alignment, or a | |
| 418 | * power of 2 > sizeof(void *). | |
| 415 | 419 | * |
| 416 | 420 | * @param size |
| 417 | * The size, in bytes, of the requested allocation. Must be an integral | |
| 418 | * multiple of align if align is non-zero. | |
| 421 | * The size, in bytes, of the requested allocation, which must be an integral | |
| 422 | * multiple of align. This requirement is relaxed slightly on OS versions | |
| 423 | * strictly newer than 26.0, where a non-multiple size is permitted if and only | |
| 424 | * if align is MALLOC_ZONE_MALLOC_DEFAULT_ALIGN. OS version 26.0 does not | |
| 425 | * implement this exception. | |
| 419 | 426 | * |
| 420 | 427 | * @param options |
| 421 | 428 | * 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 |
| 698 | 705 | 	return func(zone, size); |
| 699 | 706 | } |
| 700 | 707 | |
| 708 | 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) { | |
| 709 | 	__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); | |
| 710 | 	__auto_type func = malloc_zone_malloc_with_options; | |
| 711 | 	if (malloc_type_zone_malloc_with_options) { | |
| 712 | 		return malloc_type_zone_malloc_with_options(zone, alignment, size, type_id, opts); | |
| 713 | 	} | |
| 714 | 	return func(zone, alignment, size, opts); | |
| 715 | } | |
| 716 | ||
| 701 | 717 | 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) { |
| 702 | 718 | 	__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); |
| 703 | 719 | 	__auto_type func = malloc_zone_calloc; |
lib/libc/include/any-macos-any/sys/_symbol_aliasing.h+12| ... | ... | @@ -563,6 +563,12 @@ |
| 563 | 563 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_26_0(x) |
| 564 | 564 | #endif |
| 565 | 565 | |
| 566 | #if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 260100 | |
| 567 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_26_1(x) x | |
| 568 | #else | |
| 569 | #define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_26_1(x) | |
| 570 | #endif | |
| 571 | ||
| 566 | 572 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1000 |
| 567 | 573 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_10_0(x) x |
| 568 | 574 | #else |
| ... | ... | @@ -1001,3 +1007,9 @@ |
| 1001 | 1007 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_26_0(x) |
| 1002 | 1008 | #endif |
| 1003 | 1009 | |
| 1010 | #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 260100 | |
| 1011 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_26_1(x) x | |
| 1012 | #else | |
| 1013 | #define __DARWIN_ALIAS_STARTING_MAC___MAC_26_1(x) | |
| 1014 | #endif | |
| 1015 |
lib/libc/include/any-macos-any/sys/fcntl.h+1| ... | ... | @@ -184,6 +184,7 @@ |
| 184 | 184 | #define AT_SYMLINK_NOFOLLOW_ANY 0x0800 /* Path should not contain any symlinks */ |
| 185 | 185 | #define AT_RESOLVE_BENEATH 0x2000 /* Path must reside in the hierarchy beneath the starting directory */ |
| 186 | 186 | #define AT_NODELETEBUSY 0x4000 /* Don't delete busy files */ |
| 187 | #define AT_UNIQUE 0x8000 /* prevent a path lookup from succeeding on a vnode with multiple links */ | |
| 187 | 188 | #endif |
| 188 | 189 | #endif |
| 189 | 190 |
lib/libc/include/any-macos-any/sys/mount.h+4-2| ... | ... | @@ -419,8 +419,9 @@ OS_ENUM(graftdmg_type, uint32_t, |
| 419 | 419 | GRAFTDMG_CRYPTEX_PDI_NONCE = 6, |
| 420 | 420 | GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7, |
| 421 | 421 | GRAFTDMG_CRYPTEX_MOBILE_ASSET = 8, |
| 422 | GRAFTDMG_CRYPTEX_MOBILE_ASSET_WITH_CODE = 9, | |
| 422 | 423 | // Update this when a new type is added |
| 423 | GRAFTDMG_CRYPTEX_MAX = 8); | |
| 424 | GRAFTDMG_CRYPTEX_MAX = 9); | |
| 424 | 425 | |
| 425 | 426 | OS_ENUM(cryptex_auth_type, uint32_t, |
| 426 | 427 | // Reserved: GRAFTDMG_CRYPTEX_BOOT = 1, |
| ... | ... | @@ -431,8 +432,9 @@ OS_ENUM(cryptex_auth_type, uint32_t, |
| 431 | 432 | CRYPTEX_AUTH_PDI_NONCE = 6, |
| 432 | 433 | // Reserved: GRAFTDMG_CRYPTEX_EFFECTIVE_AP = 7, |
| 433 | 434 | CRYPTEX_AUTH_MOBILE_ASSET = 8, |
| 435 | CRYPTEX_AUTH_MOBILE_ASSET_WITH_CODE = 9, | |
| 434 | 436 | // Update this when a new type is added |
| 435 | CRYPTEX_AUTH_MAX = 8); | |
| 437 | CRYPTEX_AUTH_MAX = 9); | |
| 436 | 438 | |
| 437 | 439 | |
| 438 | 440 | __BEGIN_DECLS |
lib/libc/include/any-macos-any/sys/resource.h+3| ... | ... | @@ -539,6 +539,9 @@ struct proc_rlimit_control_wakeupmon { |
| 539 | 539 | #define IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT 0 |
| 540 | 540 | #define IOPOL_MATERIALIZE_DATALESS_FILES_OFF 1 |
| 541 | 541 | #define IOPOL_MATERIALIZE_DATALESS_FILES_ON 2 |
| 542 | #define IOPOL_MATERIALIZE_DATALESS_FILES_ORIG 4 | |
| 543 | ||
| 544 | #define IOPOL_MATERIALIZE_DATALESS_FILES_BASIC_MASK 3 | |
| 542 | 545 | |
| 543 | 546 | #define IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT 0 |
| 544 | 547 | #define IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME 1 |
lib/libc/include/any-macos-any/xpc/connection.h+51-39| ... | ... | @@ -135,7 +135,7 @@ typedef void (*xpc_finalizer_t)(void * _Nullable value); |
| 135 | 135 | * |
| 136 | 136 | * If NULL, an anonymous listener connection will be created. You can embed the |
| 137 | 137 | * ability to create new peer connections in an endpoint, which can be inserted |
| 138 | * into a message and sent to another process . | |
| 138 | * into a message and sent to another process. | |
| 139 | 139 | * |
| 140 | 140 | * @param targetq |
| 141 | 141 | * 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, |
| 301 | 301 | * A connection may receive different events depending upon whether it is a |
| 302 | 302 | * listener or not. Any connection may receive an error in its event handler. |
| 303 | 303 | * But while normal connections may receive messages in addition to errors, |
| 304 | * listener connections will receive connections and and not messages. | |
| 304 | * listener connections will receive connections and not messages. | |
| 305 | 305 | * |
| 306 | 306 | * Connections received by listeners are equivalent to those returned by |
| 307 | 307 | * 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, |
| 310 | 310 | * to accept the connection, you may simply call xpc_connection_cancel() on it |
| 311 | 311 | * and return. The runtime will dispose of it for you. |
| 312 | 312 | * |
| 313 | * IMPORTANT: For peer connections received through a listener connection's | |
| 314 | * event handler, you MUST either accept the connection by setting an event | |
| 315 | * handler with xpc_connection_set_event_handler() and calling | |
| 316 | * xpc_connection_resume(), or reject the connection by calling | |
| 317 | * xpc_connection_cancel(). Failure to take one of these actions will result | |
| 318 | * in the connection remaining in an undefined state, potentially causing | |
| 319 | * resource leaks or preventing proper transaction cleanup. This requirement | |
| 320 | * applies to all listener connections, including those created with | |
| 321 | * xpc_connection_create_mach_service() and those managed automatically by | |
| 322 | * xpc_main(). | |
| 323 | * | |
| 313 | 324 | * If there is an error in the connection, this handler will be invoked with the |
| 314 | 325 | * error dictionary as its argument. This dictionary will be one of the well- |
| 315 | 326 | * known XPC_ERROR_* dictionaries. |
| ... | ... | @@ -586,10 +597,11 @@ xpc_connection_send_message_with_reply_sync(xpc_connection_t connection, |
| 586 | 597 | * Cancellation is asynchronous and non-preemptive and therefore this method |
| 587 | 598 | * will not interrupt the execution of an already-running event handler block. |
| 588 | 599 | * If the event handler is executing at the time of this call, it will finish, |
| 589 | * and then the connection will be canceled, causing a final invocation of the | |
| 590 | * event handler to be scheduled with the XPC_ERROR_CONNECTION_INVALID error. | |
| 591 | * After that invocation, there will be no further invocations of the event | |
| 592 | * handler. | |
| 600 | * and then the connection will be canceled. | |
| 601 | * | |
| 602 | * Canceling the connection will cause a final invocation of the event handler | |
| 603 | * to be scheduled with the XPC_ERROR_CONNECTION_INVALID error. After that | |
| 604 | * invocation, there will be no further invocations of the event handler. | |
| 593 | 605 | * |
| 594 | 606 | * The XPC runtime guarantees this non-preemptiveness even for concurrent target |
| 595 | 607 | * queues. |
| ... | ... | @@ -601,7 +613,7 @@ xpc_connection_cancel(xpc_connection_t connection); |
| 601 | 613 | |
| 602 | 614 | /*! |
| 603 | 615 | * @function xpc_connection_get_name |
| 604 | * Returns the name of the service with which the connections was created. | |
| 616 | * Returns the name of the service with which the connection was created. | |
| 605 | 617 | * |
| 606 | 618 | * @param connection |
| 607 | 619 | * The connection object which is to be examined. |
| ... | ... | @@ -690,7 +702,7 @@ xpc_connection_get_asid(xpc_connection_t connection); |
| 690 | 702 | |
| 691 | 703 | /*! |
| 692 | 704 | * @function xpc_connection_set_context |
| 693 | * Sets context on an connection. | |
| 705 | * Sets context on a connection. | |
| 694 | 706 | * |
| 695 | 707 | * @param connection |
| 696 | 708 | * The connection which is to be manipulated. |
| ... | ... | @@ -764,8 +776,8 @@ xpc_connection_set_finalizer_f(xpc_connection_t connection, |
| 764 | 776 | * The connection object which is to be modified. |
| 765 | 777 | * |
| 766 | 778 | * @param requirement |
| 767 | * The code signing requirement to be satisfied by the peer | |
| 768 | * It is safe to deallocate the requirement string after calling `xpc_connection_set_peer_code_signing_requirement` | |
| 779 | * The code signing requirement to be satisfied by the peer. | |
| 780 | * It is safe to deallocate the requirement string after calling `xpc_connection_set_peer_code_signing_requirement`. | |
| 769 | 781 | * |
| 770 | 782 | * @result |
| 771 | 783 | * 0 on success, non-zero on error |
| ... | ... | @@ -780,7 +792,7 @@ xpc_connection_set_finalizer_f(xpc_connection_t connection, |
| 780 | 792 | * are dropped. When a reply is expected on the connection and the peer does not satisfy the requirement |
| 781 | 793 | * `XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT` will be delivered instead of the reply. |
| 782 | 794 | * |
| 783 | * This API is not supported on embedded platforms and will return ENOTSUP. | |
| 795 | * This API is not supported on embedded platforms and will return ENOTSUP. | |
| 784 | 796 | * |
| 785 | 797 | * @see https://developer.apple.com/documentation/technotes/tn3127-inside-code-signing-requirements |
| 786 | 798 | */ |
| ... | ... | @@ -792,14 +804,14 @@ xpc_connection_set_peer_code_signing_requirement(xpc_connection_t connection, co |
| 792 | 804 | |
| 793 | 805 | /*! |
| 794 | 806 | * @function xpc_connection_set_peer_entitlement_exists_requirement |
| 795 | * Requires that the connection peer has the specified entitlement | |
| 807 | * Requires that the connection peer has the specified entitlement. | |
| 796 | 808 | * |
| 797 | 809 | * @param connection |
| 798 | * The connection object which is to be modified | |
| 810 | * The connection object which is to be modified. | |
| 799 | 811 | * |
| 800 | 812 | * @param entitlement |
| 801 | * The entitlement the peer must have | |
| 802 | * It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_exists_requirement` | |
| 813 | * The entitlement the peer must have. | |
| 814 | * It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_exists_requirement`. | |
| 803 | 815 | * |
| 804 | 816 | * @result |
| 805 | 817 | * 0 on success, non-zero on error |
| ... | ... | @@ -824,17 +836,17 @@ xpc_connection_set_peer_entitlement_exists_requirement(xpc_connection_t connecti |
| 824 | 836 | |
| 825 | 837 | /*! |
| 826 | 838 | * @function xpc_connection_set_peer_entitlement_matches_value_requirement |
| 827 | * Requires that the connection peer has the specified entitlement with the matching value | |
| 839 | * Requires that the connection peer has the specified entitlement with the matching value. | |
| 828 | 840 | * |
| 829 | 841 | * @param connection |
| 830 | * The connection object which is to be modified | |
| 842 | * The connection object which is to be modified. | |
| 831 | 843 | * |
| 832 | 844 | * @param entitlement |
| 833 | * The entitlement the peer must have | |
| 834 | * It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_matches_value_requirement` | |
| 845 | * The entitlement the peer must have. | |
| 846 | * It is safe to deallocate the entitlement string after calling `xpc_connection_set_peer_entitlement_matches_value_requirement`. | |
| 835 | 847 | * |
| 836 | 848 | * @param value |
| 837 | * The value that the entitlement must match | |
| 849 | * The value that the entitlement must match. | |
| 838 | 850 | * It is safe to deallocate the value object after calling |
| 839 | 851 | * `xpc_connection_set_peer_entitlement_matches_value_requirement`. |
| 840 | 852 | * 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 |
| 863 | 875 | /*! |
| 864 | 876 | * @function xpc_connection_set_peer_team_identity_requirement |
| 865 | 877 | * Requires that the connection peer has the specified identity and is signed with the same team identifier |
| 866 | * as the current process | |
| 878 | * as the current process. | |
| 867 | 879 | * |
| 868 | 880 | * @param connection |
| 869 | * The connection object which is to be modified | |
| 881 | * The connection object which is to be modified. | |
| 870 | 882 | * |
| 871 | 883 | * @param signing_identifier |
| 872 | * The optional signing identifier the peer must have | |
| 873 | * It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement` | |
| 884 | * The optional signing identifier the peer must have. | |
| 885 | * It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`. | |
| 874 | 886 | * |
| 875 | 887 | * @result |
| 876 | 888 | * 0 on success, non-zero on error |
| ... | ... | @@ -879,7 +891,7 @@ xpc_connection_set_peer_entitlement_matches_value_requirement(xpc_connection_t c |
| 879 | 891 | * This function will return an error promptly if the identity requirement is invalid. |
| 880 | 892 | * |
| 881 | 893 | * The peer process must be signed as either a Testflight app or an App store app, |
| 882 | * or be signed by an apple issued development certificate, an enterprise distributed | |
| 894 | * or be signed by an Apple-issued development certificate, an enterprise distributed | |
| 883 | 895 | * certificate (embedded only), or a Developer ID certificate (macOS only) |
| 884 | 896 | * |
| 885 | 897 | * 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 |
| 899 | 911 | |
| 900 | 912 | /*! |
| 901 | 913 | * @function xpc_connection_set_peer_platform_identity_requirement |
| 902 | * Requires that the connection peer has the specified identity and is signed by Apple | |
| 914 | * Requires that the connection peer has the specified identity and is signed by Apple. | |
| 903 | 915 | * |
| 904 | 916 | * @param connection |
| 905 | * The connection object which is to be modified | |
| 917 | * The connection object which is to be modified. | |
| 906 | 918 | * |
| 907 | 919 | * @param signing_identifier |
| 908 | * The optional signing identifier the peer must have. If not specified, this function ensures that the peer is signed by Apple | |
| 909 | * It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement` | |
| 920 | * The optional signing identifier the peer must have. If not specified, this function ensures that the peer is signed by Apple. | |
| 921 | * It is safe to deallocate the signing identifier string after calling `xpc_connection_set_peer_identity_requirement`. | |
| 910 | 922 | * |
| 911 | 923 | * @result |
| 912 | 924 | * 0 on success, non-zero on error |
| ... | ... | @@ -934,14 +946,14 @@ xpc_connection_set_peer_platform_identity_requirement(xpc_connection_t connectio |
| 934 | 946 | |
| 935 | 947 | /*! |
| 936 | 948 | * @function xpc_connection_set_peer_lightweight_code_requirement |
| 937 | * Requires that the connection peer has the specified lightweight code requirement | |
| 949 | * Requires that the connection peer has the specified lightweight code requirement. | |
| 938 | 950 | * |
| 939 | 951 | * @param connection |
| 940 | * The connection object which is to be modified | |
| 952 | * The connection object which is to be modified. | |
| 941 | 953 | * |
| 942 | 954 | * @param lwcr |
| 943 | * The lightweight code requirement the peer must have | |
| 944 | * It is safe to deallocate the lightweight code requirement object after calling `xpc_connection_set_peer_lightweight_code_requirement` | |
| 955 | * The lightweight code requirement the peer must have. | |
| 956 | * It is safe to deallocate the lightweight code requirement object after calling `xpc_connection_set_peer_lightweight_code_requirement`. | |
| 945 | 957 | * |
| 946 | 958 | * @result |
| 947 | 959 | * 0 on success, non-zero on error |
| ... | ... | @@ -982,14 +994,14 @@ xpc_connection_set_peer_lightweight_code_requirement(xpc_connection_t connection |
| 982 | 994 | |
| 983 | 995 | /*! |
| 984 | 996 | * @function xpc_connection_set_peer_requirement |
| 985 | * Requires that the connection peer has the specified requirement | |
| 997 | * Requires that the connection peer has the specified requirement. | |
| 986 | 998 | * |
| 987 | 999 | * @param connection |
| 988 | * The connection object which is to be modified | |
| 1000 | * The connection object which is to be modified. | |
| 989 | 1001 | * |
| 990 | 1002 | * @param peer_requirement |
| 991 | * The requirement the peer must have | |
| 992 | * It is safe to deallocate the peer requirement after calling `xpc_connection_set_peer_requirement` | |
| 1003 | * The requirement the peer must have. | |
| 1004 | * It is safe to deallocate the peer requirement after calling `xpc_connection_set_peer_requirement`. | |
| 993 | 1005 | * |
| 994 | 1006 | * @discussion |
| 995 | 1007 | * 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, |
| 1012 | 1024 | * Returns a description of why the connection was invalidated. |
| 1013 | 1025 | * |
| 1014 | 1026 | * @param connection |
| 1015 | * The connection object to inspect | |
| 1027 | * The connection object to inspect. | |
| 1016 | 1028 | * |
| 1017 | 1029 | * @result |
| 1018 | * Null if the connection has not been invalidated, otherwise a description for why the connection was invalidated. | |
| 1030 | * NULL if the connection has not been invalidated, otherwise a description for why the connection was invalidated. | |
| 1019 | 1031 | */ |
| 1020 | 1032 | API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0), watchos(8.0)) |
| 1021 | 1033 | XPC_EXPORT XPC_NONNULL1 XPC_WARN_RESULT |
lib/libc/include/any-macos-any/xpc/listener.h+17-9| ... | ... | @@ -21,7 +21,7 @@ __BEGIN_DECLS |
| 21 | 21 | * Listeners represent the server side variant of an XPC Session. |
| 22 | 22 | * |
| 23 | 23 | * Listeners are activated and then begin receiving `xpc_session_t` from peers attempting to |
| 24 | * connect to the server | |
| 24 | * connect to the server. | |
| 25 | 25 | * |
| 26 | 26 | */ |
| 27 | 27 | OS_OBJECT_DECL_SENDABLE_CLASS(xpc_listener); |
| ... | ... | @@ -38,10 +38,10 @@ OS_OBJECT_DECL_SENDABLE_CLASS(xpc_listener); |
| 38 | 38 | * {@link xpc_listener_activate} before it can be used. |
| 39 | 39 | * |
| 40 | 40 | * @const XPC_LISTENER_CREATE_FORCE_MACH |
| 41 | * Optional key to indicate to the runtime that this listener is for a Mach Service | |
| 41 | * Optional key to indicate to the runtime that this listener is for a Mach Service. | |
| 42 | 42 | * |
| 43 | 43 | * @const XPC_LISTENER_CREATE_FORCE_XPCSERVICE |
| 44 | * Optional key to indicate to the runtime that this listener is for a XPCService endpoint | |
| 44 | * Optional key to indicate to the runtime that this listener is for a XPCService endpoint. | |
| 45 | 45 | */ |
| 46 | 46 | XPC_SWIFT_NOEXPORT |
| 47 | 47 | XPC_FLAGS_ENUM(xpc_listener_create_flags, uint64_t, |
| ... | ... | @@ -76,7 +76,7 @@ xpc_listener_copy_description(xpc_listener_t listener); |
| 76 | 76 | #pragma mark Server Session Creation |
| 77 | 77 | /*! |
| 78 | 78 | * @function xpc_listener_create |
| 79 | * Creates a listener with the service defined by the provided name | |
| 79 | * Creates a listener with the service defined by the provided name. | |
| 80 | 80 | * |
| 81 | 81 | * @param service |
| 82 | 82 | * The Mach service or XPC Service name to create the listener with. |
| ... | ... | @@ -91,9 +91,14 @@ xpc_listener_copy_description(xpc_listener_t listener); |
| 91 | 91 | * Additional attributes to create the listener. |
| 92 | 92 | * |
| 93 | 93 | * @param incoming_session_handler |
| 94 | * The handler block to be called when a peer is attempting to establish a | |
| 94 | * The handler block to be called when a peer is attempting to establish a | |
| 95 | 95 | * connection with this listener. The incoming session handler is mandatory. |
| 96 | 96 | * |
| 97 | * Unlike XPC connection listeners that require explicit acceptance, | |
| 98 | * xpc_listener automatically accepts and activates incoming peer sessions when | |
| 99 | * the incoming_session_handler returns, unless the peer session was explicitly | |
| 100 | * rejected using xpc_listener_reject_peer() or cancelled using xpc_session_cancel(). | |
| 101 | * | |
| 97 | 102 | * @param error_out |
| 98 | 103 | * An out-parameter that, if set and in the event of an error, will point to an |
| 99 | 104 | * {@link xpc_rich_error_t} describing the details of any errors that occurred. |
| ... | ... | @@ -176,17 +181,20 @@ xpc_listener_cancel(xpc_listener_t listener); |
| 176 | 181 | |
| 177 | 182 | /*! |
| 178 | 183 | * @function xpc_listener_reject_peer |
| 179 | * Rejects the incoming peer session | |
| 184 | * Rejects the incoming peer session. | |
| 180 | 185 | * |
| 181 | 186 | * @param peer |
| 182 | 187 | * The peer session object to reject. This must be a session that was an argument |
| 183 | * from an incoming session handler block | |
| 188 | * from an incoming session handler block. | |
| 184 | 189 | * |
| 185 | 190 | * @param reason |
| 186 | * The reason that the peer was rejected | |
| 191 | * The reason that the peer was rejected. | |
| 187 | 192 | * |
| 188 | 193 | * @discussion |
| 189 | * The peer session will be cancelled and cannot be used after it has been rejected | |
| 194 | * The peer session will be cancelled and cannot be used after it has been rejected. | |
| 195 | * | |
| 196 | * An incoming session that is not rejected will automatically be accepted | |
| 197 | * after returning from the incoming peer handler. | |
| 190 | 198 | */ |
| 191 | 199 | API_AVAILABLE(macos(14.0), macCatalyst(17.0)) |
| 192 | 200 | API_UNAVAILABLE(ios, tvos, watchos) |
lib/libc/include/any-macos-any/xpc/xpc.h+55-40| ... | ... | @@ -221,7 +221,7 @@ XPC_TYPE(_xpc_type_date); |
| 221 | 221 | |
| 222 | 222 | /*! |
| 223 | 223 | * @define XPC_TYPE_DATA |
| 224 | * A type representing a an arbitrary buffer of bytes. | |
| 224 | * A type representing an arbitrary buffer of bytes. | |
| 225 | 225 | */ |
| 226 | 226 | #define XPC_TYPE_DATA (&_xpc_type_data) |
| 227 | 227 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| ... | ... | @@ -239,7 +239,7 @@ XPC_TYPE(_xpc_type_string); |
| 239 | 239 | |
| 240 | 240 | /*! |
| 241 | 241 | * @define XPC_TYPE_UUID |
| 242 | * A type representing a Universally Unique Identifier as defined by uuid(3). | |
| 242 | * A type representing a Universally Unique Identifier as defined by uuid(3). | |
| 243 | 243 | */ |
| 244 | 244 | #define XPC_TYPE_UUID (&_xpc_type_uuid) |
| 245 | 245 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| ... | ... | @@ -487,7 +487,7 @@ xpc_copy(xpc_object_t object); |
| 487 | 487 | * Returns true if the objects are equal, otherwise false. Two objects must be |
| 488 | 488 | * of the same type in order to be equal. |
| 489 | 489 | * |
| 490 | * For two arrays to be equal, they must contain the same values at the | |
| 490 | * For two arrays to be equal, they must contain the same values at the | |
| 491 | 491 | * same indexes. For two dictionaries to be equal, they must contain the same |
| 492 | 492 | * values for the same keys. |
| 493 | 493 | * |
| ... | ... | @@ -513,8 +513,8 @@ xpc_equal(xpc_object_t object1, xpc_object_t object2); |
| 513 | 513 | * The calculated hash value. |
| 514 | 514 | * |
| 515 | 515 | * @discussion |
| 516 | * Note that the computed hash values for any particular type and value of an | |
| 517 | * object can change from across releases and platforms and should not be | |
| 516 | * Note that the computed hash values for any particular type and value of an | |
| 517 | * object can change across releases and platforms and should not be | |
| 518 | 518 | * assumed to be constant across all time and space or stored persistently. |
| 519 | 519 | */ |
| 520 | 520 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| ... | ... | @@ -567,7 +567,7 @@ xpc_null_create(void); |
| 567 | 567 | * The Boolean primitive value which is to be boxed. |
| 568 | 568 | * |
| 569 | 569 | * @result |
| 570 | * A new Boolean object. | |
| 570 | * A new Boolean object. | |
| 571 | 571 | */ |
| 572 | 572 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 573 | 573 | XPC_EXPORT XPC_RETURNS_RETAINED XPC_WARN_RESULT |
| ... | ... | @@ -710,7 +710,8 @@ xpc_double_get_value(xpc_object_t xdouble); |
| 710 | 710 | * @param interval |
| 711 | 711 | * The date interval which is to be boxed. Negative values indicate the number |
| 712 | 712 | * of nanoseconds before the epoch. Positive values indicate the number of |
| 713 | * nanoseconds after the epoch. | |
| 713 | * nanoseconds after the epoch. The interval is with respect to the Unix epoch. | |
| 714 | * XPC dates are in Unix time and are thus unaware of local time or leap seconds. | |
| 714 | 715 | * |
| 715 | 716 | * @result |
| 716 | 717 | * A new date object. |
| ... | ... | @@ -745,7 +746,8 @@ xpc_date_create_from_current(void); |
| 745 | 746 | * |
| 746 | 747 | * @result |
| 747 | 748 | * The underlying date interval or 0 if the given object was not an XPC date |
| 748 | * object. | |
| 749 | * object. The interval is with respect to the Unix epoch. XPC dates are in | |
| 750 | * Unix time and are thus unaware of local time or leap seconds. | |
| 749 | 751 | */ |
| 750 | 752 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 751 | 753 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 |
| ... | ... | @@ -768,7 +770,7 @@ xpc_date_get_value(xpc_object_t xdate); |
| 768 | 770 | * The number of bytes which are to be boxed. |
| 769 | 771 | * |
| 770 | 772 | * @result |
| 771 | * A new data object. | |
| 773 | * A new data object. | |
| 772 | 774 | * |
| 773 | 775 | * @discussion |
| 774 | 776 | * 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) |
| 791 | 793 | * is retained by the data object. |
| 792 | 794 | * |
| 793 | 795 | * @result |
| 794 | * A new data object. | |
| 796 | * A new data object. | |
| 795 | 797 | * |
| 796 | 798 | * @discussion |
| 797 | 799 | * 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); |
| 843 | 845 | * @function xpc_data_get_bytes |
| 844 | 846 | * |
| 845 | 847 | * @abstract |
| 846 | * Copies the bytes stored in an data objects into the specified buffer. | |
| 848 | * Copies the bytes stored in a data object into the specified buffer. | |
| 847 | 849 | * |
| 848 | 850 | * @param xdata |
| 849 | 851 | * The data object which is to be examined. |
| ... | ... | @@ -852,7 +854,7 @@ xpc_data_get_bytes_ptr(xpc_object_t xdata); |
| 852 | 854 | * The buffer in which to copy the data object's bytes. |
| 853 | 855 | * |
| 854 | 856 | * @param off |
| 855 | * The offset at which to begin the copy. If this offset is greater than the | |
| 857 | * The offset at which to begin the copy. If this offset is greater than the | |
| 856 | 858 | * length of the data element, nothing is copied. Pass 0 to start the copy |
| 857 | 859 | * at the beginning of the buffer. |
| 858 | 860 | * |
| ... | ... | @@ -880,7 +882,7 @@ xpc_data_get_bytes(xpc_object_t xdata, |
| 880 | 882 | * The C-string which is to be boxed. |
| 881 | 883 | * |
| 882 | 884 | * @result |
| 883 | * A new string object. | |
| 885 | * A new string object. | |
| 884 | 886 | */ |
| 885 | 887 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 886 | 888 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 |
| ... | ... | @@ -902,7 +904,7 @@ xpc_string_create(const char *string); |
| 902 | 904 | * The arguments which correspond to those specified in the format string. |
| 903 | 905 | * |
| 904 | 906 | * @result |
| 905 | * A new string object. | |
| 907 | * A new string object. | |
| 906 | 908 | */ |
| 907 | 909 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 908 | 910 | XPC_EXPORT XPC_MALLOC XPC_RETURNS_RETAINED XPC_WARN_RESULT XPC_NONNULL1 |
| ... | ... | @@ -926,7 +928,7 @@ xpc_string_create_with_format(const char *fmt, ...); |
| 926 | 928 | * string. |
| 927 | 929 | * |
| 928 | 930 | * @result |
| 929 | * A new string object. | |
| 931 | * A new string object. | |
| 930 | 932 | */ |
| 931 | 933 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 932 | 934 | 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); |
| 944 | 946 | * The string object which is to be examined. |
| 945 | 947 | * |
| 946 | 948 | * @result |
| 947 | * The length of the underlying string, not including the NUL-terminator, or 0 | |
| 949 | * The length of the underlying string, not including the NUL-terminator, or 0 | |
| 948 | 950 | * if the given object was not an XPC string object. |
| 949 | 951 | */ |
| 950 | 952 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| ... | ... | @@ -982,7 +984,7 @@ xpc_string_get_string_ptr(xpc_object_t xstring); |
| 982 | 984 | * The UUID which is to be boxed. |
| 983 | 985 | * |
| 984 | 986 | * @result |
| 985 | * A new UUID object. | |
| 987 | * A new UUID object. | |
| 986 | 988 | */ |
| 987 | 989 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 988 | 990 | 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); |
| 1444 | 1446 | * undefined. |
| 1445 | 1447 | * |
| 1446 | 1448 | * @param value |
| 1447 | * The date value to insert, represented as an <code>int64_t</code>. After | |
| 1448 | * calling this method, the XPC object corresponding to the primitive value | |
| 1449 | * inserted may be safely retrieved with {@link xpc_array_get_value()}. | |
| 1449 | * The date value to insert, represented as an <code>int64_t</code>. The | |
| 1450 | * interval is with respect to the Unix epoch. XPC dates are in Unix time and | |
| 1451 | * are thus unaware of local time or leap seconds. After calling this method, | |
| 1452 | * the XPC object corresponding to the primitive value inserted may be safely | |
| 1453 | * retrieved with {@link xpc_array_get_value()}. | |
| 1450 | 1454 | */ |
| 1451 | 1455 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 1452 | 1456 | XPC_EXPORT XPC_NONNULL1 |
| ... | ... | @@ -1624,7 +1628,7 @@ xpc_array_get_bool(xpc_object_t xarray, size_t index); |
| 1624 | 1628 | * |
| 1625 | 1629 | * @result |
| 1626 | 1630 | * The underlying <code>int64_t</code> value at the specified index. 0 if the |
| 1627 | * value at the specified index is not a signed integer value. | |
| 1631 | * value at the specified index is not a signed integer value. | |
| 1628 | 1632 | */ |
| 1629 | 1633 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 1630 | 1634 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 |
| ... | ... | @@ -1692,8 +1696,10 @@ xpc_array_get_double(xpc_object_t xarray, size_t index); |
| 1692 | 1696 | * index is outside that range, the behavior is undefined. |
| 1693 | 1697 | * |
| 1694 | 1698 | * @result |
| 1695 | * The underlying date interval at the specified index. 0 if the value at the | |
| 1696 | * specified index is not a date value. | |
| 1699 | * The underlying date interval at the specified index. The interval is with | |
| 1700 | * respect to the Unix epoch. XPC dates are in Unix time and are thus unaware | |
| 1701 | * of local time or leap seconds. 0 if the value at the specified index is not | |
| 1702 | * a date value. | |
| 1697 | 1703 | */ |
| 1698 | 1704 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 1699 | 1705 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL1 |
| ... | ... | @@ -1715,7 +1721,7 @@ xpc_array_get_date(xpc_object_t xarray, size_t index); |
| 1715 | 1721 | * index is outside that range, the behavior is undefined. |
| 1716 | 1722 | * |
| 1717 | 1723 | * @param length |
| 1718 | * Upon return output, will contain the length of the data corresponding to the | |
| 1724 | * Upon return, will contain the length of the data corresponding to the | |
| 1719 | 1725 | * specified key. |
| 1720 | 1726 | * |
| 1721 | 1727 | * @result |
| ... | ... | @@ -1842,7 +1848,7 @@ xpc_array_create_connection(xpc_object_t xarray, size_t index); |
| 1842 | 1848 | * |
| 1843 | 1849 | * @result |
| 1844 | 1850 | * The object at the specified index within the array or NULL if the given |
| 1845 | * object was not an XPC array or if the the value at the specified index was | |
| 1851 | * object was not an XPC array or if the value at the specified index was | |
| 1846 | 1852 | * not a dictionary. |
| 1847 | 1853 | * |
| 1848 | 1854 | * @discussion |
| ... | ... | @@ -1869,7 +1875,7 @@ xpc_array_get_dictionary(xpc_object_t xarray, size_t index); |
| 1869 | 1875 | * |
| 1870 | 1876 | * @result |
| 1871 | 1877 | * The object at the specified index within the array or NULL if the given |
| 1872 | * object was not an XPC array or if the the value at the specified index was | |
| 1878 | * object was not an XPC array or if the value at the specified index was | |
| 1873 | 1879 | * not an array. |
| 1874 | 1880 | * |
| 1875 | 1881 | * @discussion |
| ... | ... | @@ -1922,7 +1928,7 @@ typedef bool (^xpc_dictionary_applier_t)(const char * _Nonnull key, |
| 1922 | 1928 | * the actual count of values, only that many key/value pairs will be inserted |
| 1923 | 1929 | * into the dictionary. |
| 1924 | 1930 | * |
| 1925 | * If the count is more than the the actual count of key/value pairs, the | |
| 1931 | * If the count is more than the actual count of key/value pairs, the | |
| 1926 | 1932 | * behavior is undefined. If one array is NULL and the other is not, the |
| 1927 | 1933 | * behavior is undefined. If both arrays are NULL and the count is non-0, the |
| 1928 | 1934 | * behavior is undefined. |
| ... | ... | @@ -2040,7 +2046,7 @@ xpc_dictionary_get_value(xpc_object_t xdict, const char *key); |
| 2040 | 2046 | * The dictionary object which is to be examined. |
| 2041 | 2047 | * |
| 2042 | 2048 | * @result |
| 2043 | * The number of values stored in the dictionary or 0 if the given object was | |
| 2049 | * The number of values stored in the dictionary or 0 if the given object was | |
| 2044 | 2050 | * not an XPC dictionary. Calling xpc_dictionary_set_value() with a non-NULL |
| 2045 | 2051 | * value will increment the count. Calling xpc_dictionary_set_value() with a |
| 2046 | 2052 | * NULL value will decrement the count. |
| ... | ... | @@ -2192,18 +2198,20 @@ xpc_dictionary_set_double(xpc_object_t xdict, const char *key, double value); |
| 2192 | 2198 | * @function xpc_dictionary_set_date |
| 2193 | 2199 | * |
| 2194 | 2200 | * @abstract |
| 2195 | * Inserts a date (primitive) value into a dictionary. | |
| 2201 | * Inserts a date value into a dictionary. | |
| 2196 | 2202 | * |
| 2197 | 2203 | * @param xdict |
| 2198 | 2204 | * The dictionary which is to be manipulated. |
| 2199 | 2205 | * |
| 2200 | 2206 | * @param key |
| 2201 | * The key for which the primitive value shall be set. | |
| 2207 | * The key for which the value shall be set. | |
| 2202 | 2208 | * |
| 2203 | 2209 | * @param value |
| 2204 | * The date value to insert. After calling this method, the XPC object | |
| 2205 | * corresponding to the primitive value inserted may be safely retrieved with | |
| 2206 | * {@link xpc_dictionary_get_value()}. | |
| 2210 | * The date value to insert, represented as an <code>int64_t</code>. The | |
| 2211 | * interval is with respect to the Unix epoch. XPC dates are in Unix time and | |
| 2212 | * are thus unaware of local time or leap seconds. After calling this method, | |
| 2213 | * the XPC object corresponding to the primitive value inserted may be safely | |
| 2214 | * retrieved with {@link xpc_dictionary_get_value()}. | |
| 2207 | 2215 | */ |
| 2208 | 2216 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 2209 | 2217 | XPC_EXPORT XPC_NONNULL1 XPC_NONNULL2 |
| ... | ... | @@ -2263,7 +2271,7 @@ xpc_dictionary_set_string(xpc_object_t xdict, const char *key, |
| 2263 | 2271 | * @function xpc_dictionary_set_uuid |
| 2264 | 2272 | * |
| 2265 | 2273 | * @abstract |
| 2266 | * Inserts a uuid (primitive) value into an array. | |
| 2274 | * Inserts a UUID (primitive) value into a dictionary. | |
| 2267 | 2275 | * |
| 2268 | 2276 | * @param xdict |
| 2269 | 2277 | * The dictionary which is to be manipulated. |
| ... | ... | @@ -2381,7 +2389,7 @@ xpc_dictionary_get_bool(xpc_object_t xdict, const char *key); |
| 2381 | 2389 | * @function xpc_dictionary_get_int64 |
| 2382 | 2390 | * |
| 2383 | 2391 | * @abstract |
| 2384 | * Gets an <code>int64</code> primitive value from a dictionary directly. | |
| 2392 | * Gets an <code>int64_t</code> primitive value from a dictionary directly. | |
| 2385 | 2393 | * |
| 2386 | 2394 | * @param xdict |
| 2387 | 2395 | * The dictionary object which is to be examined. |
| ... | ... | @@ -2403,7 +2411,7 @@ xpc_dictionary_get_int64(xpc_object_t xdict, const char *key); |
| 2403 | 2411 | * @function xpc_dictionary_get_uint64 |
| 2404 | 2412 | * |
| 2405 | 2413 | * @abstract |
| 2406 | * Gets a <code>uint64</code> primitive value from a dictionary directly. | |
| 2414 | * Gets a <code>uint64_t</code> primitive value from a dictionary directly. | |
| 2407 | 2415 | * |
| 2408 | 2416 | * @param xdict |
| 2409 | 2417 | * The dictionary object which is to be examined. |
| ... | ... | @@ -2456,9 +2464,10 @@ xpc_dictionary_get_double(xpc_object_t xdict, const char *key); |
| 2456 | 2464 | * The key whose value is to be obtained. |
| 2457 | 2465 | * |
| 2458 | 2466 | * @result |
| 2459 | * The underlying date interval for the specified key. 0 if the value for the | |
| 2460 | * specified key is not a date value or if there is no value for the specified | |
| 2461 | * key. | |
| 2467 | * The underlying date interval for the specified key. The interval is with | |
| 2468 | * respect to the Unix epoch. XPC dates are in Unix time and are thus unaware | |
| 2469 | * of local time or leap seconds. 0 if the value for the specified key is not a | |
| 2470 | * date value or if there is no value for the specified key. | |
| 2462 | 2471 | */ |
| 2463 | 2472 | __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0) |
| 2464 | 2473 | XPC_EXPORT XPC_WARN_RESULT XPC_NONNULL_ALL |
| ... | ... | @@ -2674,7 +2683,13 @@ xpc_dictionary_copy_mach_send(xpc_object_t xdict, const char *key); |
| 2674 | 2683 | * bundle's Info.plist under the XPCService dictionary. |
| 2675 | 2684 | * |
| 2676 | 2685 | * @param handler |
| 2677 | * The handler with which to accept new connections. | |
| 2686 | * The handler with which to accept new connections. This handler is called for | |
| 2687 | * each new connection established with the service. The handler must either | |
| 2688 | * accept the connection by setting an event handler with | |
| 2689 | * xpc_connection_set_event_handler() and calling xpc_connection_resume(), or | |
| 2690 | * reject the connection by calling xpc_connection_cancel(). Failure to take | |
| 2691 | * one of these actions will result in the connection remaining in an undefined | |
| 2692 | * state, potentially causing resource leaks or transaction issues. | |
| 2678 | 2693 | */ |
| 2679 | 2694 | API_AVAILABLE(macos(10.7), macCatalyst(5.0)) |
| 2680 | 2695 | API_UNAVAILABLE(ios) |
tools/macos-headers.c+6-1| ... | ... | @@ -124,6 +124,7 @@ |
| 124 | 124 | |
| 125 | 125 | // macOS system headers |
| 126 | 126 | #include <mach/clock.h> |
| 127 | #include <mach/exception.h> | |
| 127 | 128 | #include <mach/mach.h> |
| 128 | 129 | #include <mach/mach_time.h> |
| 129 | 130 | #include <mach/thread_state.h> |
| ... | ... | @@ -177,7 +178,8 @@ |
| 177 | 178 | #include <os/lock.h> |
| 178 | 179 | #include <simd/simd.h> |
| 179 | 180 | #include <xpc/xpc.h> |
| 180 | #include <CommonCrypto/CommonDigest.h> | |
| 181 | #include <CommonCrypto/CommonCrypto.h> | |
| 182 | #include <CommonCrypto/CommonRandom.h> // Not included by CommonCrypto.h | |
| 181 | 183 | |
| 182 | 184 | #include <objc/message.h> |
| 183 | 185 | #include <objc/NSObject.h> |
| ... | ... | @@ -195,6 +197,9 @@ |
| 195 | 197 | #include <sys/file.h> |
| 196 | 198 | #include <malloc/malloc.h> |
| 197 | 199 | |
| 200 | // Depended on by bdwgc | |
| 201 | #include <mach-o/getsect.h> | |
| 202 | ||
| 198 | 203 | // Provided by macOS LibC |
| 199 | 204 | #include <memory.h> |
| 200 | 205 | #include <zlib.h> |