From 6c01925342a143e3ed801610452e44d11684317c Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Thu, 9 May 2024 18:48:11 +0200 Subject: [PATCH] Ensure that keys can be parsed in SetKeys. --- group/description.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/group/description.go b/group/description.go index 91b0a97..4af6967 100644 --- a/group/description.go +++ b/group/description.go @@ -11,6 +11,8 @@ import ( "path/filepath" "strings" "time" + + "github.com/jech/galene/token" ) var ErrTagMismatch = errors.New("tag mismatch") @@ -578,6 +580,13 @@ func SetWildcardUser(group string, user *UserDescription) error { } func SetKeys(group string, keys []map[string]any) error { + if keys != nil { + _, err := token.ParseKeys(keys) + if err != nil { + return err + } + } + groups.mu.Lock() defer groups.mu.Unlock()