Binary identifiers in nested Mach-O within bundles are handled correctly. ``` $ rcodesign debug-create-macho MyApp.app/Contents/MacOS/MyApp assuming default minimum version 11.0.0 writing Mach-O to MyApp.app/Contents/MacOS/MyApp $ rcodesign debug-create-info-plist --bundle-name MyApp MyApp.app/Contents/Info.plist writing MyApp.app/Contents/Info.plist $ rcodesign debug-create-macho --architecture x86-64 exe.x86_64 assuming default minimum version 11.0.0 writing Mach-O to exe.x86_64 $ rcodesign sign --binary-identifier old-bin-x86_64 exe.x86_64 signing exe.x86_64 in place signing exe.x86_64 as a Mach-O binary parsing Mach-O writing Mach-O to exe.x86_64 $ rcodesign debug-create-macho --architecture aarch64 exe.aarch64 assuming default minimum version 11.0.0 writing Mach-O to exe.aarch64 $ rcodesign macho-universal-create -o old-bin-name exe.x86_64 exe.aarch64 adding exe.x86_64 adding exe.aarch64 writing old-bin-name $ rcodesign sign old-bin-name signing old-bin-name in place signing old-bin-name as a Mach-O binary setting binary identifier to old-bin-name parsing Mach-O writing Mach-O to old-bin-name $ mv old-bin-name MyApp.app/Contents/MacOS/new-bin $ rcodesign -v sign MyApp.app MyApp.app.signed signing MyApp.app to MyApp.app.signed signing bundle at MyApp.app signing bundle at MyApp.app into MyApp.app.signed collecting code resources files copying file MyApp.app/Contents/Info.plist -> MyApp.app.signed/Contents/Info.plist sealing nested Mach-O binary: Contents/MacOS/new-bin signing Mach-O file Contents/MacOS/new-bin setting binary identifier based on path: new-bin inferring default signing settings from Mach-O binary using binary identifier from settings preserving code signature flags in existing Mach-O signature (CodeSignatureFlags(ADHOC)) using binary identifier from settings preserving code signature flags in existing Mach-O signature (CodeSignatureFlags(ADHOC)) signing Mach-O binary at index 0 binary targets macOS >= 11.0.0 with SDK 11.0.0 adding code signature flags from signing settings: CodeSignatureFlags(ADHOC) creating ad-hoc signature code directory version: 132096 total signature size: 280 bytes signing Mach-O binary at index 1 binary targets macOS >= 11.0.0 with SDK 11.0.0 adding code signature flags from signing settings: CodeSignatureFlags(ADHOC) creating ad-hoc signature code directory version: 132096 total signature size: 376 bytes writing Mach-O to MyApp.app.signed/Contents/MacOS/new-bin writing sealed resources to MyApp.app.signed/Contents/_CodeSignature/CodeResources signing main executable Contents/MacOS/MyApp setting main executable binary identifier to com.example.mybundle (derived from CFBundleIdentifier in Info.plist) inferring default signing settings from Mach-O binary signing Mach-O binary at index 0 binary targets macOS >= 11.0.0 with SDK 11.0.0 creating ad-hoc signature code directory version: 132096 total signature size: 421 bytes writing signed main executable to MyApp.app.signed/Contents/MacOS/MyApp $ rcodesign print-signature-info MyApp.app.signed - path: Contents/Info.plist file_size: 576 file_sha256: 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5 entity: other - path: Contents/MacOS/MyApp file_size: 22544 file_sha256: e1dfbe5e2a27918a25ccbe0971b0b40e96c8a1a031a332e8b9fb79475fe0345a entity: mach_o: macho_linkedit_start_offset: 16384 / 0x4000 macho_signature_start_offset: 16400 / 0x4010 macho_signature_end_offset: 16821 / 0x41b5 macho_linkedit_end_offset: 22544 / 0x5810 macho_end_offset: 22544 / 0x5810 linkedit_signature_start_offset: 16 / 0x10 linkedit_signature_end_offset: 437 / 0x1b5 linkedit_bytes_after_signature: 5723 / 0x165b signature: superblob_length: 421 / 0x1a5 blob_count: 3 blobs: - slot: CodeDirectory (0) magic: fade0c02 length: 365 sha1: c826994bd20c58899a48dbca7e237bcc1940096b sha256: ccbff6200513f074b4299064006b820d714a57ad77d06f44924e34c0a6bff910 - slot: RequirementSet (2) magic: fade0c01 length: 12 sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973 sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986 - slot: CMS Signature (65536) magic: fade0b01 length: 8 sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0 code_directory: version: '0x20400' flags: CodeSignatureFlags(ADHOC) identifier: com.example.mybundle digest_type: sha256 platform: 0 signed_entity_size: 16400 executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY) code_digests_count: 5 slot_digests: - 'Info (1): 0a5902dc8e47f490d03889d3593d17bddbf79e6c1f79494e20dd28f9459effa5' - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986' - 'Resources (3): c28145c843d03ba3ddb1c7e5a2029c1e179750bd1be9bfe9ebecb6e7f51922c5' cms: null - path: Contents/MacOS/new-bin file_size: 55312 file_sha256: 177b1b4ff578e3803cade0b792f7ca4537bf94c7ca6844ae584819c118683011 sub_path: macho-index:0 entity: mach_o: macho_linkedit_start_offset: 4096 / 0x1000 macho_signature_start_offset: 4112 / 0x1010 macho_signature_end_offset: 4392 / 0x1128 macho_linkedit_end_offset: 10256 / 0x2810 macho_end_offset: 10256 / 0x2810 linkedit_signature_start_offset: 16 / 0x10 linkedit_signature_end_offset: 296 / 0x128 linkedit_bytes_after_signature: 5864 / 0x16e8 signature: superblob_length: 280 / 0x118 blob_count: 3 blobs: - slot: CodeDirectory (0) magic: fade0c02 length: 224 sha1: 95cb29468e76eefe3f75aa4a6847bdf4ca44cd30 sha256: f677a5c4d4239ef741c96b66a5b1356d3d3d8630f4ca91593f2620f80224a549 - slot: RequirementSet (2) magic: fade0c01 length: 12 sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973 sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986 - slot: CMS Signature (65536) magic: fade0b01 length: 8 sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0 code_directory: version: '0x20400' flags: CodeSignatureFlags(ADHOC) identifier: new-bin digest_type: sha256 platform: 0 signed_entity_size: 4112 executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY) code_digests_count: 2 slot_digests: - 'Info (1): 0000000000000000000000000000000000000000000000000000000000000000' - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986' cms: null - path: Contents/MacOS/new-bin file_size: 55312 file_sha256: 177b1b4ff578e3803cade0b792f7ca4537bf94c7ca6844ae584819c118683011 sub_path: macho-index:1 entity: mach_o: macho_linkedit_start_offset: 16384 / 0x4000 macho_signature_start_offset: 16400 / 0x4010 macho_signature_end_offset: 16776 / 0x4188 macho_linkedit_end_offset: 22544 / 0x5810 macho_end_offset: 22544 / 0x5810 linkedit_signature_start_offset: 16 / 0x10 linkedit_signature_end_offset: 392 / 0x188 linkedit_bytes_after_signature: 5768 / 0x1688 signature: superblob_length: 376 / 0x178 blob_count: 3 blobs: - slot: CodeDirectory (0) magic: fade0c02 length: 320 sha1: 6399ea612a352a77a5e69020d92ff0c3cafc89b5 sha256: 7c122679cc9f0796e02496f20a9f428468c9fc3e74045530ed1a938745c8ee27 - slot: RequirementSet (2) magic: fade0c01 length: 12 sha1: 3a75f6db058529148e14dd7ea1b4729cc09ec973 sha256: 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986 - slot: CMS Signature (65536) magic: fade0b01 length: 8 sha1: 2a7254313aa41796079bb0e9d0f044345f69f98b sha256: e6c83bc98a10348492c7d4d2378a54572ef29e1a5692ccd02b5e29f4b762d6a0 code_directory: version: '0x20400' flags: CodeSignatureFlags(ADHOC) identifier: new-bin digest_type: sha256 platform: 0 signed_entity_size: 16400 executable_segment_flags: ExecutableSegmentFlags(MAIN_BINARY) code_digests_count: 5 slot_digests: - 'Info (1): 0000000000000000000000000000000000000000000000000000000000000000' - 'RequirementSet (2): 987920904eab650e75788c054aa0b0524e6a80bfc71aa32df8d237a61743f986' cms: null - path: Contents/_CodeSignature/CodeResources file_size: 2483 file_sha256: c28145c843d03ba3ddb1c7e5a2029c1e179750bd1be9bfe9ebecb6e7f51922c5 entity: bundle_code_signature_file: !ResourcesXml - - - - - ' files' - ' ' - ' files2' - ' ' - ' MacOS/new-bin' - ' ' - ' cdhash' - ' ' - ' 9nelxNQjnvdByWtmpbE1bT09hjA=' - ' ' - ' requirement' - ' (cdhash H"f677a5c4d4239ef741c96b66a5b1356d3d3d8630") or (cdhash H"7c122679cc9f0796e02496f20a9f428468c9fc3e")' - ' ' - ' ' - ' rules' - ' ' - ' ^Resources/' - ' ' - ' ^Resources/.*/.lproj/' - ' ' - ' optional' - ' ' - ' weight' - ' 1000' - ' ' - ' ^Resources/.*/.lproj/locversion.plist$' - ' ' - ' omit' - ' ' - ' weight' - ' 1100' - ' ' - ' ^Resources/Base/.lproj/' - ' ' - ' weight' - ' 1010' - ' ' - ' ^version.plist$' - ' ' - ' ' - ' rules2' - ' ' - ' .*/.dSYM($|/)' - ' ' - ' weight' - ' 11' - ' ' - ' ^(.*/)?/.DS_Store$' - ' ' - ' omit' - ' ' - ' weight' - ' 2000' - ' ' - ' ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/' - ' ' - ' nested' - ' ' - ' weight' - ' 10' - ' ' - ' ^.*' - ' ' - ' ^Info/.plist$' - ' ' - ' omit' - ' ' - ' weight' - ' 20' - ' ' - ' ^PkgInfo$' - ' ' - ' omit' - ' ' - ' weight' - ' 20' - ' ' - ' ^Resources/' - ' ' - ' weight' - ' 20' - ' ' - ' ^Resources/.*/.lproj/' - ' ' - ' optional' - ' ' - ' weight' - ' 1000' - ' ' - ' ^Resources/.*/.lproj/locversion.plist$' - ' ' - ' omit' - ' ' - ' weight' - ' 1100' - ' ' - ' ^Resources/Base/.lproj/' - ' ' - ' weight' - ' 1010' - ' ' - ' ^[^/]+$' - ' ' - ' nested' - ' ' - ' weight' - ' 10' - ' ' - ' ^embedded/.provisionprofile$' - ' ' - ' weight' - ' 20' - ' ' - ' ^version/.plist$' - ' ' - ' weight' - ' 20' - ' ' - ' ' - - - '' ```