MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / VerifyArtifactChecksum

Function VerifyArtifactChecksum

internal/pluginstore/direct.go:45–56  ·  view source on GitHub ↗
(artifact Artifact, data []byte)

Source from the content-addressed store, hash-verified

43}
44
45func VerifyArtifactChecksum(artifact Artifact, data []byte) error {
46 expected := strings.ToLower(strings.TrimSpace(artifact.SHA256))
47 if expected == "" {
48 return fmt.Errorf("artifact checksum missing")
49 }
50 actualBytes := sha256.Sum256(data)
51 actual := hex.EncodeToString(actualBytes[:])
52 if actual != expected {
53 return fmt.Errorf("artifact checksum mismatch")
54 }
55 return nil
56}

Callers 1

InstallDirectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected