support empty distributions in both directions

This commit is contained in:
Gilles Boccon-Gibod
2022-08-30 18:50:48 -07:00
parent 159cbf7774
commit 624e860762
2 changed files with 5 additions and 6 deletions

View File

@@ -1014,10 +1014,10 @@ class Session:
if self.is_responder:
# The responder distributes its keys first, the initiator later
self.distribute_keys()
else:
# If we're not expecting key distributions from the peer, we're done
if not self.peer_expected_distributions:
self.on_peer_key_distribution_complete()
# If we're not expecting key distributions from the peer, we're done
if not self.peer_expected_distributions:
self.on_peer_key_distribution_complete()
def on_connection_encryption_key_refresh(self):
# Do as if the connection had just been encrypted

View File

@@ -246,8 +246,7 @@ IO_CAP = [
SC = [False, True]
MITM = [False, True]
# Key distribution is a 4-bit bitmask
# IdKey is necessary for current SMP structure
KEY_DIST = [i for i in range(16) if (i & SMP_ID_KEY_DISTRIBUTION_FLAG)]
KEY_DIST = range(16)
@pytest.mark.asyncio
@pytest.mark.parametrize('io_cap, sc, mitm, key_dist',