From 123d7fbfd5a2955dc5042c0a85211e376d5a8e65 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 13 Oct 2025 18:49:58 +0900 Subject: container/seccomp: remove export pipe This was only useful when wrapping bwrap. Signed-off-by: Ophestra --- container/seccomp/hash_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'container/seccomp/hash_test.go') 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) } } -- cgit v1.3.1