All checks were successful
Test / Create distribution (push) Successful in 33s
Test / Sandbox (push) Successful in 1m56s
Test / Sandbox (race detector) (push) Successful in 3m7s
Test / Planterette (push) Successful in 3m35s
Test / Hakurei (race detector) (push) Successful in 4m23s
Test / Hakurei (push) Successful in 2m7s
Test / Flake checks (push) Successful in 1m19s
Filter programs are different across platforms. This representation is also much more readable. Signed-off-by: Ophestra <cat@gensokyo.uk>
29 lines
429 B
Go
29 lines
429 B
Go
package seccomp_test
|
|
|
|
import (
|
|
"encoding/hex"
|
|
|
|
"hakurei.app/container/seccomp"
|
|
)
|
|
|
|
type (
|
|
bpfPreset = struct {
|
|
seccomp.ExportFlag
|
|
seccomp.FilterPreset
|
|
}
|
|
bpfLookup map[bpfPreset][]byte
|
|
)
|
|
|
|
func toHash(s string) []byte {
|
|
if len(s) != 128 {
|
|
panic("bad sha512 string length")
|
|
}
|
|
if v, err := hex.DecodeString(s); err != nil {
|
|
panic(err.Error())
|
|
} else if len(v) != 64 {
|
|
panic("unreachable")
|
|
} else {
|
|
return v
|
|
}
|
|
}
|