key: combine crashed with unbounded recursion when no valid pubkeys were given, and silently dropped unparseable keys from the result.

This commit is contained in:
Yasuhiro Matsumoto
2026-07-15 09:40:55 +09:00
parent d374fe9bd3
commit 8563178bfd

6
key.go
View File

@@ -310,6 +310,12 @@ However, if the intent is to check if two existing Nostr pubkeys match a given c
continue
}
return fmt.Errorf("invalid key %s: expected 32 or 33 bytes hex", keyhex)
}
if len(keyGroups) < 2 {
return fmt.Errorf("at least two pubkeys are required")
}
result.Combinations = make([]Combination, 0, 16)