fix secagg servkey condition check for parties
For secure aggregation, when re-using a server key from the component database (node or researcher), we perform a check on the list of parties to which this secagg is attached
The current checking condition is:
if (not isinstance(context, dict) or
'parties' not in context or (
context['parties'] is not None and (
not isinstance(context['parties'], list) or
not set(self._parties).issubset(set(context['parties']))
))):
# Note: for servkey, we should not find an entry where
# `parties` are `None` in database, as we don't create such entry
It is well suited for biprime, but for servkey a more strict condition can be applied: list of parties must be exactly the same (content, order).
-
None
should not exist (servkey is always attached to a list of parties) - secagg cannot perform correctly with a subset of the parties used to establish the servkey
Consequence of the bug: in some cases we may accept to attempt secure aggregation which will then fail.
Goal of the fix: this fix catches the error before attempting this secagg + gives clear message.