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)
| 191 | // id is the identifier used for signing (a field in CodeDirectory blob, which |
| 192 | // has no significance in ad-hoc signing). |
| 193 | func 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). |
no outgoing calls
no test coverage detected
searching dependent graphs…