commit
506093216c
|
@ -1,4 +1,5 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
import itertools
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
|
|
||||||
import multihash
|
import multihash
|
||||||
|
@ -180,7 +181,7 @@ def _select_parameter_from_order(
|
||||||
else:
|
else:
|
||||||
return supported_parameters.split(",")[0]
|
return supported_parameters.split(",")[0]
|
||||||
|
|
||||||
for first, second in zip(first_choices, second_choices):
|
for first, second in itertools.product(first_choices, second_choices):
|
||||||
if first == second:
|
if first == second:
|
||||||
return first
|
return first
|
||||||
raise IncompatibleChoices()
|
raise IncompatibleChoices()
|
||||||
|
@ -245,7 +246,12 @@ async def _establish_session_parameters(
|
||||||
if not remote_peer:
|
if not remote_peer:
|
||||||
remote_peer = remote_peer_from_proposal
|
remote_peer = remote_peer_from_proposal
|
||||||
elif remote_peer != remote_peer_from_proposal:
|
elif remote_peer != remote_peer_from_proposal:
|
||||||
raise PeerMismatchException()
|
raise PeerMismatchException(
|
||||||
|
{
|
||||||
|
"expected_remote_peer": remote_peer,
|
||||||
|
"received_remote_peer": remote_peer_from_proposal,
|
||||||
|
}
|
||||||
|
)
|
||||||
session_parameters.remote_peer = remote_peer
|
session_parameters.remote_peer = remote_peer
|
||||||
|
|
||||||
curve_param, cipher_param, hash_param, order = _select_encryption_parameters(
|
curve_param, cipher_param, hash_param, order = _select_encryption_parameters(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user