MCPcopy
hub / github.com/ddworken/hishtory / stripCodeSignature

Function stripCodeSignature

client/cmd/update.go:215–230  ·  view source on GitHub ↗
(inPath, outPath string)

Source from the content-addressed store, hash-verified

213}
214
215func stripCodeSignature(inPath, outPath string) error {
216 _, err := exec.LookPath("codesign_allocate")
217 if err != nil {
218 return fmt.Errorf("your system is missing the codesign_allocate tool, so we can't verify the SLSA attestation (you can bypass this by setting `export HISHTORY_DISABLE_SLSA_ATTESTATION=true` in your shell)")
219 }
220 cmd := exec.Command("codesign_allocate", "-i", inPath, "-o", outPath, "-r")
221 var stdout bytes.Buffer
222 cmd.Stdout = &stdout
223 var stderr bytes.Buffer
224 cmd.Stderr = &stderr
225 err = cmd.Run()
226 if err != nil {
227 return fmt.Errorf("failed to use codesign_allocate to strip signatures on binary=%v (stdout=%#v, stderr%#v): %w", inPath, stdout.String(), stderr.String(), err)
228 }
229 return nil
230}
231
232func downloadFiles(updateInfo shared.UpdateInfo) error {
233 clientUrl := ""

Calls 2

RunMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected