Add more information to the peer mismatch exception

This commit is contained in:
Alex Stokes 2019-09-03 13:28:18 -07:00
parent 350cc04c97
commit f8bbaf60a1
No known key found for this signature in database
GPG Key ID: 51CE1721B245C086

View File

@ -245,7 +245,12 @@ async def _establish_session_parameters(
if not remote_peer:
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
curve_param, cipher_param, hash_param, order = _select_encryption_parameters(