MCPcopy Create free account
hub / github.com/Binject/universal / Size

Function Size

codesign_darwin.go:193–199  ·  view source on GitHub ↗

Size computes the size of the code signature. id is the identifier used for signing (a field in CodeDirectory blob, which has no significance in ad-hoc signing).

(codeSize int64, id string)

Source from the content-addressed store, hash-verified

191// id is the identifier used for signing (a field in CodeDirectory blob, which
192// has no significance in ad-hoc signing).
193func Size(codeSize int64, id string) int64 {
194 nhashes := (codeSize + pageSize - 1) / pageSize
195 idOff := int64(codeDirectorySize)
196 hashOff := idOff + int64(len(id)+1)
197 cdirSz := hashOff + nhashes*sha256.Size
198 return int64(superBlobSize+blobSize) + cdirSz
199}
200
201// Sign generates an ad-hoc code signature and writes it to out.
202// out must have length at least Size(codeSize, id).

Callers 2

SignFunction · 0.85
machoCodeSignFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…