Skip to content

Commit 69b0d5d

Browse files
authored
Apply suggestions from code review
Co-authored-by: William Woodruff <william@yossarian.net>
1 parent 709f94f commit 69b0d5d

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

README.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,6 @@ the required ad-hoc signature in Ruby instead of invoking `/usr/bin/codesign`:
5656
MachO.codesign!("/path/to/my/binary")
5757
```
5858

59-
The implementation follows the public structures used by
60-
[XNU](https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/kern/cs_blobs.h)
61-
and [ld64](https://github.com/apple-oss-distributions/ld64). For each thin
62-
Mach-O slice it adds or replaces `LC_CODE_SIGNATURE`, resizes `__LINKEDIT` then
63-
hashes the final pre-signature bytes in 4 KiB pages. It emits a SHA-256
64-
CodeDirectory, adding a SHA-1 alternate only when the declared deployment target
65-
requires legacy hash agility. Fat binaries are signed one slice at a time then
66-
laid out again with updated architecture offsets and sizes.
67-
68-
When replacing a non-linker signature, the signer preserves its requirements,
69-
entitlements, flags, runtime version and executable-segment flags. Linker
70-
signatures use fresh ad-hoc metadata, matching Apple's replacement behaviour.
71-
Code-signing blobs use their mandated big-endian representation independently
72-
of the Mach-O byte order, while the load command retains the slice byte order.
73-
74-
The complete signature is built and validated before the file is written. This
75-
leaves the on-disk file unchanged on validation errors, while the final in-place
76-
write preserves its inode, mode and hard links. Adding a missing load command
77-
requires 16 bytes of existing header padding; ruby-macho raises
78-
`MachO::CodeSigningError` rather than moving segments when that space is absent.
79-
Only ad-hoc signing is provided: certificate identities, Developer ID signing,
80-
notarisation and policy assessment remain outside ruby-macho's scope. See
81-
[issue #262](https://github.com/Homebrew/ruby-macho/issues/262) for the original
82-
design discussion.
8359

8460
### What works?
8561

0 commit comments

Comments
 (0)