diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/_util.py | 3 | ||||
-rw-r--r-- | tests/test_transport.py | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/_util.py b/tests/_util.py index ec7585df..acc06852 100644 --- a/tests/_util.py +++ b/tests/_util.py @@ -352,6 +352,9 @@ def server( """ SSH server contextmanager for testing. + Yields a tuple of ``(tc, ts)`` (client- and server-side `Transport` + objects), or ``(tc, ts, err)`` when ``catch_error==True``. + :param hostkey: Host key to use for the server; if None, loads ``rsa.key``. diff --git a/tests/test_transport.py b/tests/test_transport.py index b2efd637..421c078b 100644 --- a/tests/test_transport.py +++ b/tests/test_transport.py @@ -1213,10 +1213,14 @@ class TestSHA2SignatureKeyExchange(unittest.TestCase): class TestExtInfo(unittest.TestCase): - def test_ext_info_handshake(self): + def test_ext_info_handshake_exposed_in_client_kexinit(self): with server() as (tc, _): + # NOTE: this is latest KEXINIT /sent by us/ (Transport retains it) kex = tc._get_latest_kex_init() - assert kex["kex_algo_list"][-1] == "ext-info-c" + # flag in KexAlgorithms list + assert "ext-info-c" in kex["kex_algo_list"] + # data stored on Transport after hearing back from a compatible + # server (such as ourselves in server mode) assert tc.server_extensions == { "server-sig-algs": b"ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss" # noqa } |