Skip to content

Commit ea16e88

Browse files
authored
Use SHA256 to digest the seccomp profile (#529)
2 parents 271a727 + e91fb78 commit ea16e88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/security_context.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package core
1818

1919
import (
2020
"bytes"
21-
"crypto/md5"
21+
"crypto/sha256"
2222
"encoding/json"
2323
"fmt"
2424
"os"
@@ -316,8 +316,8 @@ func getSeccompDockerOpts(seccomp *runtimeapi.SecurityProfile, privileged bool)
316316
if err := json.Compact(b, file); err != nil {
317317
return nil, err
318318
}
319-
// Rather than the full profile, just put the filename & md5sum in the event log.
320-
msg := fmt.Sprintf("%s(md5:%x)", fname, md5.Sum(file))
319+
// Rather than the full profile, just put the filename & digest in the event log.
320+
msg := fmt.Sprintf("%s(sha256:%x)", fname, sha256.Sum256(file))
321321

322322
return []DockerOpt{{"seccomp", b.String(), msg}}, nil
323323
}

0 commit comments

Comments
 (0)