aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/seccomp/hash_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-10-13 18:49:58 +0900
committerOphestra <cat@gensokyo.uk>2025-10-13 18:51:35 +0900
commit123d7fbfd5a2955dc5042c0a85211e376d5a8e65 (patch)
tree7e03e35309083b81873f3cf1939d2f4d27d41659 /container/seccomp/hash_test.go
parent7638a44fa613f23434318bdf136723aa010e8638 (diff)
container/seccomp: remove export pipe
This was only useful when wrapping bwrap. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/seccomp/hash_test.go')
-rw-r--r--container/seccomp/hash_test.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/container/seccomp/hash_test.go b/container/seccomp/hash_test.go
index 24f6b1c7..5c995582 100644
--- a/container/seccomp/hash_test.go
+++ b/container/seccomp/hash_test.go
@@ -1,6 +1,7 @@
package seccomp_test
import (
+ "crypto/sha512"
"encoding/hex"
"hakurei.app/container/bits"
@@ -12,18 +13,18 @@ type (
seccomp.ExportFlag
bits.FilterPreset
}
- bpfLookup map[bpfPreset][]byte
+ bpfLookup map[bpfPreset][sha512.Size]byte
)
-func toHash(s string) []byte {
- if len(s) != 128 {
+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) != 64 {
+ } else if len(v) != sha512.Size {
panic("unreachable")
} else {
- return v
+ return ([sha512.Size]byte)(v)
}
}