aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-node/tests/test_webrtc_transport.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-node/tests/test_webrtc_transport.py')
-rw-r--r--packages/meshbay-node/tests/test_webrtc_transport.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/packages/meshbay-node/tests/test_webrtc_transport.py b/packages/meshbay-node/tests/test_webrtc_transport.py
index 07bdbea..93cd3fd 100644
--- a/packages/meshbay-node/tests/test_webrtc_transport.py
+++ b/packages/meshbay-node/tests/test_webrtc_transport.py
@@ -1155,11 +1155,19 @@ async def test_invite_then_join_delivers_the_gek(sk_node, sk_hub, gek, shared_di
assert challenge["type"] == MNP.HANDSHAKE_CHALLENGE
nonce_s = base64.b64decode(challenge["nonce"])
+ # Bob signs a transcript naming the node, and he cannot complete the handshake
+ # that would prove its key — he has no GEK yet. So he has to be able to learn
+ # it from the challenge; taking it from the test's own knowledge of sk_node
+ # would hide the fact that a real client cannot.
+ assert challenge["node_pk"] == pk_to_b64(sk_node.public_key()), (
+ "the challenge must announce the node key to a first-time joiner")
+ node_pk_b64 = challenge["node_pk"]
+
pk_ed_b64 = pk_to_b64(sk_bob_ed.public_key())
pk_x_b64 = base64.b64encode(pk_x_raw).decode()
ts = int(time.time())
transcript = join_transcript(
- node_pk_b64=pk_to_b64(sk_node.public_key()),
+ node_pk_b64=node_pk_b64,
group_id=TEST_GROUP, user_id="user-002",
pk_ed25519_b64=pk_ed_b64, pk_x25519_b64=pk_x_b64,
nonce_node=nonce_s, ts=ts,