aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/seccomp/hash_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-11-05 04:48:05 +0900
committerOphestra <cat@gensokyo.uk>2025-11-05 04:48:05 +0900
commitbecaf8b6d7151971907ff65f338afa038f021c92 (patch)
tree4130439807baa92b11d85ad1199d0f2f5e27f001 /container/seccomp/hash_test.go
parent54c0d6bf48fdfade3aaf7741ec3d3cbc302c8b82 (diff)
std: relocate seccomp lookup tables
This should enable resolving NativeRule in hst. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/seccomp/hash_test.go')
-rw-r--r--container/seccomp/hash_test.go30
1 files changed, 0 insertions, 30 deletions
diff --git a/container/seccomp/hash_test.go b/container/seccomp/hash_test.go
deleted file mode 100644
index b86d49ba..00000000
--- a/container/seccomp/hash_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package seccomp_test
-
-import (
- "crypto/sha512"
- "encoding/hex"
-
- "hakurei.app/container/seccomp"
- "hakurei.app/container/std"
-)
-
-type (
- bpfPreset = struct {
- seccomp.ExportFlag
- std.FilterPreset
- }
- bpfLookup map[bpfPreset][sha512.Size]byte
-)
-
-func toHash(s string) [sha512.Size]byte {
- if len(s) != sha512.Size*2 {
- panic("bad sha512 string length")
- }
- if v, err := hex.DecodeString(s); err != nil {
- panic(err.Error())
- } else if len(v) != sha512.Size {
- panic("unreachable")
- } else {
- return ([sha512.Size]byte)(v)
- }
-}